#!/usr/bin/make -f
PYVERS=2.4
PYMODULE=kundebunt

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=4

python=python$(PYVERS)
pythonbin=/usr/bin/$(python)
package=$(python)-$(PYMODULE)
instroot=debian/$(package)

build: build-stamp
	$(pythonbin) setup.py build
build-stamp:
	dh_testdir
	touch build-stamp

configure:
	# Do nothing

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	-rm -rf build
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	cd kundebunt && DJANGO_SETTINGS_MODULE="" $(pythonbin) /usr/lib/$(python)/site-packages/django/bin/compile-messages.py
	$(pythonbin) setup.py install --no-compile --root=$(instroot) --single-version-externally-managed

# Build architecture-independent files here.
binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdirs /var/cache/kundebunt/django-cache
	dh_installdocs
	dh_installchangelogs
	dh_installinit --name kundebunt-fcgi -- defaults 30
	dh_installcron --name kundebunt
	dh_compress
	dh_fixperms
	chmod og-rwx $(instroot)/etc/kundebunt/settings.ini
	dh_python -V $(PYVERS)
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb
# We have nothing to do by default.

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