File: rules

package info (click to toggle)
spamassassin 3.1.7-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 5,404 kB
  • ctags: 2,123
  • sloc: perl: 39,706; ansic: 3,133; sh: 2,009; sql: 170; makefile: 168
file content (192 lines) | stat: -rwxr-xr-x 4,641 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!/usr/bin/make -f

# SpamAssassin debian/rules
# Duncan Findlay

# Uses debhelper and dpatch

# Based on sample debian/rules by Joey Hess
# And patches from various people (see changelog)

#export DH_VERBOSE=1

# The architecture-dependent portion of this package can be built separately
# (i.e. without building the rest).

# Bad things could probably happen if we run this in parallel
.NOTPARALLEL:

CFLAGS=-O2 -Wall

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

# For building both spamc and spamassassin
patch: patch-stamp
patch-stamp:
	dpatch apply-all

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

configure: configure-stamp
configure-stamp: patch

	dh_testdir

	perl Makefile.PL INSTALLDIRS=vendor \
	 DESTDIR=$(CURDIR)/debian/spamassassin \
	 CONFDIR=/etc/spamassassin \
	 ENABLE_SSL=yes < /dev/null

	touch configure-stamp

build: build-indep build-arch

install: install-indep install-arch

binary: binary-indep binary-arch

clean: clean1 unpatch
clean1:
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp build-arch-stamp configure-stamp

	-$(MAKE) veryclean

	rm -f spamd/spamc.1p
	rm -Rf t/log/*
	rm -f debian/semantic.cache

	dh_clean

#debian/po/templates.pot: debian/spamassassin.templates
#	-debconf-updatepo

# Spamassassin (and spamassassin-tools) ONLY

build-indep: build-indep-stamp
#build-indep-stamp: configure debian/po/templates.pot
build-indep-stamp: configure

	dh_testdir

	$(MAKE) CFOPTIMIZE="$(CFLAGS)" CFCCFLAGS="" CFLIBS="" CFLDFLAGS=""

	touch build-arch-stamp

	touch build-indep-stamp


#install-indep: install-spamassassin install-spamassassin-tools
install-indep: install-spamassassin

# SpamAssassin

install-spamassassin: build-indep
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -i

	$(MAKE) install


#	Get rid of SPAMC stuff.
	rm debian/spamassassin/usr/bin/spamc debian/spamassassin/usr/share/man/man1/spamc.1p


#	Move spamd to /usr/sbin + fix the man file
	sed 's#SPAMD 1#SPAMD 8#' \
	 debian/spamassassin/usr/share/man/man1/spamd.1p \
	 > debian/spamassassin/usr/share/man/man8/spamd.8p
	rm debian/spamassassin/usr/share/man/man1/spamd.1p

	mv debian/spamassassin/usr/bin/spamd debian/spamassassin/usr/sbin/

#	Install Debian specific files
	cp debian/65_debian.cf debian/spamassassin/usr/share/spamassassin/65_debian.cf

	-rmdir -p debian/spamassassin/usr/lib/perl5

#	dh_installdocs isn't flexible enough to install all the docs to the right place
#	Do it here!
	cp debian/copyright 				debian/spamassassin/usr/share/doc/spamassassin/
	cp debian/spamassassin.README.Debian		debian/spamassassin/usr/share/doc/spamassassin/README.Debian
	cp BUGS CREDITS README TRADEMARK UPGRADE USAGE NOTICE 	debian/spamassassin/usr/share/doc/spamassassin/
	cp ldap/README 					debian/spamassassin/usr/share/doc/spamassassin/README.ldap
	cp rules/STATISTICS*.txt 			debian/spamassassin/usr/share/doc/spamassassin/rules/
	cp spamd/README 				debian/spamassassin/usr/share/doc/spamassassin/README.spamd
	cp spamd/README.vpopmail 			debian/spamassassin/usr/share/doc/spamassassin/README.spamd-vpopmail
	cp -r sql/ 					debian/spamassassin/usr/share/doc/spamassassin/

#	Clean up any .svn stuff creeping in (only applicable for building
#	from svn)
	-find debian/spamassassin/ -path '*/.svn' -print0 | xargs -0 rm -Rf

binary-indep: build-indep install-indep
	dh_testdir -i
	dh_testroot -i
#	dh_installdebconf -i
	dh_installlogcheck -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installinit -i -- defaults 19 21
	dh_installchangelogs Changes -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_perl -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# spamc ONLY

build-arch: build-arch-stamp
#build-arch-stamp: configure debian/po/templates.pot
build-arch-stamp: configure

	dh_testdir

	-mkdir -p blib/man1

	$(MAKE) CFOPTIMIZE="$(CFLAGS)" CFCCFLAGS="" CFLIBS="" CFLDFLAGS="" spamc/spamc

	pod2man spamc/spamc.pod blib/man1/spamc.1p

	touch build-arch-stamp

install-arch: DH_OPTIONS=
install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -a

	cp spamc/spamc debian/spamc/usr/bin/spamc

binary-arch: build-arch install-arch
	dh_testdir -a
	dh_testroot -a
	dh_installlogcheck -a
	dh_installdocs -a
	dh_installman -a
	dh_installchangelogs Changes -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

.PHONY: build build-indep build-arch clean clean1 binary-indep binary-arch binary install configure install-indep install-indep-docs install-arch unpatch