X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/6b6ad6702f305891ced3b9a7cf3061c75eabda86..9867bea0e9719d3e66b9b1504c728579a9a6b39c:/debian/rules diff --git a/debian/rules b/debian/rules index e48ae073..01625b27 100755 --- a/debian/rules +++ b/debian/rules @@ -1,51 +1,73 @@ #! /usr/bin/make -f -CDBS = /usr/share/cdbs/1 - -include $(CDBS)/rules/debhelper.mk -include $(CDBS)/class/autotools.mk +DH_OPTIONS = --parallel -Bdebian/build ###-------------------------------------------------------------------------- -### General settings. +### Configuration. + +OVERRIDES += auto_configure +dh_auto_configure_OPTS = -- + +## Various files and directories. +dh_auto_configure_OPTS += --libexecdir="\$${libdir}/tripe" +dh_auto_configure_OPTS += --with-configdir="/etc/tripe" +dh_auto_configure_OPTS += --with-socketdir="/var/run" +dh_auto_configure_OPTS += --with-logfile="/var/log/tripe/tripe.log" +dh_auto_configure_OPTS += --with-pidfile="/var/run/tripectl.pid" -DEB_BUILDDIR = $(CURDIR)/build +## The default tunnel. If we try to port this to other kernels, we'll need +## something more complicated here. +dh_auto_configure_OPTS += --with-tunnel="linux slip" ###-------------------------------------------------------------------------- -### Correct configuration. +### The wireshark plugin. -## This will need changing on other kernels. -default_tunnel = linux +OVERRIDES += gencontrol +dh-gencontrol-hook:: + dpkg --status wireshark-common | \ + sed -n 's/^Version: */tripe:Wireshark-Version=/p' \ + >> debian/tripe-wireshark.substvars -## Configuration arguments. -DEB_CONFIGURE_EXTRA_FLAGS = \ - --with-tunnel="$(default_tunnel) slip" \ - --with-configdir="/etc/tripe" \ - --with-socketdir="/var/run" \ - --with-logfile="/var/log/tripe.log" \ - --with-pidfile="/var/run/tripectl.pid" \ - --with-initconfig="/etc/default/tripe" \ - --with-wireshark +OVERRIDES += shlibdeps +dh_shlibdeps_OPTS += -Xwireshark/plugins ###-------------------------------------------------------------------------- -### Install the startup scripts. +### The startup script and related machinery. + +dh_auto_configure_OPTS += --with-initconfig="/etc/default/tripe" -install/tripe:: - cp $(DEB_BUILDDIR)/init/tripe-init debian/tripe.init - cp $(DEB_SRCDIR)/init/tripe.conf debian/tripe.default +OVERRIDES += installinit +dh-installinit-hook:: + cp debian/build/init/tripe-init debian/tripe.init + sed 's/^#\(user\|group\)/\1/' \ + init/tripe.conf >debian/tripe.default -cleanbuilddir:: +OVERRIDES += clean +dh-clean-hook:: rm -f debian/tripe.init debian/tripe.default ###-------------------------------------------------------------------------- -### Wireshark plugin. +### Other things. -## Grab the version we built against, so we can put it in the dependencies. -install/tripe-wireshark:: - dpkg --status wireshark | \ - sed -n 's/^Version: */tripe:Wireshark-Version=/p' \ - >> debian/tripe-wireshark.substvars +## Python stuff. +DH_OPTIONS += --with=python-central +OVERRIDES += pycentral +dh_pycentral_OPTS += -ppython-tripe + +## The peer database. +OVERRIDES += install +dh-install-hook:: + mkdir -p debian/tripe-peer-services/etc/tripe/peers.d + install -m644 peerdb/peers.in \ + debian/tripe-peer-services/etc/tripe/peers.d/10base + +###-------------------------------------------------------------------------- +### Some machinery for overriding Debhelper in a structured way. + +%:; dh $@ $(DH_OPTIONS) -## Don't track dependencies for the plugin. We have it covered already. -DEB_DH_SHLIBDEPS_ARGS_tripe-wireshark += -Xwireshark/plugins +$(foreach o, $(sort $(OVERRIDES)), dh-$o-hook)::; @: +$(foreach o, $(sort $(OVERRIDES)), override_dh_$o): override_dh_%: dh-%-hook + dh_$* $(addprefix -O, $(DH_OPTIONS)) $(dh_$*_OPTS) ###----- That's all, folks --------------------------------------------------