]>
Commit | Line | Data |
---|---|---|
05466a9d TL |
1 | # this requires package pmg-doc-generator |
2 | export NOVIEW=1 | |
3 | include /usr/share/pmg-doc-generator/pmg-doc-generator.mk | |
4 | ||
5 | DESTDIR= | |
6 | ||
7 | PERL5DIR=${DESTDIR}/usr/share/perl5 | |
8 | DOCDIR=${DESTDIR}/usr/share/doc/pmg-api/ | |
9 | BASHCOMPLDIR=${DESTDIR}/usr/share/bash-completion/completions/ | |
10 | ||
11 | SERVICES = pmgdaemon pmgproxy pmgtunnel pmgmirror | |
12 | CLITOOLS = pmgdb pmgconfig pmgperf pmgcm pmgqm pmgreport pmgversion pmgupgrade pmgsubscription pmgbackup | |
13 | CLISCRIPTS = pmg-smtp-filter pmgsh pmgpolicy pmgbanner pmg-system-report | |
14 | CRONSCRIPTS = pmg-hourly pmg-daily | |
15 | ||
16 | CLI_CLASSES = $(addprefix PMG/CLI/, $(addsuffix .pm, ${CLITOOLS})) | |
17 | SERVICE_CLASSES = $(addprefix PMG/Service/, $(addsuffix .pm, ${SERVICES})) | |
7251cc51 | 18 | SERVICE_UNITS = $(addprefix debian/, $(addsuffix .service, ${SERVICES} pmg-pbsbackup@)) |
05466a9d TL |
19 | TIMER_UNITS = $(addprefix debian/, $(addsuffix .timer, ${CRONSCRIPTS} pmgspamreport pmgreport)) |
20 | ||
21 | CLI_BINARIES = $(addprefix bin/, ${CLITOOLS} ${CLISCRIPTS} ${CRONSCRIPTS}) | |
22 | CLI_MANS = $(addsuffix .1, ${CLITOOLS}) pmgsh.1 pmg-system-report.1 | |
23 | ||
24 | ||
25 | SERVICE_MANS = $(addsuffix .8, ${SERVICES}) pmg-smtp-filter.8 pmgpolicy.8 | |
26 | CONF_MANS= pmg.conf.5 cluster.conf.5 | |
27 | ||
28 | TEMPLATES = \ | |
29 | fetchmailrc.tt \ | |
30 | pmgreport.tt \ | |
31 | spamreport-verbose.tt \ | |
32 | spamreport-short.tt \ | |
33 | main.cf.in \ | |
34 | main.cf.in.demo \ | |
35 | master.cf.in \ | |
36 | master.cf.in.demo \ | |
37 | init.pre.in \ | |
38 | local.cf.in \ | |
39 | v310.pre.in \ | |
40 | v320.pre.in \ | |
b1b20b37 | 41 | v342.pre.in \ |
1689ee83 | 42 | v400.pre.in \ |
05466a9d TL |
43 | razor-agent.conf.in \ |
44 | freshclam.conf.in \ | |
45 | clamd.conf.in \ | |
46 | postgresql.conf.in \ | |
47948ba5 | 47 | pg_hba.conf.in \ |
f8c773d8 | 48 | backup-notification.tt \ |
05466a9d TL |
49 | |
50 | TEMPLATES_FILES = $(addprefix templates/, ${TEMPLATES}) | |
51 | ||
52 | LIBSOURCES = \ | |
53 | PMG/pmgcfg.pm \ | |
54 | PMG/RESTEnvironment.pm \ | |
55 | PMG/Utils.pm \ | |
ef743ee6 | 56 | PMG/MIMEUtils.pm \ |
05466a9d TL |
57 | PMG/HTMLMail.pm \ |
58 | PMG/ModGroup.pm \ | |
59 | PMG/SMTPPrinter.pm \ | |
66f35a7e | 60 | PMG/CertHelpers.pm \ |
05466a9d TL |
61 | PMG/Config.pm \ |
62 | PMG/Cluster.pm \ | |
63 | PMG/ClusterConfig.pm \ | |
64 | PMG/HTTPServer.pm \ | |
65 | PMG/Ticket.pm \ | |
66 | PMG/AccessControl.pm \ | |
67 | PMG/AtomicFile.pm \ | |
68 | PMG/MailQueue.pm \ | |
69 | PMG/Postfix.pm \ | |
70 | PMG/SMTP.pm \ | |
71 | PMG/Unpack.pm \ | |
72 | PMG/Backup.pm \ | |
2de4cfb2 | 73 | PMG/PBSConfig.pm \ |
7251cc51 | 74 | PMG/PBSSchedule.pm \ |
05466a9d TL |
75 | PMG/RuleCache.pm \ |
76 | PMG/Statistic.pm \ | |
77 | PMG/UserConfig.pm \ | |
78 | PMG/Fetchmail.pm \ | |
79 | PMG/LDAPConfig.pm \ | |
80 | PMG/LDAPSet.pm \ | |
81 | PMG/LDAPCache.pm \ | |
82 | PMG/DBTools.pm \ | |
ad6e35cf | 83 | PMG/DKIMSign.pm \ |
05466a9d TL |
84 | PMG/Quarantine.pm \ |
85 | PMG/Report.pm \ | |
9aeedf1b | 86 | PMG/SACustom.pm \ |
3dd4f162 | 87 | PMG/TFAConfig.pm \ |
05466a9d TL |
88 | PMG/RuleDB/Group.pm \ |
89 | PMG/RuleDB/Rule.pm \ | |
90 | PMG/RuleDB/Object.pm \ | |
91 | PMG/RuleDB/Quarantine.pm \ | |
92 | PMG/RuleDB/WhoRegex.pm \ | |
93 | PMG/RuleDB/IPAddress.pm \ | |
94 | PMG/RuleDB/IPNet.pm \ | |
95 | PMG/RuleDB/ModField.pm \ | |
96 | PMG/RuleDB/MatchFilename.pm \ | |
5e809f47 | 97 | PMG/RuleDB/MatchArchiveFilename.pm \ |
05466a9d TL |
98 | PMG/RuleDB/ReceiverRegex.pm \ |
99 | PMG/RuleDB/EMail.pm \ | |
100 | PMG/RuleDB/Receiver.pm \ | |
101 | PMG/RuleDB/Domain.pm \ | |
102 | PMG/RuleDB/ReceiverDomain.pm \ | |
103 | PMG/RuleDB/LDAP.pm \ | |
104 | PMG/RuleDB/LDAPUser.pm \ | |
105 | PMG/RuleDB/TimeFrame.pm \ | |
106 | PMG/RuleDB/MatchField.pm \ | |
107 | PMG/RuleDB/ContentTypeFilter.pm \ | |
108 | PMG/RuleDB/ArchiveFilter.pm \ | |
109 | PMG/RuleDB/Spam.pm \ | |
110 | PMG/RuleDB/Virus.pm \ | |
111 | PMG/RuleDB/ReportSpam.pm \ | |
112 | PMG/RuleDB/Remove.pm \ | |
113 | PMG/RuleDB/Attach.pm \ | |
114 | PMG/RuleDB/BCC.pm \ | |
115 | PMG/RuleDB/Counter.pm \ | |
116 | PMG/RuleDB/Notify.pm \ | |
117 | PMG/RuleDB/Disclaimer.pm \ | |
118 | PMG/RuleDB/Accept.pm \ | |
119 | PMG/RuleDB/Block.pm \ | |
120 | PMG/RuleDB.pm \ | |
121 | ${CLI_CLASSES} \ | |
122 | ${SERVICE_CLASSES} \ | |
504802b9 | 123 | PMG/NodeConfig.pm \ |
05466a9d | 124 | PMG/API2/Subscription.pm \ |
47948ba5 TL |
125 | PMG/API2/APT.pm \ |
126 | PMG/API2/Network.pm \ | |
05466a9d TL |
127 | PMG/API2/Services.pm \ |
128 | PMG/API2/Tasks.pm \ | |
129 | PMG/API2/LDAP.pm \ | |
130 | PMG/API2/DestinationTLSPolicy.pm\ | |
131 | PMG/API2/Domains.pm \ | |
320d4b1d | 132 | PMG/API2/DKIMSignDomains.pm \ |
03daa12d | 133 | PMG/API2/DKIMSign.pm \ |
05466a9d | 134 | PMG/API2/Fetchmail.pm \ |
c1ecd160 | 135 | PMG/API2/InboundTLSDomains.pm \ |
05466a9d TL |
136 | PMG/API2/Users.pm \ |
137 | PMG/API2/Transport.pm \ | |
138 | PMG/API2/MyNetworks.pm \ | |
139 | PMG/API2/MimeTypes.pm \ | |
140 | PMG/API2/Config.pm \ | |
141 | PMG/API2/Cluster.pm \ | |
142 | PMG/API2/ClamAV.pm \ | |
143 | PMG/API2/SpamAssassin.pm \ | |
9aeedf1b | 144 | PMG/API2/SACustom.pm \ |
05466a9d TL |
145 | PMG/API2/Statistics.pm \ |
146 | PMG/API2/MailTracker.pm \ | |
147 | PMG/API2/Backup.pm \ | |
a0208dbd | 148 | PMG/API2/PBS/Job.pm \ |
5d031987 | 149 | PMG/API2/PBS/Remote.pm \ |
05466a9d TL |
150 | PMG/API2/Nodes.pm \ |
151 | PMG/API2/Postfix.pm \ | |
152 | PMG/API2/Quarantine.pm \ | |
153 | PMG/API2/AccessControl.pm \ | |
409e7115 | 154 | PMG/API2/TFA.pm \ |
049d8506 | 155 | PMG/API2/TFAConfig.pm \ |
05466a9d TL |
156 | PMG/API2/ObjectGroupHelpers.pm \ |
157 | PMG/API2/Rules.pm \ | |
158 | PMG/API2/RuleDB.pm \ | |
159 | PMG/API2/SMTPWhitelist.pm \ | |
160 | PMG/API2/Who.pm \ | |
161 | PMG/API2/When.pm \ | |
162 | PMG/API2/What.pm \ | |
163 | PMG/API2/Action.pm \ | |
ac78733c | 164 | PMG/API2/Certificates.pm \ |
5000937e WB |
165 | PMG/API2/ACME.pm \ |
166 | PMG/API2/ACMEPlugin.pm \ | |
ec7ce3a4 | 167 | PMG/API2/NodeConfig.pm \ |
47948ba5 | 168 | PMG/API2.pm \ |
05466a9d | 169 | |
109e32c5 | 170 | SOURCES = ${LIBSOURCES} ${CLI_BINARIES} ${TEMPLATES_FILES} ${CONF_MANS} ${CLI_MANS} ${SERVICE_MANS} ${SERVICE_UNITS} ${TIMER_UNITS} pmg-sources.list pmg-initramfs.conf |
05466a9d TL |
171 | |
172 | all: ${SOURCES} | |
173 | ||
174 | PMG/pmgcfg.pm: PMG/pmgcfg.pm.in | |
175 | sed -e s/@VERSION@/${PMGVERSION}/ -e s/@PMGRELEASE@/${PMGRELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp | |
176 | mv $@.tmp $@ | |
177 | ||
178 | %.bash-completion: | |
179 | perl -I. -T -e "use PMG::CLI::$*; PMG::CLI::$*->generate_bash_completions();" >$@.tmp | |
180 | mv $@.tmp $@ | |
181 | ||
182 | %.service-bash-completion: | |
183 | perl -I. -T -e "use PMG::Service::$*; PMG::Service::$*->generate_bash_completions();" >$@.tmp | |
184 | mv $@.tmp $@ | |
185 | ||
186 | install: ${SOURCES} $(addsuffix .service-bash-completion, ${SERVICES}) $(addsuffix .bash-completion, ${CLITOOLS}) | |
187 | for i in ${SERVICES}; do perl -I. -T -e "use PMG::Service::$$i; PMG::Service::$$i->verify_api();"; done | |
188 | for i in ${CLITOOLS}; do perl -I. -T -e "use PMG::CLI::$$i; PMG::CLI::$$i->verify_api();"; done | |
189 | perl -I. bin/pmgsh verifyapi | |
190 | install -d -m 0755 ${DESTDIR}/usr/bin | |
191 | install -d -m 0755 -o www-data -g www-data ${DESTDIR}/var/log/pmgproxy | |
192 | install -d -m 0755 ${DOCDIR} | |
193 | # TODO: is there a better location ? | |
194 | install -m 0644 favicon.ico ${DOCDIR} | |
05466a9d TL |
195 | install -D -m 0644 pmg-sources.list ${DESTDIR}/etc/apt/sources.list.d/pmg-enterprise.list |
196 | for i in ${LIBSOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/$$i; done | |
197 | for i in ${SERVICES}; do install -D -m 0644 PMG/Service/$$i.pm ${PERL5DIR}/PMG/Service/$$i.pm; done | |
198 | for i in ${SERVICES}; do install -m 0755 bin/$$i ${DESTDIR}/usr/bin; done | |
199 | for i in ${SERVICES}; do install -m 0644 -D $$i.service-bash-completion ${BASHCOMPLDIR}/$$i; done | |
200 | for i in ${CLITOOLS}; do install -D -m 0644 PMG/CLI/$$i.pm ${PERL5DIR}/PMG/CLI/$$i.pm; done | |
201 | for i in ${CLITOOLS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done | |
202 | for i in ${CLITOOLS}; do install -D -m 0644 $$i.bash-completion ${BASHCOMPLDIR}/$$i; done | |
203 | for i in ${CLISCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done | |
204 | for i in ${TEMPLATES}; do install -D -m 0644 templates/$$i ${DESTDIR}/var/lib/pmg/templates/$$i; done | |
205 | for i in ${CLI_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man1/$$i; done | |
206 | for i in ${CONF_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man5/$$i; done | |
207 | for i in ${SERVICE_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man8/$$i; done | |
208 | for i in ${CRONSCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/lib/pmg/bin/$$i; done | |
209 | install -d -m 0755 ${DESTDIR}/lib/systemd/system | |
210 | for i in ${TIMER_UNITS}; do install -m 0644 $$i ${DESTDIR}/lib/systemd/system/; done | |
211 | install -D -m 0644 pmg-initramfs.conf ${DESTDIR}/etc/initramfs-tools/conf.d/pmg-initramfs.conf | |
212 | ||
213 | .PHONY: check | |
214 | check: | |
215 | make -C tests check | |
216 | ||
217 | .PHONY: clean | |
218 | clean: | |
219 | make cleanup-docgen | |
220 | make -C tests clean | |
aabdee29 | 221 | rm -f PMG/pmgcfg.pm |
05466a9d TL |
222 | rm -rf ${CONF_MANS} *.bash-completion *.service-bash-completion |
223 | if test -d .git; then rm -f PMG/pmgcfg.pm; fi | |
224 | find . -name '*~' -exec rm {} ';' | |
225 | ||
226 | %.1: bin/% | |
227 | rm -f $@ | |
228 | podselect $< |pod2man -n $(notdir $*) -s 1 -r ${PKGVER} -c"Proxmox Documentation" >$@.tmp | |
229 | mv $@.tmp $@ |