#!/usr/bin/make -f SHELL=/bin/bash -e CFLAGS=-g -O2 export DEB_BUILD_MAINT_OPTIONS=hardening=+all B := $(CURDIR)/build D := $(CURDIR)/debian/inn # get the debian revision number DREV := $(shell dpkg-parsechangelog | grep '^Version: 1:1.7.2q-' \ | sed -e 's/^.*-\(.*\)$$/\1/') ifeq ($(DREV),) $(error bad package version) endif # the upstream source needs to be copied in the build dir src_files = $(shell find . -maxdepth 1 \ -not -name . -and -not -name debian -and -not -name .pc \ -and -not -name extra -and -not -name build) %: dh $@ --builddirectory=$B override_dh_auto_configure: mkdir -p $B for dir in $(src_files); do cp -ldpR $$dir $B; done perl -pi -e 's|^(#define\s+LOCAL_STRING\s+")[^"]*"|$${1}Debian/$(DREV)"|' \ $B/include/patchlevel.h sed -e "s@PERL_LDOPTS@`perl extra/perl-ldopts`@" \ -e "s@PERL_CCOPTS@`perl extra/perl-ccopts`@" \ -e "s@DEBIAN_CFLAGS@$(CFLAGS)@" \ -e "s@DEBIAN_CPPFLAGS@$(CPPFLAGS)@" \ -e "s@DEBIAN_LDFLAGS@$(LDFLAGS)@" \ < extra/config.data.debian > $B/config/config.data execute_after_dh_auto_install: # Cat the Install docs together cat $B/Install.ms.[12] | nroff -ms > $B/Install.txt printf '#!/bin/sh\ngzip -d\n' > $D/usr/lib/news/rnews/gunbatch printf '#!/bin/sh\nxz -d\n' > $D/usr/lib/news/rnews/xunbatch chmod +x $D/usr/lib/news/rnews/*unbatch pod2man --section=8 extra/send-uucp.pl \ > $D/usr/share/man/man8/send-uucp.8 # these scripts contain an unfixable bashism cd $D/usr/lib/news/control/ && \ for file in *; do \ perl -i -pe 's@^#! /bin/sh@#! /bin/bash@' $$file; \ done # Fix up innshellvars* and other things perl -pi -e 's#/usr/ucb#/usr/sbin#' $D/usr/lib/news/innshellvars* rm -rf $D/var/spool/news/* $D/run/ $D/tmp/ \ $D/etc/news/scripts/*.tcl \ $D/var/lib/news/innlog.pl \ $D/usr/share/man/man8/innlog.pl.8.gz \ $D/usr/lib/news/rnews/c7unbatch \ $D/usr/lib/news/bin/innmail \ $D/usr/lib/news/control/sample.control # Move some more stuff around. mv $D/var/lib/news/send-* $D/etc/news/scripts/ mv $D/var/lib/news/nntpsend.ctl $D/etc/news/nntpsend.ctl cd $D/usr/share/man/man8 && mv nnrpd.8 in.nnrpd.8 execute_after_dh_install: mv $D/usr/lib/news/bin/gpgverify $D/usr/lib/news/bin/pgpverify chmod +x $D/usr/lib/news/bin/* override_dh_installchangelogs: dh_installchangelogs $B/CHANGES execute_after_dh_fixperms: cd $D/etc/news && \ chown root:news passwd.nntp nnrp.access hosts.nntp && \ chmod 640 passwd.nntp nnrp.access hosts.nntp chown root:news $D/usr/bin/[ri]news chmod 2755 $D/usr/bin/[ri]news chown root:news $D/usr/sbin/inndstart chmod 4754 $D/usr/sbin/inndstart chown -R news:news $D/etc/news/pgp/ $D/var/*/news/ override_dh_gencontrol: dh_gencontrol -u-VPERLAPI=$$(perl -MConfig -e 'print "perlapi-" . ($$Config{debian_abi} || $$Config{version})')