1 include /usr
/share
/dpkg
/default.mk
3 # howto add rule updates:
5 # running `make update-sa` updates the core SA rules (in the sa-updates directory)
6 # running `make update-kam` updates the KAM ruleset (in the kam-updates directory)
8 PACKAGE
= proxmox-spamassassin
10 OPKGNAME
= Mail-SpamAssassin-
$(DEB_VERSION_UPSTREAM
)
12 BUILDDIR
= $(PACKAGE
)-$(DEB_VERSION_UPSTREAM
)
13 DSC
= $(PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
).dsc
15 DEB
= $(PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
)_amd64.deb
16 DBG_DEB
= $(PACKAGE
)-dbgsym_
$(DEB_VERSION_UPSTREAM_REVISION
)_amd64.deb
17 DEBS
= $(DEB
) $(DBG_DEB
)
19 KAM_CHANNEL_FILE
= debian
/tree
/etc
/mail
/spamassassin
/channel.d
/KAM_channel.conf
20 KAM_KEYID
= $(shell awk
-F
'=' '/^KEYID/ { print $$2 }' $(KAM_CHANNEL_FILE
))
23 SA_UPDATE_GPG_DIR
= .sa-update-gpghome
27 $(DEB
) $(DBG_DEB
): $(BUILDDIR
)
28 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
36 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
42 .PHONY
: update-upstream
43 update-upstream
: $(OPKGNAME
).
tar.gz
46 mv
$(OPKGNAME
) upstream
48 $(BUILDDIR
).orig.
tar.gz
: upstream
/
50 cp
-a upstream
$(NPKGNAME
)
51 tar -czf
$@
$(NPKGNAME
)
53 $(BUILDDIR
): sa-updates kam-updates
$(NPKGNAME
).orig.
tar.gz
55 mkdir
-p
$@
/debian
/tree
/usr
/share
/spamassassin
56 rsync
-av sa-updates
/ $@
/debian
/tree
/usr
/share
/spamassassin
57 mkdir
-p
$@
/debian
/tree
/usr
/share
/spamassassin-extra
58 rsync
-av kam-updates
/ $@
/debian
/tree
/usr
/share
/spamassassin-extra
62 curl
-L
-o
'$@#1.tmp' 'https://www-eu.apache.org/dist/spamassassin/source/$@{,.asc}'
65 gpgv
--keyring .
/sa-releasekey.gpg
$@.asc
$@
67 $(SA_UPDATE_GPG_DIR
)/.prepared
: $(OPKGNAME
).
tar.gz
68 rm -rf
$(SA_UPDATE_GPG_DIR
)
69 mkdir
--mode
=0700 -p
$(SA_UPDATE_GPG_DIR
)
70 tar --strip-components
2 -xzf
$(OPKGNAME
).
tar.gz
$(OPKGNAME
)/rules
/sa-update-pubkey.txt
71 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --import sa-update-pubkey.txt
72 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --import
$(KAM_CHANNEL_FILE
)
73 rm sa-update-pubkey.txt
77 update-sa
: $(SA_UPDATE_GPG_DIR
)/.prepared
79 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --updatedir updates.tmp
--channel updates.spamassassin.org
80 rsync
-av
--delete
--exclude
=local.cf
--exclude
=regression_tests.cf
--exclude
=*.txt
--exclude
=MIRRORED.BY updates.tmp
/updates_spamassassin_org
/ sa-updates
83 update-kam
: $(SA_UPDATE_GPG_DIR
)/.prepared
84 rm -rf kam-updates.tmp kam-updates
85 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --gpgkey
$(KAM_KEYID
) --updatedir kam-updates.tmp
--channel kam.sa-channels.mcgrail.com
86 rm -rf kam-updates.tmp
/kam_sa-channels_mcgrail_com
/MIRRORED.BY
87 mv kam-updates.tmp kam-updates
90 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
92 tar cf
- $(DEBS
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pmg
--dist $(UPLOAD_DIST
)
94 .PHONY
: clean distclean
96 rm -rf
*~ debian
/*~
*.deb
$(PACKAGE
)_
* updates.tmp kam-updates.tmp
$(SA_UPDATE_GPG_DIR
) $(OPKGNAME
).
tar.gz.
*