#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

PYTHON_VERSIONS := $(shell pyversions -r debian/control)

-include /usr/share/python/python.mk

build: build-stamp
build-stamp:
	dh_testdir

	for py in $(PYTHON_VERSIONS); do \
		$$py config_unix.py --prefix /usr; \
		$$py setup.py build; \
	done

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	for py in $(PYTHON_VERSIONS); do \
		$$py config_unix.py --prefix /usr; \
		$$py setup.py clean --all; \
	done

	rm -rf Setup build
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_installdirs

	for py in $(PYTHON_VERSIONS); do \
		$$py setup.py install  --skip-build  --no-compile --root=$(CURDIR)/debian/python-pymad --prefix=/usr $(py_setup_install_args); \
	done


# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installchangelogs  NEWS
	dh_python2
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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