[go: up one dir, main page]

File: rules

package info (click to toggle)
spamfilter 1.3-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 328 kB
  • ctags: 36
  • sloc: perl: 399; sh: 180; ansic: 151; makefile: 90
file content (106 lines) | stat: -rwxr-xr-x 3,713 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
#! /usr/bin/make -f
###############################################################################
#
# $Id: rules,v 1.6 1998/01/09 00:50:42 bcwhite Exp $
#
# To make the binary distribution package, the ``Debianized'' source package
# and the context diff to the original package, type `./debian/rules dist'.
# Make sure that `debian/rules' is executable before the final distribution
# is made.
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownerships.  The `diff' target assumes that you have the original
# source package available, unpacked, in ../$(p)-$(v).orig.
#


package	:= spamfilter


build:
# Builds the binary package.
	cd src; make pattern-client
	touch stamp-build

clean:
# Undoes the effect of `debian/rules build'.
	rm -f stamp-build
	rm -rf debian/tmp debian/files debian/substvars
	cd src; make clean
	find . \( -name "*~" -o -name "#*" \) -exec rm -f {} \;


# Makes a binary package.
binary-indep:
	true

binary-arch:
	test -f stamp-build || make -f debian/rules build
	rm -rf debian/tmp
	find . \( -name "*~" -o -name "#*" \) -exec rm -f {} \;
	:
	mkdir -p debian/tmp/DEBIAN debian/tmp/usr/doc/$(package)
	mkdir -p debian/tmp/usr/lib/$(package)/bin
	mkdir -p debian/tmp/usr/lib/$(package)/perl
	mkdir -p debian/tmp/usr/lib/$(package)/rules
	mkdir -p debian/tmp/usr/lib/$(package)/defaults
	mkdir -p debian/tmp/usr/doc/$(package)/messages
	mkdir -p debian/tmp/usr/bin
	mkdir -p debian/tmp/usr/man/man1
	mkdir -p debian/tmp/usr/lib/spamdb/converters
	:
	for file in bin/* perl/* rules/* defaults/* ; do \
		if [ -f $$file ]; then \
			sed <$$file >debian/tmp/usr/lib/$(package)/$$file \
				-e "s|PACKAGE|$(package)|g" \
				-e "s|SPAMLIB|/usr/lib/$(package)|g" \
				-e "s|SPAMPERL|/usr/lib/$(package)/perl|g" \
				-e "s|SPAMBIN|/usr/lib/$(package)/bin|g" \
				-e "s|SPAMRULES|/usr/lib/$(package)/rules|g" \
				-e "s|SPAMDEFS|/usr/lib/$(package)/defaults|g" \
			; \
		fi; \
	done
	cp man/spamfilter.1 debian/tmp/usr/man/man1
	chmod 644 debian/tmp/usr/man/*/*
	chmod 755 debian/tmp/usr/lib/$(package)/bin/*
	chmod 644 debian/tmp/usr/lib/$(package)/perl/*
	chmod 644 debian/tmp/usr/lib/$(package)/rules/*
	chmod 644 debian/tmp/usr/lib/$(package)/defaults/*
	cd debian/tmp/usr/lib/$(package); ln -s rules/default-settings procmailrc
	mv debian/tmp/usr/lib/$(package)/bin/spamfilter debian/tmp/usr/bin/
	cd doc; for file in * ; do \
		if [ -f $$file ]; then \
			install -m 644 $$file ../debian/tmp/usr/doc/$(package)/$$file; \
		fi; \
	done
	for file in messages/* ; do \
		if [ -f $$file ]; then \
			install -m 644 $$file debian/tmp/usr/doc/$(package)/$$file; \
		fi; \
	done
	:
	install -m 755 -s src/pattern-client debian/tmp/usr/lib/$(package)/bin/chkmail
	cd debian/tmp/usr/lib/$(package)/bin/; rm -f addpat; ln chkmail addpat
	:
	install -m 755 spamdb/converter debian/tmp/usr/lib/spamdb/converters/spamfilter
	:
	cp Change.Log debian/tmp/usr/doc/$(package)/changelog
	cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
	cd debian/tmp/usr/doc/$(package); find . -type f | xargs gzip -9fv
	cd debian/tmp/usr/man;            find . -type f | xargs gzip -9fv
	cd debian/tmp/usr/doc/$(package); ln -sf ../copyright/GPL.gz copyright.gz
	:
	install -m 755 debian/postinst	debian/tmp/DEBIAN
	dpkg-shlibdeps debian/tmp/usr/lib/$(package)/bin/addpat debian/tmp/usr/lib/$(package)/bin/chkmail
	dpkg-gencontrol -is -ip
	chown -R root.root debian/tmp
	chmod -R go=rX	   debian/tmp
	dpkg --build debian/tmp
	dpkg-name -o -s .. debian/tmp.deb

binary: binary-indep binary-arch
	@echo "Binaries made"