]> git.proxmox.com Git - proxmox-spamassassin.git/blob - Makefile
buildsys: track upstream in directory instead of tarball
[proxmox-spamassassin.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 # howto add rule updates:
4
5 # edit paths ($srcdir) in changes.pl
6 # update changes.diff - verify changes!
7
8 # dig -t any 3.4.3.updates.spamassassin.org
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 #
17 # Note: we also add KAM.cf from
18 # http://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf
19 #
20 # edit debin/rules to apply updates
21
22 OPKGNAME = Mail-SpamAssassin-${DEB_VERSION_UPSTREAM}
23 NPKGNAME = proxmox-spamassassin_${DEB_VERSION_UPSTREAM}
24 DEB = proxmox-spamassassin_${DEB_VERSION_UPSTREAM_REVISION}_amd64.deb
25 DSC = proxmox-spamassassin_${DEB_VERSION_UPSTREAM_REVISION}.dsc
26
27 EXTRA_RULES = KAM.cf
28
29 SA_UPDATE_GPG_DIR = .sa-update-gpghome
30
31 deb: ${DEB}
32
33 ${DEB}: ${NPKGNAME}
34 cd ${NPKGNAME}; dpkg-buildpackage -b -us -uc -rfakeroot
35 lintian ${DEB}
36
37 dsc: ${DSC}
38
39 ${DSC}: ${NPKGNAME}
40 cd ${NPKGNAME}; dpkg-buildpackage -S -us -uc -rfakeroot -d
41 lintian ${DSC}
42
43 upstream: ${OPKGNAME}.tar.gz
44 rm -rf $@
45 tar -xzf $<
46 mv ${OPKGNAME} $@
47
48 ${NPKGNAME}.orig.tar.gz: upstream
49 rm -rf ${NPKGNAME}
50 cp -a upstream ${NPKGNAME}
51 tar -czf $@ ${NPKGNAME}
52
53 ${NPKGNAME}: sa-updates.tgz ${EXTRA_RULES} ${NPKGNAME}.orig.tar.gz
54 cp -a debian $@
55 mkdir -p $@/debian/tree/usr/share/spamassassin
56 tar -C $@/debian/tree/usr/share/spamassassin -xzf sa-updates.tgz
57 mkdir -p $@/debian/tree/usr/share/spamassassin-extra
58 cp -a ${EXTRA_RULES} $@/debian/tree/usr/share/spamassassin-extra
59
60 ${OPKGNAME}.tar.gz:
61 rm -f $@*
62 curl -L -o '$@#1.tmp' 'https://www-eu.apache.org/dist/spamassassin/source/$@{,.asc}'
63 mv $@.tmp $@
64 mv $@.asc.tmp $@.asc
65 gpgv --keyring ./sa-releasekey.gpg $@.asc $@
66
67 KAM.cf:
68 wget https://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf -O $@.tmp
69 mv KAM.cf.tmp $@
70
71 ${SA_UPDATE_GPG_DIR}/.prepared: ${OPKGNAME}.tar.gz
72 rm -rf ${SA_UPDATE_GPG_DIR}
73 mkdir --mode=0700 -p ${SA_UPDATE_GPG_DIR}
74 tar --strip-components 2 -xzf ${OPKGNAME}.tar.gz ${OPKGNAME}/rules/sa-update-pubkey.txt
75 sa-update --gpghomedir ${SA_UPDATE_GPG_DIR} --import sa-update-pubkey.txt
76 rm sa-update-pubkey.txt
77 touch $@
78
79 .PHONY: update-sa
80 update-sa: ${SA_UPDATE_GPG_DIR}/.prepared
81 rm -rf updates.tmp
82 sa-update --gpghomedir ${SA_UPDATE_GPG_DIR} --updatedir updates.tmp --channel updates.spamassassin.org
83 tar cvzf sa-updates.tgz --exclude=local.cf --exclude=regression_tests.cf --exclude=*.txt --exclude=MIRRORED.BY -C updates.tmp/updates_spamassassin_org/ .
84
85 .PHONY: upload
86 upload: ${DEB}
87 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
88
89 CLEANFILES = *~ debian/*~ *.deb proxmox-spamassassin_* updates.tmp ${SA_UPDATE_GPG_DIR} ${OPKGNAME}.tar.gz.*
90
91 .PHONY: clean
92 clean:
93 rm -rf ${CLEANFILES}
94
95 .PHONY: dinstall
96 dinstall: ${DEB}
97 dpkg -i ${DEB}