]> git.proxmox.com Git - proxmox-spamassassin.git/blame - Makefile
buildsys: raise debian/compat to 12
[proxmox-spamassassin.git] / Makefile
CommitLineData
63a37115
TL
1include /usr/share/dpkg/pkg-info.mk
2
3# howto add rule updates:
f803c821 4
7b922beb
DM
5# edit paths ($srcdir) in changes.pl
6# update changes.diff - verify changes!
7
1bd5581e 8# dig -t any 3.4.3.updates.spamassassin.org
7b922beb
DM
9# wget http://spamassassin.kluge.net/updates/501214.tar.gz
10# wget http://spamassassin.kluge.net/updates/501214.tar.gz.asc
11# gpg --verify 501214.tar.gz.asc 501214.tar.gz
12#
13# or just use: make sa-updates.tgz (from the last stable version)
14# warning: start with an empty sa-updates.tgz, install the package,
15# the run sa-update to generate the updates
16#
d2ab4c52
DM
17# Note: we also add KAM.cf from
18# http://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf
19#
7b922beb
DM
20# edit debin/rules to apply updates
21
f803c821
TL
22OPKGNAME = Mail-SpamAssassin-${DEB_VERSION_UPSTREAM}
23NPKGNAME = proxmox-spamassassin_${DEB_VERSION_UPSTREAM}
24DEB = proxmox-spamassassin_${DEB_VERSION_UPSTREAM_REVISION}_amd64.deb
7b922beb 25
7a367109
DM
26EXTRA_RULES = KAM.cf
27
ae1e4fd8
SI
28SA_UPDATE_GPG_DIR = .sa-update-gpghome
29
f8a626c3
TL
30deb: ${DEB}
31
426b8f0a 32${DEB}: ${NPKGNAME}
7b922beb 33 cd ${NPKGNAME}; dpkg-buildpackage -us -uc -rfakeroot
7b922beb
DM
34 lintian ${DEB}
35
426b8f0a
SI
36
37${NPKGNAME}.orig.tar.gz: ${OPKGNAME}.tar.gz
38 rm -rf ${NPKGNAME}
39 tar -xzf $<
40 mv ${OPKGNAME} ${NPKGNAME}
41 tar -czf ${NPKGNAME}.orig.tar.gz ${NPKGNAME}
42
43${NPKGNAME}: sa-updates.tgz ${EXTRA_RULES} ${NPKGNAME}.orig.tar.gz
44 cp -a debian $@
45 mkdir -p $@/debian/tree/usr/share/spamassassin
46 tar -C $@/debian/tree/usr/share/spamassassin -xzf sa-updates.tgz
47 mkdir -p $@/debian/tree/usr/share/spamassassin-extra
48 cp -a ${EXTRA_RULES} $@/debian/tree/usr/share/spamassassin-extra
49
7a367109
DM
50KAM.cf:
51 wget http://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf -O $@.tmp
52 mv KAM.cf.tmp $@
7b922beb 53
ae1e4fd8
SI
54${SA_UPDATE_GPG_DIR}/.prepared: ${OPKGNAME}.tar.gz
55 rm -rf ${SA_UPDATE_GPG_DIR}
56 mkdir --mode=0700 -p ${SA_UPDATE_GPG_DIR}
57 tar --strip-components 2 -xzf ${OPKGNAME}.tar.gz ${OPKGNAME}/rules/sa-update-pubkey.txt
58 sa-update --gpghomedir ${SA_UPDATE_GPG_DIR} --import sa-update-pubkey.txt
59 rm sa-update-pubkey.txt
60 touch $@
61
27e14884
TL
62.PHONY: update-sa
63update-sa: ${SA_UPDATE_GPG_DIR}/.prepared
d2ab4c52 64 rm -rf updates.tmp
ae1e4fd8 65 sa-update --gpghomedir ${SA_UPDATE_GPG_DIR} --updatedir updates.tmp --channel updates.spamassassin.org
7b922beb
DM
66 tar cvzf sa-updates.tgz --exclude=local.cf --exclude=regression_tests.cf --exclude=*.txt --exclude=MIRRORED.BY -C updates.tmp/updates_spamassassin_org/ .
67
68.PHONY: upload
69upload: ${DEB}
f050a4b2 70 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
7b922beb 71
ae1e4fd8 72CLEANFILES = *~ debian/*~ *.deb proxmox-spamassassin_* updates.tmp ${SA_UPDATE_GPG_DIR}
7b922beb
DM
73
74.PHONY: clean
75clean:
76 rm -rf ${CLEANFILES}
19fb7ca6
DM
77
78.PHONY: dinstall
79dinstall: ${DEB}
80 dpkg -i ${DEB}