File: rules

package info (click to toggle)
inn 1%3A1.7.2debian-29
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,136 kB
  • ctags: 48
  • sloc: perl: 4,875; sh: 492; makefile: 219; ansic: 55
file content (129 lines) | stat: -rwxr-xr-x 3,529 bytes parent folder | download | duplicates (2)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/make -f
SHELL=/bin/bash -e

#export DH_VERBOSE=1

include debian/scripts/vars

BUILD_DIR := $(SOURCE_DIR)/$(TAR_DIR)
B := $(BUILD_DIR)
D := $(CURDIR)/debian/inn

# get the debian revision number
DREV := $(shell dpkg-parsechangelog | grep '^Version: 1:1.7.2debian-' \
	| sed -e 's/^.*-\(.*\)$$/\1/')
ifeq ($(DREV),)
$(error bad package version)
endif

all: build

diff:
	$(MAKE) -f debian/sys-build.mk make-diff

unpack: $(STAMP_DIR)/unpack
$(STAMP_DIR)/unpack:
	$(MAKE) -f debian/sys-build.mk source.make
	touch $@

configure: $(STAMP_DIR)/configure
$(STAMP_DIR)/configure: $(STAMP_DIR)/unpack
	dh_testdir
	printf '#undef LOCAL_STRING\n#define LOCAL_STRING "Debian/$(DREV)"\n' \
		>> $B/include/patchlevel.h
	sed -e "s@PERL_LDOPTS@`perl -MExtUtils::Embed -e ldopts`@" \
	    -e "s@PERL_CCOPTS@`perl -MExtUtils::Embed -e ccopts`@" \
	    < extra/config.data.debian > $B/config/config.data
	touch $@

build: $(STAMP_DIR)/build
$(STAMP_DIR)/build: $(STAMP_DIR)/configure
	dh_testdir
	# Build the binaries.
	NOISY=1 \
	$(MAKE) -f debian/sys-build.mk source.command SOURCE_CMD="$(MAKE) all"
	# Cat the Install docs together
	cat $B/Install.ms.[12] | nroff -ms > $B/Install.txt
	touch $@

clean:
	$(MAKE) -f debian/sys-build.mk source.clean
	dh_clean

install: $(STAMP_DIR)/install checkroot
$(STAMP_DIR)/install: $(STAMP_DIR)/build
	dh_testdir
	dh_clean
	dh_installdirs
	# Install INN in the temp directory
	$(MAKE) -f debian/sys-build.mk source.command \
		SOURCE_CMD="$(MAKE) install DESTDIR=$D"
	touch $@

binary-arch: $(STAMP_DIR)/install checkroot
	dh_testdir

	echo -e '#!/bin/sh\ngzip -d' > $D/usr/lib/news/rnews/gunbatch
	chmod +x $D/usr/lib/news/rnews/gunbatch

	cp extra/innreport_inn.pm $D/usr/lib/news/
	install -m 755 extra/send-uucp.pl extra/innreport $D/usr/lib/news/bin/
	pod2man --section=8 < extra/send-uucp.pl \
		> $D/usr/share/man/man8/send-uucp.8

	# Fix up innshellvars* and other things
	perl -pi -e 's#/usr/ucb#/usr/sbin#' $D/usr/lib/news/innshellvars*
	chmod +x $D/usr/lib/news/innshellvars

	cp extra/etc/* $D/etc/news
	dh_installcron
	dh_installdocs extra/doc/inn-README extra/doc/innhelp.tomk.txt \
		$B/FAQ/ $B/Install.txt $B/actived/README.actived
	dh_installchangelogs $B/CHANGES
	dh_installinit
	install -p -m755 debian/inn.init $D/etc/init.d/inn

	rm -rf	$D/var/spool/news/* $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/control/sample.control

	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/var/*/news/ $D/var/run/innd/

	# 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

	# Install the latest pgpverify.
	install -m 755 extra/gpgverify $D/usr/lib/news/bin/pgpverify
	install -d -m 755 -o news -g news $D/etc/news/pgp
	cp extra/pgpverify.8 $D/usr/share/man/man8/

	# Install controlchan
	install -m 755 extra/cch/controlchan $D/usr/lib/news/bin/
	install -m 644 extra/cch/control/* $D/usr/lib/news/control/

	dh_link
	dh_strip
	dh_compress
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -u-VPERLAPI=$$(perl -e 'printf "perlapi-%vd", $$^V')
	dh_builddeb


binary: binary-arch

checkroot:
	test root = "`whoami`"