#!/usr/bin/make -f

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

PYVERSIONS=$(shell pyversions -v -r)

override_dh_compress:
	dh_compress -X examples

override_dh_auto_configure-%:
	SITECONF_NAME=siteconf$*.py python$* ./configure.py \
			--taglib-inc-dir=`pkg-config --cflags-only-I taglib | sed 's/-I//'` \
			--boost-python-libname=boost_python-py`echo $* | tr -d .`

override_dh_auto_configure: $(PYVERSIONS:%=override_dh_auto_configure-%)

override_dh_auto_build-%:
	SITECONF_NAME=siteconf$*.py python$* setup.py build -b build$*

override_dh_auto_build: $(PYVERSIONS:%=override_dh_auto_build-%)

override_dh_auto_install-%:
	SITECONF_NAME=siteconf$*.py python$* setup.py build -b build$* install --no-compile --root=debian/python-tagpy --install-layout=deb

override_dh_auto_install: $(PYVERSIONS:%=override_dh_auto_install-%)

override_dh_auto_clean:
	rm -rf build siteconf*.py *.pyc

build: build-stamp
build-arch: build-stamp
build-indep: build-stamp

build-stamp:
	dh --with python2 build
	touch $@

clean:
	dh --with python2 clean

install: build
	dh --with python2 install

# Build architecture-independent files here.
binary-indep: build-indep install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build-arch install
	dh --with python2 binary-arch

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