#!/usr/bin/make -f

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

PYVERS=$(shell pyversions -r)

build: build-stamp
build-stamp: patch-stamp
	dh_testdir
	
	set -e; \
	for python in $(PYVERS); \
	    do $$python setup.py build --executable=/usr/bin/python; \
	done
	docbook-to-man debian/pympd.sgml > pympd.1

	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp
	
	for python in $(PYVERS); \
	    do $$python setup.py clean; \
	done
	rm -rf build pympd.1

	dh_clean 

patch-stamp:
	dpatch apply-all
	touch patch-stamp

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs
	
	set -e; \
	for python in $(PYVERS); \
	    do $$python setup.py install --root=debian/pympd --prefix=/usr; \
	done

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installmenu
	dh_installman pympd.1
	dh_compress
	dh_fixperms
	dh_pycentral
	dh_python
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
#!/usr/bin/make -f

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

PYVERS=$(shell pyversions -r)

build: build-stamp
build-stamp: patch-stamp
	dh_testdir
	
	set -e; \
	for python in $(PYVERS); \
	    do $$python setup.py build --executable=/usr/bin/python; \
	done
	docbook-to-man debian/pympd.sgml > pympd.1

	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp
	
	for python in $(PYVERS); \
	    do $$python setup.py clean; \
	done
	rm -rf build pympd.1

	dh_clean 

patch-stamp:
	dpatch apply-all
	touch patch-stamp

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs
	
	set -e; \
	for python in $(PYVERS); \
	    do $$python setup.py install --root=debian/pympd --prefix=/usr; \
	done

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installmenu
	dh_installman pympd.1
	dh_compress
	dh_fixperms
	dh_pycentral
	dh_python
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install

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