File: rules

package info (click to toggle)
spamassassin 3.4.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 23,540 kB
  • sloc: perl: 75,702; ansic: 5,005; sh: 3,775; makefile: 377; sql: 263; python: 49
file content (218 lines) | stat: -rwxr-xr-x 5,677 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
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#!/usr/bin/make -f

# SpamAssassin debian/rules
# Duncan Findlay

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

#export DH_VERBOSE=1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# 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:

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

SOURCE := $(shell dpkg-parsechangelog -SSource)
VERSION := $(shell dpkg-parsechangelog -SVersion)
VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,')

DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM)
TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))

orig: $(DIR_ORIG)
	rsync --delete --exclude /debian --exclude .svk --exclude .svn --exclude .git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
	QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0

$(DIR_ORIG):
ifeq ($(TAR_ORIG),)
	$(error Cannot find orig tarball $(TAR_ORIG_NAME))
else
	mkdir -p ../orig
	tar -C ../orig -xaf $(TAR_ORIG)
endif

# For building both spamc and spamassassin
configure: configure-stamp
configure-stamp:

	dh_testdir

	perl Makefile.PL INSTALLDIRS=vendor \
	 DESTDIR=$(CURDIR)/debian/spamassassin \
	 CONFDIR=/etc/spamassassin LDFLAGS="$(LDFLAGS)" \
	 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
clean1:
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp build-arch-stamp configure-stamp

	[ ! -f Makefile ] || $(MAKE) veryclean

	rm -f spamd/spamc.1p sa-awl.1p sa-check_spamd.1p \
		rules/70_sandbox.cf rules/72_active.cf
	rm -Rf t/log/*
	rm -f debian/semantic.cache

	dh_clean

maintainerclean:
	dh_testdir
	rm -f build-indep-stamp build-arch-stamp configure-stamp
	rm -rf $(filter-out debian .svk .svn .git, $(wildcard * .[^.]*))

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

# Spamassassin ONLY

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

	dh_testdir

	$(MAKE) CFLAGS="$(CPPFLAGS) $(CFLAGS)" CFCCFLAGS="" CFLIBS=""

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) test
endif


	pod2man sa-awl.raw sa-awl.1p
	pod2man sa-check_spamd.raw sa-check_spamd.1p
	touch build-indep-stamp

install-indep: install-spamassassin

# SpamAssassin

install-spamassassin: build-indep
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -i

	$(MAKE) install DESTDIR=`pwd`/debian/spamassassin


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

	dh_install -psa-compile sa-compile /usr/bin
	install -o root -g root -m664 debian/sa-compile.pre debian/sa-compile/etc/spamassassin
	dh_installman -psa-compile

#	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
	install -o root -g root -m644 debian/65_debian.cf \
		debian/spamassassin/etc/spamassassin/65_debian.cf

	install -o root -g root -m644 debian/GPG.KEY \
		debian/spamassassin/usr/share/spamassassin/GPG.KEY

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

	install -o root -g root -m644 ldap/README \
		debian/spamassassin/usr/share/doc/spamassassin/README.ldap
	install -o root -g root -m644 spamd/README \
		debian/spamassassin/usr/share/doc/spamassassin/README.spamd
	install -o root -g root -m644 rules/* debian/spamassassin/usr/share/spamassassin
	rm debian/spamassassin/usr/share/spamassassin/70_sandbox.cf \
		debian/spamassassin/usr/share/spamassassin/sandbox-*.pm \
		debian/spamassassin/usr/share/spamassassin/*.pre

binary-indep: build-indep install-indep
	dh_testdir -i
	dh_testroot -i
	dh_installman -i sa-awl.1p sa-check_spamd.1p
	dh_installdocs -i
	dh_installexamples -i
	dh_installsystemd -i --no-enable
	dh_installinit -i --no-enable --no-start
	dh_installsystemd -i --no-start
	dh_installcron -i
	dh_installchangelogs Changes -i
	dh_lintian
	dh_link -i
	dh_compress -i -XGPG.KEY
	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-stamp

	dh_testdir

	-mkdir -p blib/man1

	$(MAKE) CFCCFLAGS="" CFLAGS="$(CPPFLAGS) $(CFLAGS)" \
	  CFLIBS="" spamc/spamc

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

	touch build-arch-stamp

install-arch: DH_OPTIONS=
install-arch: build-arch-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -a

	install -o root -g root -m755 spamc/spamc debian/spamc/usr/bin/spamc

binary-arch: build-arch-stamp install-arch
	dh_testdir -a
	dh_testroot -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