proxmox-spamassassin/Makefile
Stoiko Ivanov ac5080f95e Add download target for SA sources
add a convenience target to download the current SA tarball and corresponding
gpg-signature and verify it with SpamAssassin's release key [0].

[0] https://www.apache.org/dist/spamassassin/KEYS
2020-02-04 11:45:27 +01:00

94 lines
2.9 KiB
Makefile

include /usr/share/dpkg/pkg-info.mk
# howto add rule updates:
# edit paths ($srcdir) in changes.pl
# update changes.diff - verify changes!
# dig -t any 3.4.3.updates.spamassassin.org
# wget http://spamassassin.kluge.net/updates/501214.tar.gz
# wget http://spamassassin.kluge.net/updates/501214.tar.gz.asc
# gpg --verify 501214.tar.gz.asc 501214.tar.gz
#
# or just use: make sa-updates.tgz (from the last stable version)
# warning: start with an empty sa-updates.tgz, install the package,
# the run sa-update to generate the updates
#
# Note: we also add KAM.cf from
# http://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf
#
# edit debin/rules to apply updates
OPKGNAME = Mail-SpamAssassin-${DEB_VERSION_UPSTREAM}
NPKGNAME = proxmox-spamassassin_${DEB_VERSION_UPSTREAM}
DEB = proxmox-spamassassin_${DEB_VERSION_UPSTREAM_REVISION}_amd64.deb
DSC = proxmox-spamassassin_${DEB_VERSION_UPSTREAM_REVISION}.dsc
EXTRA_RULES = KAM.cf
SA_UPDATE_GPG_DIR = .sa-update-gpghome
deb: ${DEB}
${DEB}: ${NPKGNAME}
cd ${NPKGNAME}; dpkg-buildpackage -b -us -uc -rfakeroot
lintian ${DEB}
dsc: ${DSC}
${DSC}: ${NPKGNAME}
cd ${NPKGNAME}; dpkg-buildpackage -S -us -uc -rfakeroot -d
lintian ${DSC}
${NPKGNAME}.orig.tar.gz: ${OPKGNAME}.tar.gz
rm -rf ${NPKGNAME}
tar -xzf $<
mv ${OPKGNAME} ${NPKGNAME}
tar -czf ${NPKGNAME}.orig.tar.gz ${NPKGNAME}
${NPKGNAME}: sa-updates.tgz ${EXTRA_RULES} ${NPKGNAME}.orig.tar.gz
cp -a debian $@
mkdir -p $@/debian/tree/usr/share/spamassassin
tar -C $@/debian/tree/usr/share/spamassassin -xzf sa-updates.tgz
mkdir -p $@/debian/tree/usr/share/spamassassin-extra
cp -a ${EXTRA_RULES} $@/debian/tree/usr/share/spamassassin-extra
${OPKGNAME}.tar.gz:
rm -f $@*
curl -L -o '$@#1.tmp' 'https://www-eu.apache.org/dist/spamassassin/source/$@{,.asc}'
mv $@.tmp $@
mv $@.asc.tmp $@.asc
gpgv --keyring ./sa-releasekey.gpg $@.asc $@
KAM.cf:
wget http://www.pccc.com/downloads/SpamAssassin/contrib/KAM.cf -O $@.tmp
mv KAM.cf.tmp $@
${SA_UPDATE_GPG_DIR}/.prepared: ${OPKGNAME}.tar.gz
rm -rf ${SA_UPDATE_GPG_DIR}
mkdir --mode=0700 -p ${SA_UPDATE_GPG_DIR}
tar --strip-components 2 -xzf ${OPKGNAME}.tar.gz ${OPKGNAME}/rules/sa-update-pubkey.txt
sa-update --gpghomedir ${SA_UPDATE_GPG_DIR} --import sa-update-pubkey.txt
rm sa-update-pubkey.txt
touch $@
.PHONY: update-sa
update-sa: ${SA_UPDATE_GPG_DIR}/.prepared
rm -rf updates.tmp
sa-update --gpghomedir ${SA_UPDATE_GPG_DIR} --updatedir updates.tmp --channel updates.spamassassin.org
tar cvzf sa-updates.tgz --exclude=local.cf --exclude=regression_tests.cf --exclude=*.txt --exclude=MIRRORED.BY -C updates.tmp/updates_spamassassin_org/ .
.PHONY: upload
upload: ${DEB}
tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch
CLEANFILES = *~ debian/*~ *.deb proxmox-spamassassin_* updates.tmp ${SA_UPDATE_GPG_DIR} ${OPKGNAME}.tar.gz.*
.PHONY: clean
clean:
rm -rf ${CLEANFILES}
.PHONY: dinstall
dinstall: ${DEB}
dpkg -i ${DEB}