chiark / gitweb /
c1eb564d259819a063644ad3ae1245195e511ac7
[tripe] / debian / rules
1 #! /usr/bin/make -f
2
3 DH_OPTIONS               = --parallel -Bdebian/build
4
5 ###--------------------------------------------------------------------------
6 ### Configuration.
7
8 OVERRIDES               += auto_configure
9 dh_auto_configure_OPTS   = --
10
11 ## Various files and directories.
12 dh_auto_configure_OPTS  += --libdir="\$${prefix}/lib"
13 dh_auto_configure_OPTS  += --libexecdir="\$${libdir}/tripe"
14 dh_auto_configure_OPTS  += --with-configdir="/etc/tripe"
15 dh_auto_configure_OPTS  += --with-socketdir="/var/run"
16 dh_auto_configure_OPTS  += --with-logfile="/var/log/tripe/tripe.log"
17 dh_auto_configure_OPTS  += --with-pidfile="/var/run/tripectl.pid"
18
19 ## The default tunnel.  If we try to port this to other kernels, we'll need
20 ## something more complicated here.
21 dh_auto_configure_OPTS  += --with-tunnel="linux slip"
22
23 ###--------------------------------------------------------------------------
24 ### The wireshark plugin.
25
26 OVERRIDES               += gencontrol
27 dh-gencontrol-hook::
28         dpkg --status wireshark-common | \
29                 sed -n 's/^Version: */tripe:Wireshark-Version=/p' \
30                 >> debian/tripe-wireshark.substvars
31
32 ###--------------------------------------------------------------------------
33 ### The startup script and related machinery.
34
35 dh_auto_configure_OPTS  += --with-initconfig="/etc/default/tripe"
36
37 OVERRIDES               += installinit
38 dh-installinit-hook::
39         cp debian/build/init/tripe-init debian/tripe.init
40         sed 's/^#\(user\|group\)/\1/' \
41                 init/tripe.conf >debian/tripe.default
42
43 OVERRIDES               += clean
44 dh-clean-hook::
45         rm -f debian/tripe.init debian/tripe.default
46
47 ###--------------------------------------------------------------------------
48 ### Other things.
49
50 ## Python stuff.
51 DH_OPTIONS              += --with=python-central
52 OVERRIDES               += pycentral
53 dh_pycentral_OPTS       += -ppython-tripe
54
55 ## The peer database.
56 OVERRIDES               += install
57 dh-install-hook::
58         mkdir -p debian/tripe-peer-services/etc/tripe/peers.d
59         install -m644 peerdb/peers.in \
60                 debian/tripe-peer-services/etc/tripe/peers.d/10base
61
62 ###--------------------------------------------------------------------------
63 ### Some machinery for overriding Debhelper in a structured way.
64
65 %:; dh $@ $(DH_OPTIONS)
66
67 $(foreach o, $(sort $(OVERRIDES)), dh-$o-hook)::; @:
68 $(foreach o, $(sort $(OVERRIDES)), override_dh_$o): override_dh_%: dh-%-hook
69         dh_$* $(addprefix -O, $(DH_OPTIONS)) $(dh_$*_OPTS)
70
71 ###----- That's all, folks --------------------------------------------------