mirror of
https://git.proxmox.com/git/proxmox-spamassassin
synced 2025-04-28 12:19:37 +00:00

`make sa-updates.tgz` runs sa-update with a temporary directory and packs the gathered rules into a tarball, which gets extracted during dpkg-buildpackage. This patch creates a gpg-homedir and imports the sa-update-key distributed with the upstream tarball, and changes the call to sa-update to use this directory instead of the default '/etc/mail/spamassassin/sa-update-keys'. In addition to being a bit more self-contained this also enables running `make sa-updates.tgz` without being root. The temporary gpg-homedir is added to '.gitignore' Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
71 lines
2.2 KiB
Makefile
71 lines
2.2 KiB
Makefile
# howto add rule updates:
|
|
# edit paths ($srcdir) in changes.pl
|
|
# update changes.diff - verify changes!
|
|
|
|
# dig -t any 2.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
|
|
|
|
PKGREL=2
|
|
SAVER=3.4.2
|
|
OPKGNAME = Mail-SpamAssassin-${SAVER}
|
|
NPKGNAME = proxmox-spamassassin_${SAVER}
|
|
DEB = proxmox-spamassassin_${SAVER}-${PKGREL}_amd64.deb
|
|
|
|
EXTRA_RULES = KAM.cf
|
|
|
|
SA_UPDATE_GPG_DIR = .sa-update-gpghome
|
|
|
|
#${DEB}: ${OPKGNAME}.tar.gz
|
|
${DEB}: ${OPKGNAME}.tar.gz sa-updates.tgz ${EXTRA_RULES}
|
|
-rm -rf ${OPKGNAME} ${NPKGNAME}
|
|
tar xzf ${OPKGNAME}.tar.gz
|
|
mv ${OPKGNAME} ${NPKGNAME}
|
|
cp -a debian ${NPKGNAME}
|
|
mkdir ${NPKGNAME}/extra_rules
|
|
cp ${EXTRA_RULES} ${NPKGNAME}/extra_rules
|
|
cd ${NPKGNAME}; dpkg-buildpackage -us -uc -rfakeroot
|
|
-rm -rf ${OPKGNAME} ${NPKGNAME}
|
|
lintian ${DEB}
|
|
|
|
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 $@
|
|
|
|
sa-updates.tgz: ${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}
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf ${CLEANFILES}
|
|
|
|
.PHONY: dinstall
|
|
dinstall: ${DEB}
|
|
dpkg -i ${DEB}
|