#! /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

# This is the debhelper compatibility version to use.
export DH_COMPAT=4

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

clean:
	dh_testdir 
	-$(MAKE) clean
	rm -f install-stamp build-stamp
	dh_clean

build:
	echo "You don't need to build this package"

install-stamp:
	dh_testdir
	python setup.py install -O1 --root $(CURDIR)/debian/sagator-pydspam/
	rm -f *.spec*
	touch install-stamp

install:	install-stamp

sagator-pydspam: install
	dh_testdir
	dh_installdirs -p$@
	dh_installdocs -p$@ README example.py
	dh_install -p$@
	dh_installchangelogs ChangeLog
	dh_strip -p$@
	dh_compress -p$@ -X.pdf -X.html -X.css -X.png
	dh_makeshlibs -V -p$@
	dh_installdebconf -p$@
	dh_md5sums -p$@
	dh_installdeb -p$@
	dh_shlibdeps -l debian/sagator-pydspam/usr/lib -p$@
	dh_gencontrol -p$@
	dh_builddeb -p$@

# Build architecture dependant packages using the common target.
binary-arch: install sagator-pydspam

binary: clean binary-arch

.PHONY:	binary-arch binary install build
