]>
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})) | |
18 | SERVICE_UNITS = $(addprefix debian/, $(addsuffix .service, ${SERVICES})) | |
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 \ | |
41 | razor-agent.conf.in \ | |
42 | freshclam.conf.in \ | |
43 | clamd.conf.in \ | |
44 | postgresql.conf.in \ | |
45 | pg_hba.conf.in | |
46 | ||
47 | TEMPLATES_FILES = $(addprefix templates/, ${TEMPLATES}) | |
48 | ||
49 | LIBSOURCES = \ | |
50 | PMG/pmgcfg.pm \ | |
51 | PMG/RESTEnvironment.pm \ | |
52 | PMG/Utils.pm \ | |
ef743ee6 | 53 | PMG/MIMEUtils.pm \ |
05466a9d TL |
54 | PMG/HTMLMail.pm \ |
55 | PMG/ModGroup.pm \ | |
56 | PMG/SMTPPrinter.pm \ | |
57 | PMG/Config.pm \ | |
58 | PMG/Cluster.pm \ | |
59 | PMG/ClusterConfig.pm \ | |
60 | PMG/HTTPServer.pm \ | |
61 | PMG/Ticket.pm \ | |
62 | PMG/AccessControl.pm \ | |
63 | PMG/AtomicFile.pm \ | |
64 | PMG/MailQueue.pm \ | |
65 | PMG/Postfix.pm \ | |
66 | PMG/SMTP.pm \ | |
67 | PMG/Unpack.pm \ | |
68 | PMG/Backup.pm \ | |
69 | PMG/RuleCache.pm \ | |
70 | PMG/Statistic.pm \ | |
71 | PMG/UserConfig.pm \ | |
72 | PMG/Fetchmail.pm \ | |
73 | PMG/LDAPConfig.pm \ | |
74 | PMG/LDAPSet.pm \ | |
75 | PMG/LDAPCache.pm \ | |
76 | PMG/DBTools.pm \ | |
ad6e35cf | 77 | PMG/DKIMSign.pm \ |
05466a9d TL |
78 | PMG/Quarantine.pm \ |
79 | PMG/Report.pm \ | |
9aeedf1b | 80 | PMG/SACustom.pm \ |
05466a9d TL |
81 | PMG/RuleDB/Group.pm \ |
82 | PMG/RuleDB/Rule.pm \ | |
83 | PMG/RuleDB/Object.pm \ | |
84 | PMG/RuleDB/Quarantine.pm \ | |
85 | PMG/RuleDB/WhoRegex.pm \ | |
86 | PMG/RuleDB/IPAddress.pm \ | |
87 | PMG/RuleDB/IPNet.pm \ | |
88 | PMG/RuleDB/ModField.pm \ | |
89 | PMG/RuleDB/MatchFilename.pm \ | |
5e809f47 | 90 | PMG/RuleDB/MatchArchiveFilename.pm \ |
05466a9d TL |
91 | PMG/RuleDB/ReceiverRegex.pm \ |
92 | PMG/RuleDB/EMail.pm \ | |
93 | PMG/RuleDB/Receiver.pm \ | |
94 | PMG/RuleDB/Domain.pm \ | |
95 | PMG/RuleDB/ReceiverDomain.pm \ | |
96 | PMG/RuleDB/LDAP.pm \ | |
97 | PMG/RuleDB/LDAPUser.pm \ | |
98 | PMG/RuleDB/TimeFrame.pm \ | |
99 | PMG/RuleDB/MatchField.pm \ | |
100 | PMG/RuleDB/ContentTypeFilter.pm \ | |
101 | PMG/RuleDB/ArchiveFilter.pm \ | |
102 | PMG/RuleDB/Spam.pm \ | |
103 | PMG/RuleDB/Virus.pm \ | |
104 | PMG/RuleDB/ReportSpam.pm \ | |
105 | PMG/RuleDB/Remove.pm \ | |
106 | PMG/RuleDB/Attach.pm \ | |
107 | PMG/RuleDB/BCC.pm \ | |
108 | PMG/RuleDB/Counter.pm \ | |
109 | PMG/RuleDB/Notify.pm \ | |
110 | PMG/RuleDB/Disclaimer.pm \ | |
111 | PMG/RuleDB/Accept.pm \ | |
112 | PMG/RuleDB/Block.pm \ | |
113 | PMG/RuleDB.pm \ | |
114 | ${CLI_CLASSES} \ | |
115 | ${SERVICE_CLASSES} \ | |
116 | PMG/API2/Subscription.pm \ | |
117 | PMG/API2/APT.pm \ | |
118 | PMG/API2/Network.pm \ | |
119 | PMG/API2/Services.pm \ | |
120 | PMG/API2/Tasks.pm \ | |
121 | PMG/API2/LDAP.pm \ | |
122 | PMG/API2/DestinationTLSPolicy.pm\ | |
123 | PMG/API2/Domains.pm \ | |
320d4b1d | 124 | PMG/API2/DKIMSignDomains.pm \ |
03daa12d | 125 | PMG/API2/DKIMSign.pm \ |
05466a9d TL |
126 | PMG/API2/Fetchmail.pm \ |
127 | PMG/API2/Users.pm \ | |
128 | PMG/API2/Transport.pm \ | |
129 | PMG/API2/MyNetworks.pm \ | |
130 | PMG/API2/MimeTypes.pm \ | |
131 | PMG/API2/Config.pm \ | |
132 | PMG/API2/Cluster.pm \ | |
133 | PMG/API2/ClamAV.pm \ | |
134 | PMG/API2/SpamAssassin.pm \ | |
9aeedf1b | 135 | PMG/API2/SACustom.pm \ |
05466a9d TL |
136 | PMG/API2/Statistics.pm \ |
137 | PMG/API2/MailTracker.pm \ | |
138 | PMG/API2/Backup.pm \ | |
139 | PMG/API2/Nodes.pm \ | |
140 | PMG/API2/Postfix.pm \ | |
141 | PMG/API2/Quarantine.pm \ | |
142 | PMG/API2/AccessControl.pm \ | |
143 | PMG/API2/ObjectGroupHelpers.pm \ | |
144 | PMG/API2/Rules.pm \ | |
145 | PMG/API2/RuleDB.pm \ | |
146 | PMG/API2/SMTPWhitelist.pm \ | |
147 | PMG/API2/Who.pm \ | |
148 | PMG/API2/When.pm \ | |
149 | PMG/API2/What.pm \ | |
150 | PMG/API2/Action.pm \ | |
151 | PMG/API2.pm | |
152 | ||
153 | SOURCES = ${LIBSOURCES} ${CLI_BINARIES} ${TEMPLATES_FILES} ${CONF_MANS} ${CLI_MANS} ${SERVICE_MANS} ${SERVICE_UNITS} ${TIMER_UNITS} pmg-sources.list pmg-apt.conf pmg-initramfs.conf | |
154 | ||
155 | all: ${SOURCES} | |
156 | ||
157 | PMG/pmgcfg.pm: PMG/pmgcfg.pm.in | |
158 | sed -e s/@VERSION@/${PMGVERSION}/ -e s/@PMGRELEASE@/${PMGRELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp | |
159 | mv $@.tmp $@ | |
160 | ||
161 | %.bash-completion: | |
162 | perl -I. -T -e "use PMG::CLI::$*; PMG::CLI::$*->generate_bash_completions();" >$@.tmp | |
163 | mv $@.tmp $@ | |
164 | ||
165 | %.service-bash-completion: | |
166 | perl -I. -T -e "use PMG::Service::$*; PMG::Service::$*->generate_bash_completions();" >$@.tmp | |
167 | mv $@.tmp $@ | |
168 | ||
169 | install: ${SOURCES} $(addsuffix .service-bash-completion, ${SERVICES}) $(addsuffix .bash-completion, ${CLITOOLS}) | |
170 | for i in ${SERVICES}; do perl -I. -T -e "use PMG::Service::$$i; PMG::Service::$$i->verify_api();"; done | |
171 | for i in ${CLITOOLS}; do perl -I. -T -e "use PMG::CLI::$$i; PMG::CLI::$$i->verify_api();"; done | |
172 | perl -I. bin/pmgsh verifyapi | |
173 | install -d -m 0755 ${DESTDIR}/usr/bin | |
174 | install -d -m 0755 -o www-data -g www-data ${DESTDIR}/var/log/pmgproxy | |
175 | install -d -m 0755 ${DOCDIR} | |
176 | # TODO: is there a better location ? | |
177 | install -m 0644 favicon.ico ${DOCDIR} | |
178 | install -D -m 0644 pmg-apt.conf ${DESTDIR}/etc/apt/apt.conf.d/75pmgconf | |
179 | install -D -m 0644 pmg-sources.list ${DESTDIR}/etc/apt/sources.list.d/pmg-enterprise.list | |
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 | |
182 | for i in ${SERVICES}; do install -m 0755 bin/$$i ${DESTDIR}/usr/bin; done | |
183 | for i in ${SERVICES}; do install -m 0644 -D $$i.service-bash-completion ${BASHCOMPLDIR}/$$i; done | |
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 | |
187 | for i in ${CLISCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done | |
188 | for i in ${TEMPLATES}; do install -D -m 0644 templates/$$i ${DESTDIR}/var/lib/pmg/templates/$$i; done | |
189 | for i in ${CLI_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man1/$$i; done | |
190 | for i in ${CONF_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man5/$$i; done | |
191 | for i in ${SERVICE_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man8/$$i; done | |
192 | for i in ${CRONSCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/lib/pmg/bin/$$i; done | |
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 | |
195 | install -D -m 0644 pmg-initramfs.conf ${DESTDIR}/etc/initramfs-tools/conf.d/pmg-initramfs.conf | |
196 | ||
197 | .PHONY: check | |
198 | check: | |
199 | make -C tests check | |
200 | ||
201 | .PHONY: clean | |
202 | clean: | |
203 | make cleanup-docgen | |
204 | make -C tests clean | |
aabdee29 | 205 | rm -f PMG/pmgcfg.pm |
05466a9d TL |
206 | rm -rf ${CONF_MANS} *.bash-completion *.service-bash-completion |
207 | if test -d .git; then rm -f PMG/pmgcfg.pm; fi | |
208 | find . -name '*~' -exec rm {} ';' | |
209 | ||
210 | %.1: bin/% | |
211 | rm -f $@ | |
212 | podselect $< |pod2man -n $(notdir $*) -s 1 -r ${PKGVER} -c"Proxmox Documentation" >$@.tmp | |
213 | mv $@.tmp $@ |