#!/usr/bin/make -f # -*- makefile -*- # Based on "Sample debian/rules that uses debhelper". # GNU copyright 1997 to 1999 by Joey Hess. # Copyright 2003-2006 Fabian Fagerholm. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS # The versions of python currently supported PYVERS=$(shell pyversions -r debian/control) export MY_DIR=$(shell mktemp -d) # Targets for running unit tests test-build: test-build-stamp test-build-stamp: dh_testdir # run the session server PYTHONPATH=`pwd` session-server/al-session-daemon -k $$MY_DIR/sess.pid -l $$MY_DIR/log start # run the tests, stop the session server make -C test all; \ result=$$?; \ PYTHONPATH=`pwd` session-server/al-session-daemon -k $$MY_DIR/sess.pid -l $$MY_DIR/log stop; \ exit $$result touch $@ # Targets for building different parts of the package build: build-stamp test-build build-stamp: $(PYVERS:%=build-ext-%) build-doc /usr/bin/docbook-to-man debian/al-session-daemon.sgml > al-session-daemon.8 /usr/bin/docbook-to-man debian/al-httpd.sgml > al-httpd.8 touch $@ build-ext-%: dh_testdir $* setup.py build touch $@ build-doc: build-doc-stamp build-doc-stamp: PYTHONPATH=`pwd` make -C doc pdf touch $@ # Clean up everything clean: dh_testdir dh_testroot for python in $(PYVERS); do \ $$python setup.py clean; \ done rm -rf *-stamp *-stamp-* build rm -f al-session-daemon.8 al-httpd.8 find debian -name '*.py[co]' -exec rm -f {} \; find doc -name '*.py[co]' -exec rm -f {} \; find doc -name '*.pdf' -exec rm -f {} \; find doc -name '*.eps' -exec rm -f {} \; find doc -name '*methods.tex' -exec rm -f {} \; find test -name '*.py[co]' -exec rm -f {} \; find albatross -name '*.py[co]' -exec rm -f {} \; rm -f build-ext-python* install-ext-python* rm -f doc/albatross.lof doc/albatross.tex2 doc/other.html dh_clean # Install files in their correct locations install: install-stamp install-stamp: build-stamp $(PYVERS:%=install-ext-%) dh_testdir dh_testroot dh_installdocs -ppython-albatross rm -rf $(CURDIR)/debian/python-albatross/usr/bin dh_installinit -ppython-albatross-common --name=albatross dh_installlogrotate -ppython-albatross-common --name=albatross dh_installman -ppython-albatross-common al-httpd.8 al-session-daemon.8 dh_install -ppython-albatross-common \ session-server/al-session-daemon \ standalone-server/al-httpd usr/bin dh_install -ppython-albatross-doc \ doc/albatross.pdf \ usr/share/doc/python-albatross-doc touch $@ install-ext-%: $* setup.py install --root=$(CURDIR)/debian/python-albatross --prefix=/usr \ --install-layout=deb touch $@ # Dummy target to satisfy policy. binary-arch: # Build architecture-independent files here. # Pass -i to debhelper commands in this target to reduce clutter. binary-indep: build install dh_testdir -i dh_testroot -i dh_installchangelogs ChangeLog -i dh_installdocs -i dh_compress -i dh_python2 -i -Npython-albatross-doc dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary: binary-indep .PHONY: test-build build build-doc clean install binary-arch binary-indep binary