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
|
#!/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). However, buildd's don't seem to do this.
# Their loss, not mine!
CFLAGS=-O2 -Wall
ifeq (,$(wildcard /usr/bin/po2debconf))
PO2DEBCONF := no
MINDEBCONFVER := 0.5
else
PO2DEBCONF := yes
MINDEBCONFVER := 1.2.0
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
PERL = /usr/bin/perl
PACKAGE = spamassassin # For dpatch
include /usr/share/dpatch/dpatch.make
# For building both spamc and spamassassin
configure: configure-stamp
configure-stamp: patch-stamp
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 patch-stamp
-$(MAKE) veryclean
ifeq ($(PO2DEBCONF),yes)
# Hack for woody compatibility. This makes sure that the
# debian/templates file shipped in the source package doesn't
# specify encodings, which woody's debconf can't handle. If building
# on a system with po-debconf installed (conveniently debhelper (>=
# 4.1.16) depends on it), the binary-arch target will generate a
# better version for sarge.
echo 1 > debian/po/output
po2debconf debian/spamassassin.templates.master > debian/spamassassin.templates
rm -f debian/po/output
endif
rm -f spamd/spamc.1p
-rm -Rf t/log/*
dh_clean
debian/po/templates.pot: debian/spamassassin.templates.master
ifeq ($(PO2DEBCONF),yes)
po2debconf -e utf8 debian/spamassassin.templates.master > debian/spamassassin.templates
@debconf-updatepo
endif
# Spamassassin (and spamassassin-tools) ONLY
build-indep: build-indep-stamp
build-indep-stamp: configure debian/po/templates.pot
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
cp debian/logcheck debian/spamassassin/etc/logcheck/ignore.d.paranoid/spamassassin
cp debian/logcheck.violations debian/spamassassin/etc/logcheck/violations.ignore.d/spamassassin
-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_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 -- -V'debconf-depends=debconf (>= $(MINDEBCONFVER))'
dh_md5sums -i
dh_builddeb -i
# spamc ONLY
# It's too bad buildds don't just build build-arch (It's coming with
# dpkg 1.10 or 1.11, I'm told.)
build-arch: build-arch-stamp
build-arch-stamp: configure debian/po/templates.pot
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_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 -- -V'debconf-depends=debconf (>= $(MINDEBCONFVER))'
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
|