]>
Commit | Line | Data |
---|---|---|
ff5a70df | 1 | PACKAGE=proxmox-mailgateway |
dc03b479 | 2 | PKGVER=5.0 |
5143ecd4 | 3 | PKGREL=5 |
b68dfb61 | 4 | |
c288dcd7 DM |
5 | # this requires package pmg-doc-generator |
6 | export NOVIEW=1 | |
7 | include /usr/share/pmg-doc-generator/pmg-doc-generator.mk | |
8 | ||
9 | ||
b68dfb61 DM |
10 | DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb |
11 | ||
12 | DESTDIR= | |
13 | ||
14 | PERL5DIR=${DESTDIR}/usr/share/perl5 | |
15 | DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} | |
8415b622 | 16 | BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/ |
b68dfb61 | 17 | |
40f2bc5e DM |
18 | REPOID=`./repoid.pl .git` |
19 | ||
132089d5 | 20 | SERVICES = pmgdaemon pmgproxy pmgtunnel pmgmirror |
fae2ebb2 | 21 | CLITOOLS = pmgdb pmgconfig pmgperf pmgcm pmgqm pmgreport pmgversion pmgupgrade |
6a672919 | 22 | CLISCRIPTS = pmg-smtp-filter pmgsh pmgpolicy |
cb289191 | 23 | CRONSCRIPTS = pmg-hourly pmg-daily |
8b91b776 | 24 | |
a9a4dda6 DM |
25 | CLI_CLASSES = $(addprefix PMG/CLI/, $(addsuffix .pm, ${CLITOOLS})) |
26 | SERVICE_CLASSES = $(addprefix PMG/Service/, $(addsuffix .pm, ${SERVICES})) | |
27 | SERVICE_UNITS = $(addprefix debian/, $(addsuffix .service, ${SERVICES})) | |
2e2d4830 | 28 | TIMER_UNITS = $(addprefix debian/, $(addsuffix .timer, ${CRONSCRIPTS} pmgspamreport pmgreport)) |
6a672919 | 29 | |
a9a4dda6 | 30 | CLI_BINARIES = $(addprefix bin/, ${CLITOOLS} ${CLISCRIPTS} ${CRONSCRIPTS}) |
8de5c848 | 31 | CLI_MANS = $(addsuffix .1, ${CLITOOLS}) pmgsh.1 |
6a672919 DM |
32 | |
33 | ||
10e64d69 | 34 | SERVICE_MANS = $(addsuffix .8, ${SERVICES}) pmg-smtp-filter.8 pmgpolicy.8 |
d358f740 | 35 | CONF_MANS= pmg.conf.5 cluster.conf.5 |
c288dcd7 | 36 | |
07cb898d | 37 | TEMPLATES = \ |
3dfe317a | 38 | pmgreport.tt \ |
dc41e7db | 39 | spamreport-verbose.tt \ |
ecf86b91 | 40 | spamreport-short.tt \ |
f609bf7f DM |
41 | main.cf.in \ |
42 | main.cf.in.demo \ | |
43 | master.cf.in \ | |
44 | master.cf.in.demo \ | |
07cb898d DM |
45 | init.pre.in \ |
46 | local.cf.in \ | |
47 | v310.pre.in \ | |
48 | v320.pre.in \ | |
49 | razor-agent.conf.in \ | |
33fa90bf DM |
50 | freshclam.conf.in \ |
51 | clamd.conf.in \ | |
07cb898d DM |
52 | postgresql.conf.in \ |
53 | pg_hba.conf.in | |
54 | ||
a9a4dda6 | 55 | TEMPLATES_FILES = $(addprefix templates/, ${TEMPLATES}) |
07cb898d | 56 | |
9beff9f6 DM |
57 | LIBSOURCES = \ |
58 | PMG/pmgcfg.pm \ | |
9d82c6bc | 59 | PMG/RESTEnvironment.pm \ |
758c7b6b | 60 | PMG/Utils.pm \ |
08d6921a | 61 | PMG/HTMLMail.pm \ |
e7c865af | 62 | PMG/ModGroup.pm \ |
758c7b6b | 63 | PMG/SMTPPrinter.pm \ |
0bf65425 | 64 | PMG/Config.pm \ |
9beff9f6 | 65 | PMG/Cluster.pm \ |
9f67f5b3 | 66 | PMG/ClusterConfig.pm \ |
9beff9f6 DM |
67 | PMG/HTTPServer.pm \ |
68 | PMG/Ticket.pm \ | |
69 | PMG/AccessControl.pm \ | |
6b5e9594 | 70 | PMG/AtomicFile.pm \ |
a43bcf61 | 71 | PMG/MailQueue.pm \ |
657d5dd4 | 72 | PMG/Postfix.pm \ |
14726412 | 73 | PMG/SMTP.pm \ |
91a5af02 | 74 | PMG/Unpack.pm \ |
c881fe35 | 75 | PMG/RuleCache.pm \ |
5414dee4 | 76 | PMG/Statistic.pm \ |
62ebb4bc | 77 | PMG/UserConfig.pm \ |
a6e3ac60 | 78 | PMG/LDAPConfig.pm \ |
0bf65425 | 79 | PMG/LDAPSet.pm \ |
cad3d400 | 80 | PMG/LDAPCache.pm \ |
a355f100 | 81 | PMG/DBTools.pm \ |
e84bf942 | 82 | PMG/Quarantine.pm \ |
0a580593 DM |
83 | PMG/RuleDB/Group.pm \ |
84 | PMG/RuleDB/Rule.pm \ | |
85 | PMG/RuleDB/Object.pm \ | |
86 | PMG/RuleDB/Quarantine.pm \ | |
87 | PMG/RuleDB/WhoRegex.pm \ | |
f4fe6fc4 DM |
88 | PMG/RuleDB/IPAddress.pm \ |
89 | PMG/RuleDB/IPNet.pm \ | |
e7c865af | 90 | PMG/RuleDB/ModField.pm \ |
f4fe6fc4 | 91 | PMG/RuleDB/MatchFilename.pm \ |
0a580593 DM |
92 | PMG/RuleDB/ReceiverRegex.pm \ |
93 | PMG/RuleDB/EMail.pm \ | |
94 | PMG/RuleDB/Receiver.pm \ | |
95 | PMG/RuleDB/Domain.pm \ | |
96 | PMG/RuleDB/ReceiverDomain.pm \ | |
10621236 | 97 | PMG/RuleDB/LDAP.pm \ |
c712d3a2 | 98 | PMG/RuleDB/LDAPUser.pm \ |
0a580593 | 99 | PMG/RuleDB/TimeFrame.pm \ |
a7865a2b | 100 | PMG/RuleDB/MatchField.pm \ |
11b7d5dc | 101 | PMG/RuleDB/ContentTypeFilter.pm \ |
c4741113 | 102 | PMG/RuleDB/ArchiveFilter.pm \ |
758c7b6b | 103 | PMG/RuleDB/Spam.pm \ |
a29b9649 | 104 | PMG/RuleDB/Virus.pm \ |
f4fe6fc4 | 105 | PMG/RuleDB/ReportSpam.pm \ |
758c7b6b | 106 | PMG/RuleDB/Remove.pm \ |
f4fe6fc4 DM |
107 | PMG/RuleDB/Attach.pm \ |
108 | PMG/RuleDB/BCC.pm \ | |
109 | PMG/RuleDB/Counter.pm \ | |
758c7b6b DM |
110 | PMG/RuleDB/Notify.pm \ |
111 | PMG/RuleDB/Disclaimer.pm \ | |
112 | PMG/RuleDB/Accept.pm \ | |
113 | PMG/RuleDB/Block.pm \ | |
0a580593 | 114 | PMG/RuleDB.pm \ |
8b91b776 | 115 | ${CLI_CLASSES} \ |
6a672919 | 116 | ${SERVICE_CLASSES} \ |
87952a8d | 117 | PMG/API2/Subscription.pm \ |
cc115a48 | 118 | PMG/API2/APT.pm \ |
8b91b776 | 119 | PMG/API2/Network.pm \ |
163fb58f | 120 | PMG/API2/Services.pm \ |
fa04fcb4 | 121 | PMG/API2/Tasks.pm \ |
be6d6ffc | 122 | PMG/API2/LDAP.pm \ |
5b2bb556 | 123 | PMG/API2/Domains.pm \ |
62ebb4bc | 124 | PMG/API2/Users.pm \ |
cc947440 | 125 | PMG/API2/Transport.pm \ |
bef31f06 | 126 | PMG/API2/MyNetworks.pm \ |
e29ebc7c | 127 | PMG/API2/MimeTypes.pm \ |
5c583140 | 128 | PMG/API2/Config.pm \ |
fb5f2d1e | 129 | PMG/API2/Cluster.pm \ |
d17c5265 | 130 | PMG/API2/ClamAV.pm \ |
5de9374c | 131 | PMG/API2/Statistics.pm \ |
202c952a | 132 | PMG/API2/MailTracker.pm \ |
9beff9f6 | 133 | PMG/API2/Nodes.pm \ |
657d5dd4 | 134 | PMG/API2/Postfix.pm \ |
b66faa68 | 135 | PMG/API2/Quarantine.pm \ |
9beff9f6 | 136 | PMG/API2/AccessControl.pm \ |
4bea3204 | 137 | PMG/API2/ObjectGroupHelpers.pm \ |
8d836d1d | 138 | PMG/API2/Rules.pm \ |
b52f6573 | 139 | PMG/API2/RuleDB.pm \ |
16fdeb84 | 140 | PMG/API2/SMTPWhitelist.pm \ |
1ad24a43 | 141 | PMG/API2/Who.pm \ |
2499333b | 142 | PMG/API2/When.pm \ |
5f78c353 | 143 | PMG/API2/What.pm \ |
11a86e67 | 144 | PMG/API2/Action.pm \ |
9beff9f6 DM |
145 | PMG/API2.pm |
146 | ||
cb289191 | 147 | SOURCES = ${LIBSOURCES} ${CLI_BINARIES} ${TEMPLATES_FILES} ${CONF_MANS} ${CLI_MANS} ${SERVICE_MANS} ${SERVICE_UNITS} ${TIMER_UNITS} |
6a672919 DM |
148 | |
149 | all: ${SOURCES} | |
b68dfb61 DM |
150 | |
151 | .PHONY: deb | |
6a672919 | 152 | deb ${DEB}: ${SOURCES} |
b68dfb61 DM |
153 | rm -rf build |
154 | rsync -a * build | |
155 | cd build; dpkg-buildpackage -b -us -uc | |
156 | lintian ${DEB} | |
157 | ||
40f2bc5e DM |
158 | |
159 | PMG/pmgcfg.pm: PMG/pmgcfg.pm.in | |
160 | sed -e s/@VERSION@/${PKGVER}/ -e s/@PACKAGERELEASE@/${PKGREL}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp | |
161 | mv $@.tmp $@ | |
162 | ||
8b91b776 DM |
163 | %.bash-completion: |
164 | perl -I. -T -e "use PMG::CLI::$*; PMG::CLI::$*->generate_bash_completions();" >$@.tmp | |
165 | mv $@.tmp $@ | |
166 | ||
8415b622 | 167 | %.service-bash-completion: |
8b91b776 | 168 | perl -I. -T -e "use PMG::Service::$*; PMG::Service::$*->generate_bash_completions();" >$@.tmp |
8415b622 DM |
169 | mv $@.tmp $@ |
170 | ||
cb289191 | 171 | install: ${SOURCES} $(addsuffix .service-bash-completion, ${SERVICES}) $(addsuffix .bash-completion, ${CLITOOLS}) |
8a1ac886 | 172 | for i in ${SERVICES}; do perl -I. -T -e "use PMG::Service::$$i; PMG::Service::$$i->verify_api();"; done |
8b91b776 | 173 | for i in ${CLITOOLS}; do perl -I. -T -e "use PMG::CLI::$$i; PMG::CLI::$$i->verify_api();"; done |
95c6e315 | 174 | perl -I. bin/pmgsh verifyapi |
9beff9f6 | 175 | install -d -m 0755 ${DESTDIR}/usr/bin |
856d9a38 | 176 | install -d -m 0755 -o www-data -g www-data ${DESTDIR}/var/log/pmgproxy |
cb159468 DM |
177 | install -d -m 0755 ${DOCDIR} |
178 | # TODO: is there a better location ? | |
179 | install -m 0644 favicon.ico ${DOCDIR} | |
9beff9f6 DM |
180 | for i in ${LIBSOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/$$i; done |
181 | for i in ${SERVICES}; do install -D -m 0644 PMG/Service/$$i.pm ${PERL5DIR}/PMG/Service/$$i.pm; done | |
8a1ac886 | 182 | for i in ${SERVICES}; do install -m 0755 bin/$$i ${DESTDIR}/usr/bin; done |
8415b622 | 183 | for i in ${SERVICES}; do install -m 0644 -D $$i.service-bash-completion ${BASHCOMPLDIR}/$$i; done |
8b91b776 DM |
184 | for i in ${CLITOOLS}; do install -D -m 0644 PMG/CLI/$$i.pm ${PERL5DIR}/PMG/CLI/$$i.pm; done |
185 | for i in ${CLITOOLS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done | |
186 | for i in ${CLITOOLS}; do install -D -m 0644 $$i.bash-completion ${BASHCOMPLDIR}/$$i; done | |
46e12d58 | 187 | for i in ${CLISCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done |
07cb898d | 188 | for i in ${TEMPLATES}; do install -D -m 0644 templates/$$i ${DESTDIR}/var/lib/pmg/templates/$$i; done |
3bdb2e11 | 189 | for i in ${CLI_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man1/$$i; done |
c288dcd7 | 190 | for i in ${CONF_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man5/$$i; done |
abc1af3e | 191 | for i in ${SERVICE_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man8/$$i; done |
6a672919 | 192 | for i in ${CRONSCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/lib/pmg/bin/$$i; done |
cb289191 DM |
193 | install -d -m 0755 ${DESTDIR}/lib/systemd/system |
194 | for i in ${TIMER_UNITS}; do install -m 0644 $$i ${DESTDIR}/lib/systemd/system/; done | |
b68dfb61 DM |
195 | |
196 | .PHONY: upload | |
197 | upload: ${DEB} | |
d35173e5 DM |
198 | ./repoid.pl .git/ check |
199 | tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist stretch | |
b68dfb61 | 200 | |
291abd89 DM |
201 | .PHONY: check |
202 | check: | |
203 | make -C tests check | |
204 | ||
b68dfb61 DM |
205 | distclean: clean |
206 | ||
207 | clean: | |
c288dcd7 | 208 | make cleanup-docgen |
291abd89 | 209 | make -C tests clean |
c288dcd7 | 210 | rm -rf ${CONF_MANS} ./build *.deb *.changes *.buildinfo *.bash-completion *.service-bash-completion |
9d1d3ef6 | 211 | if test -d .git; then rm -f PMG/pmgcfg.pm; fi |
b68dfb61 DM |
212 | find . -name '*~' -exec rm {} ';' |
213 | ||
214 | .PHONY: dinstall | |
215 | dinstall: ${DEB} | |
216 | dpkg -i ${DEB} |