1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
#!/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
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_pycentral -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
|