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 ORIG_SRC_TAR
=$(PACKAGE
)_
$(DEB_VERSION_UPSTREAM
).orig.
tar.gz
14 DSC
= $(PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
).dsc
16 DEB
= $(PACKAGE
)_
$(DEB_VERSION_UPSTREAM_REVISION
)_amd64.deb
17 DBG_DEB
= $(PACKAGE
)-dbgsym_
$(DEB_VERSION_UPSTREAM_REVISION
)_amd64.deb
18 DEBS
= $(DEB
) $(DBG_DEB
)
20 KAM_CHANNEL_FILE
= debian
/tree
/etc
/mail
/spamassassin
/channel.d
/KAM_channel.conf
21 KAM_KEYID
= $(shell awk
-F
'=' '/^KEYID/ { print $$2 }' $(KAM_CHANNEL_FILE
))
24 SA_UPDATE_GPG_DIR
= .sa-update-gpghome
28 $(DEB
) $(DBG_DEB
): $(BUILDDIR
)
29 cd
$(BUILDDIR
); dpkg-buildpackage
-b
-us
-uc
36 $(DSC
): $(ORIG_SRC_TAR
) $(BUILDDIR
)
37 cd
$(BUILDDIR
); dpkg-buildpackage
-S
-us
-uc
-d
43 .PHONY
: update-upstream
44 update-upstream
: $(OPKGNAME
).
tar.gz
47 mv
$(OPKGNAME
) upstream
49 $(ORIG_SRC_TAR
): $(BUILDDIR
)
50 tar czf
$(ORIG_SRC_TAR
) --exclude
="$(BUILDDIR)/debian" $(BUILDDIR
)
52 $(BUILDDIR
): sa-updates kam-updates
56 mkdir
-p
$@.tmp
/rule-updates
/spamassassin
57 rsync
-av sa-updates
/ $@.tmp
/rule-updates
/spamassassin
58 mkdir
-p
$@.tmp
/debian
/rule-updates
/spamassassin-extra
59 rsync
-av kam-updates
/ $@.tmp
/rule-updates
/spamassassin-extra
64 curl
-L
-o
'$@#1.tmp' 'https://www-eu.apache.org/dist/spamassassin/source/$@{,.asc}'
67 gpgv
--keyring .
/sa-releasekey.gpg
$@.asc
$@
69 $(SA_UPDATE_GPG_DIR
)/.prepared
: $(OPKGNAME
).
tar.gz
70 rm -rf
$(SA_UPDATE_GPG_DIR
)
71 mkdir
--mode
=0700 -p
$(SA_UPDATE_GPG_DIR
)
72 tar --strip-components
2 -xzf
$(OPKGNAME
).
tar.gz
$(OPKGNAME
)/rules
/sa-update-pubkey.txt
73 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --import sa-update-pubkey.txt
74 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --import
$(KAM_CHANNEL_FILE
)
75 rm sa-update-pubkey.txt
79 update-sa
: $(SA_UPDATE_GPG_DIR
)/.prepared
81 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --updatedir updates.tmp
--channel updates.spamassassin.org
82 rsync
-av
--delete
--exclude
=local.cf
--exclude
=regression_tests.cf
--exclude
=*.txt
--exclude
=MIRRORED.BY updates.tmp
/updates_spamassassin_org
/ sa-updates
85 update-kam
: $(SA_UPDATE_GPG_DIR
)/.prepared
86 rm -rf kam-updates.tmp kam-updates
87 sa-update
--gpghomedir
$(SA_UPDATE_GPG_DIR
) --gpgkey
$(KAM_KEYID
) --updatedir kam-updates.tmp
--channel kam.sa-channels.mcgrail.com
88 rm -rf kam-updates.tmp
/kam_sa-channels_mcgrail_com
/MIRRORED.BY
89 mv kam-updates.tmp kam-updates
92 upload
: UPLOAD_DIST ?
= $(DEB_DISTRIBUTION
)
94 tar cf
- $(DEBS
) | ssh
-X repoman@repo.proxmox.com
-- upload
--product pmg
--dist $(UPLOAD_DIST
)
96 .PHONY
: clean distclean
98 rm -rf
*.deb
$(PACKAGE
)-[0-9]*/ *.tmp
$(SA_UPDATE_GPG_DIR
)
99 rm -f
*.deb
*.dsc
*.changes
*.build
*.buildinfo
$(OPKGNAME
).
tar.gz.
* $(PACKAGE
)*.
tar*