#!/usr/bin/make -f
#
# python-pyrss2gen

# Verbose mode
#export DH_VERBOSE=1

# Supported python versions
PYTHON := /usr/bin/python
PYVERS := $(shell pyversions -r debian/control)

clean:
	dh_testdir
	dh_testroot
	
	set -e; \
	for python in $(PYVERS); do \
		[ -x "/usr/bin/$$python" ] && $$python setup.py clean || true; \
	done
	find . -name "*.py[co]" -exec rm -f {} \;
	rm -rf build-stamp build
	
	dh_clean

build: build-stamp
build-stamp:
	dh_testdir
	dh_installdirs
	
	# Install python module. 
	for python in $(PYVERS); do \
		[ -x "/usr/bin/$$python" ] && $$python setup.py install \
			--root `pwd`/debian/python-pyrss2gen || true; \
	done
	
	touch build-stamp

binary-arch:
binary-indep: build
	dh_installdocs -A README
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_pycentral
	dh_gencontrol
	dh_installdeb
	dh_md5sums
	dh_builddeb

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