File: rules

package info (click to toggle)
diablo 1.16.test2-1
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 1,504 kB
  • ctags: 1,603
  • sloc: ansic: 17,654; perl: 2,054; sh: 260; csh: 118; makefile: 73
file content (98 lines) | stat: -rwxr-xr-x 3,174 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
89
90
91
92
93
94
95
96
97
98
#! /usr/bin/make -f
#
#	debian/rules file for diablo
#

# Name.
pkg = diablo
tmp = $(shell pwd)/debian/tmp
cfg = /etc/news
lib = /usr/lib/news

define checkdir
	test -f util/diablo.c
endef

build:
# Builds the binary package.
ifneq ($(shell umask),022)
	echo "Umask is not 022" && exit 1
endif
	$(checkdir)
	xmake
	touch build

# Architecture independant files.
binary-indep:   build
	$(checkdir)

# Make a binary package (.deb file)
binary-arch:	build checkroot
	#
	-rm -rf $(tmp)
	install -d -g root -m 755 -o root $(tmp)/{DEBIAN,etc,usr}
	install -d -g root -m 755 -o root $(tmp)/usr/doc/$(pkg)
	install -d -g root -m 755 -o root $(tmp)/usr/doc/$(pkg)/examples
	install -d -g news -m 755 -o news $(tmp)$(cfg)
	install -d -g root -m 755 -o root $(tmp)/etc/init.d
	install -d -g root -m 755 -o root $(tmp)/usr/bin
	install -d -g root -m 755 -o root $(tmp)/usr/sbin
	install -d -g news -m 755 -o news $(tmp)/usr/lib/news/{dbin,adm}
	install -d -g news -m 775 -o news $(tmp)/var/run/diablo
	install -d -g news -m 775 -o news $(tmp)/var/lib/news
	install -d -g news -m 775 -o news $(tmp)/var/lib/news/feeds
	install -d -g news -m 775 -o news $(tmp)/var/spool/news
	install -d -g news -m 775 -o news $(tmp)/var/spool/news/diablo
	install -d -g news -m 775 -o news $(tmp)/var/spool/news/dqueue
	install -d -g root -m 755 -o root $(tmp)/usr/man/man{1,5,8}
	#
	install -s -m 755 dbin/* $(tmp)/usr/lib/news/dbin
	mv $(tmp)/usr/lib/news/dbin/diablo $(tmp)/usr/sbin
	install -m 755 debian/adm/* $(tmp)/usr/lib/news/adm
	install -m 644 debian/cfg/* $(tmp)$(cfg)
	install -m 644 samples/* $(tmp)/usr/doc/$(pkg)/examples
	install -m 755 debian/inn2diablo.pl $(tmp)/usr/doc/$(pkg)/examples
	install -m 755 debian/rc.news $(tmp)/etc/init.d/diablo
	install -m 644 debian/crontab $(tmp)$(cfg)/crontab.diablo
	install -m 644 man/*.5 $(tmp)/usr/man/man5
	install -m 644 man/*.8 $(tmp)/usr/man/man8
	echo ".so man8/didump.8" > $(tmp)/usr/man/man8/diload.8
	#
	#	Remove the reader stuff.
	#
	rm -f $(tmp)$(lib)/dbin/{dexpireover,dreaderd,dsyncgroups,pgpverify}
	rm -f $(tmp)/usr/man/man?/dreaderd.8
	#
	gzip -9f $(tmp)/usr/man/man*/*
	chown news:news $(tmp)$(cfg)/*
	#
	install -g root -m 644 debian/changelog $(tmp)/usr/doc/$(pkg)/changelog.Debian
	install -g root -m 644 RELEASE_NOTES $(tmp)/usr/doc/$(pkg)/changelog
	install -g root -m 644 README.SERVER $(tmp)/usr/doc/$(pkg)/
	install -g root -m 644 debian/README $(tmp)/usr/doc/$(pkg)/README.Debian
	gzip -9f $(tmp)/usr/doc/$(pkg)/{changelog*,README*}
	install -g root -m 644 -o root COPYRIGHT $(tmp)/usr/doc/$(pkg)/copyright
	install -g root -m 644 -o root debian/conffiles $(tmp)/DEBIAN
	install -m 755 debian/preinst $(tmp)/DEBIAN
	install -m 755 debian/postinst $(tmp)/DEBIAN
	install -m 755 debian/prerm $(tmp)/DEBIAN
	install -m 755 debian/postrm $(tmp)/DEBIAN
	#
	dpkg-shlibdeps dbin/diablo
	dpkg-gencontrol
	dpkg --build $(tmp) ..
	rm -rf $(tmp)

clean:	checkroot
	xmake clean
	rm -f build debian/files debian/substvars
	rm -rf $(tmp)
	find . -name '*.bak' -o -name '*~' | xargs -r rm -f --

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot