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