#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DH_COMPAT=5

build: build-stamp

build-stamp:
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp
	dh_clean

install: build install-prereq install-pyservlet
	# Script fixing would appear here.

install-prereq:
	dh_testdir
	dh_testroot
	dh_clean -k

# The main WebStack libraries should be installed in the python-webstack package.

install-pyservlet:
	# NOTE: To be enabled in the future, perhaps.
	#install -d $(CURDIR)/debian/jython-webstack/usr/share/java
	#cp tools/JavaServlet/classes/webstack-pyservlet.jar $(CURDIR)/debian/jython-webstack/usr/share/java/

# The WebStack scripts (including Jython/Java-related scripts) should be
# installed in the python-webstack package.

# Build architecture-independent files here.

binary-indep: install
	JYTHON_LIB=/usr/share/jython/jython.jar SERVLET_LIB=/usr/share/java/servlet-api.jar tools/JavaServlet/compile.sh
	dh_testdir -i
	dh_testroot -i
	#dh_pycentral -i
	dh_installdocs -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.

binary-arch:
	# Empty rule for this package.

binary: binary-indep binary-arch
.PHONY: build clean binary-arch binary-indep binary install
