File: rules

package info (click to toggle)
albatross 1.35-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,328 kB
  • ctags: 1,702
  • sloc: python: 6,964; makefile: 139; sh: 123
file content (103 lines) | stat: -rwxr-xr-x 2,990 bytes parent folder | download
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
#!/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
	make -C test all
	# stop the session server
	PYTHONPATH=`pwd` session-server/al-session-daemon -k $$MY_DIR/sess.pid -l $$MY_DIR/log stop
	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 {} \;
	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
	touch $@

# Dummy target to satisfy policy.
binary-arch:
	true

# 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