#!/usr/bin/make -f

build: build-stamp
build-stamp:
	dh_testdir
	dh build
	touch $@

clean:
	dh_testdir
	dh_clean
	python setup.py clean
	-rm -rf build

P26LIB=debian/pymca/usr/lib/python2.6/dist-packages/PyMca
P27LIB=debian/pymca/usr/lib/python2.7/dist-packages/PyMca

override_dh_install:
	dh_install
	chmod -R a-X debian/pymca-data/usr/share/*
	chmod -R a-X debian/pymca/usr/lib/*
	# FIXME: Is there an easier way to exclude files which
	# are installed to another binary package?
	rm -rf $(P26LIB)/attdata
	rm $(P26LIB)/*.dat
	rm $(P26LIB)/*.dict
	rm $(P26LIB)/*.cfg
	rm $(P26LIB)/changelog.txt
	rm -rf $(P27LIB)/attdata
	rm $(P27LIB)/*.dat
	rm $(P27LIB)/*.dict
	rm $(P27LIB)/*.cfg
	rm $(P27LIB)/changelog.txt
override_dh_pysupport:
	dh_pysupport
	chmod 755 debian/pymca-data/usr/share/pyshared
	chmod 755 debian/pymca-data/usr/share/pyshared/PyMca
	chmod 755 debian/pymca-data/usr/share/pyshared/PyMca/attdata
override_dh_installchangelogs:
	dh_installchangelogs PyMca/changelog.txt
override_dh_compress:
	dh_compress -X.pdf
install: build install-stamp
install-stamp:
	dh install
	touch $@

binary-indep: build install
	dh binary-indep

binary-arch: build install
	dh binary-arch

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