File: rules

package info (click to toggle)
inn 1%3A1.7.2q-52
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,256 kB
  • sloc: ansic: 37,984; perl: 11,945; sh: 3,968; makefile: 2,009; awk: 1,567; yacc: 686; tcl: 85; csh: 70
file content (88 lines) | stat: -rwxr-xr-x 2,802 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
#!/usr/bin/make -f
SHELL=/bin/bash -e

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

B := $(CURDIR)/build
D := $(CURDIR)/debian/inn

# get the debian revision number
include /usr/share/dpkg/pkg-info.mk
DREV := $(shell echo "$(DEB_VERSION)" | 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})')