CGI_DIR=/usr/local/projects/thes/docs/demos

PYTHON_SRC= \
SKOSThesaurusService_services.py \
SKOSThesaurusService_services_types.py \
get.py \
LICENSE
TMPL= \
get.tmpl

DISTFILES=README Makefile $(PYTHON_SRC) $(TMPL) \
wsdl2py.patch

PACKAGE=dreft-client

install: \
$(CGI_DIR)/SKOSThesaurusService_services.py \
$(CGI_DIR)/SKOSThesaurusService_services_types.py \
$(CGI_DIR)/get.py \
$(CGI_DIR)/get.tmpl

$(CGI_DIR)/SKOSThesaurusService_services.py: SKOSThesaurusService_services.py
	install -m755 $? $@

$(CGI_DIR)/SKOSThesaurusService_services_types.py: SKOSThesaurusService_services_types.py
	install -m755 $? $@

$(CGI_DIR)/get.py: get.py
	install -m755 $? $@

$(CGI_DIR)/get.tmpl: get.tmpl
	install -m644 $? $@

clean:
	rm -f *.pyc *.tmplc *~

dist: $(DISTFILES)
	version=`date +%Y-%m-%d`; \
	name="$(PACKAGE)-$$version"; \
	rm -f $$name.zip; \
	zip $$name $(DISTFILES)

wsdl:
	wsdl2py -u http://www.w3.org/2001/sw/Europe/reports/thes/api/wsdl/Service.wsdl
	echo "Applying patch to fix some conversion bugs"
	patch -p0 < wsdl2py.patch
