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} .PHONY: update-upstream update-upstream: ${OPKGNAME}.tar.gz rm -rf upstream tar -xzf $< mv ${OPKGNAME} upstream ${NPKGNAME}.orig.tar.gz: upstream/ rm -rf ${NPKGNAME} cp -a upstream ${NPKGNAME} tar -czf $@ ${NPKGNAME} ${NPKGNAME}: sa-updates ${EXTRA_RULES} ${NPKGNAME}.orig.tar.gz cp -a debian $@ mkdir -p $@/debian/tree/usr/share/spamassassin rsync -av sa-updates/ $@/debian/tree/usr/share/spamassassin 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 https://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 rsync -av --delete --exclude=local.cf --exclude=regression_tests.cf --exclude=*.txt --exclude=MIRRORED.BY updates.tmp/updates_spamassassin_org/ sa-updates .PHONY: upload upload: ${DEB} tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch .PHONY: clean distclean clean: rm -rf *~ debian/*~ *.deb proxmox-spamassassin_* updates.tmp ${SA_UPDATE_GPG_DIR} ${OPKGNAME}.tar.gz.* distclean: clean rm -rf ${OPKGNAME}.* .PHONY: dinstall dinstall: ${DEB} dpkg -i ${DEB}