]> git.proxmox.com Git - pmg-api.git/blame - src/Makefile
remove wronlgy commited test code again
[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}))
18SERVICE_UNITS = $(addprefix debian/, $(addsuffix .service, ${SERVICES}))
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 \
45 pg_hba.conf.in
46
47TEMPLATES_FILES = $(addprefix templates/, ${TEMPLATES})
48
49LIBSOURCES = \
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 \
90 PMG/RuleDB/ReceiverRegex.pm \
91 PMG/RuleDB/EMail.pm \
92 PMG/RuleDB/Receiver.pm \
93 PMG/RuleDB/Domain.pm \
94 PMG/RuleDB/ReceiverDomain.pm \
95 PMG/RuleDB/LDAP.pm \
96 PMG/RuleDB/LDAPUser.pm \
97 PMG/RuleDB/TimeFrame.pm \
98 PMG/RuleDB/MatchField.pm \
99 PMG/RuleDB/ContentTypeFilter.pm \
100 PMG/RuleDB/ArchiveFilter.pm \
101 PMG/RuleDB/Spam.pm \
102 PMG/RuleDB/Virus.pm \
103 PMG/RuleDB/ReportSpam.pm \
104 PMG/RuleDB/Remove.pm \
105 PMG/RuleDB/Attach.pm \
106 PMG/RuleDB/BCC.pm \
107 PMG/RuleDB/Counter.pm \
108 PMG/RuleDB/Notify.pm \
109 PMG/RuleDB/Disclaimer.pm \
110 PMG/RuleDB/Accept.pm \
111 PMG/RuleDB/Block.pm \
112 PMG/RuleDB.pm \
113 ${CLI_CLASSES} \
114 ${SERVICE_CLASSES} \
115 PMG/API2/Subscription.pm \
116 PMG/API2/APT.pm \
117 PMG/API2/Network.pm \
118 PMG/API2/Services.pm \
119 PMG/API2/Tasks.pm \
120 PMG/API2/LDAP.pm \
121 PMG/API2/DestinationTLSPolicy.pm\
122 PMG/API2/Domains.pm \
320d4b1d 123 PMG/API2/DKIMSignDomains.pm \
03daa12d 124 PMG/API2/DKIMSign.pm \
05466a9d
TL
125 PMG/API2/Fetchmail.pm \
126 PMG/API2/Users.pm \
127 PMG/API2/Transport.pm \
128 PMG/API2/MyNetworks.pm \
129 PMG/API2/MimeTypes.pm \
130 PMG/API2/Config.pm \
131 PMG/API2/Cluster.pm \
132 PMG/API2/ClamAV.pm \
133 PMG/API2/SpamAssassin.pm \
9aeedf1b 134 PMG/API2/SACustom.pm \
05466a9d
TL
135 PMG/API2/Statistics.pm \
136 PMG/API2/MailTracker.pm \
137 PMG/API2/Backup.pm \
138 PMG/API2/Nodes.pm \
139 PMG/API2/Postfix.pm \
140 PMG/API2/Quarantine.pm \
141 PMG/API2/AccessControl.pm \
142 PMG/API2/ObjectGroupHelpers.pm \
143 PMG/API2/Rules.pm \
144 PMG/API2/RuleDB.pm \
145 PMG/API2/SMTPWhitelist.pm \
146 PMG/API2/Who.pm \
147 PMG/API2/When.pm \
148 PMG/API2/What.pm \
149 PMG/API2/Action.pm \
150 PMG/API2.pm
151
152SOURCES = ${LIBSOURCES} ${CLI_BINARIES} ${TEMPLATES_FILES} ${CONF_MANS} ${CLI_MANS} ${SERVICE_MANS} ${SERVICE_UNITS} ${TIMER_UNITS} pmg-sources.list pmg-apt.conf pmg-initramfs.conf
153
154all: ${SOURCES}
155
156PMG/pmgcfg.pm: PMG/pmgcfg.pm.in
157 sed -e s/@VERSION@/${PMGVERSION}/ -e s/@PMGRELEASE@/${PMGRELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp
158 mv $@.tmp $@
159
160%.bash-completion:
161 perl -I. -T -e "use PMG::CLI::$*; PMG::CLI::$*->generate_bash_completions();" >$@.tmp
162 mv $@.tmp $@
163
164%.service-bash-completion:
165 perl -I. -T -e "use PMG::Service::$*; PMG::Service::$*->generate_bash_completions();" >$@.tmp
166 mv $@.tmp $@
167
168install: ${SOURCES} $(addsuffix .service-bash-completion, ${SERVICES}) $(addsuffix .bash-completion, ${CLITOOLS})
169 for i in ${SERVICES}; do perl -I. -T -e "use PMG::Service::$$i; PMG::Service::$$i->verify_api();"; done
170 for i in ${CLITOOLS}; do perl -I. -T -e "use PMG::CLI::$$i; PMG::CLI::$$i->verify_api();"; done
171 perl -I. bin/pmgsh verifyapi
172 install -d -m 0755 ${DESTDIR}/usr/bin
173 install -d -m 0755 -o www-data -g www-data ${DESTDIR}/var/log/pmgproxy
174 install -d -m 0755 ${DOCDIR}
175 # TODO: is there a better location ?
176 install -m 0644 favicon.ico ${DOCDIR}
177 install -D -m 0644 pmg-apt.conf ${DESTDIR}/etc/apt/apt.conf.d/75pmgconf
178 install -D -m 0644 pmg-sources.list ${DESTDIR}/etc/apt/sources.list.d/pmg-enterprise.list
179 for i in ${LIBSOURCES}; do install -D -m 0644 $$i ${PERL5DIR}/$$i; done
180 for i in ${SERVICES}; do install -D -m 0644 PMG/Service/$$i.pm ${PERL5DIR}/PMG/Service/$$i.pm; done
181 for i in ${SERVICES}; do install -m 0755 bin/$$i ${DESTDIR}/usr/bin; done
182 for i in ${SERVICES}; do install -m 0644 -D $$i.service-bash-completion ${BASHCOMPLDIR}/$$i; done
183 for i in ${CLITOOLS}; do install -D -m 0644 PMG/CLI/$$i.pm ${PERL5DIR}/PMG/CLI/$$i.pm; done
184 for i in ${CLITOOLS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done
185 for i in ${CLITOOLS}; do install -D -m 0644 $$i.bash-completion ${BASHCOMPLDIR}/$$i; done
186 for i in ${CLISCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/bin/$$i; done
187 for i in ${TEMPLATES}; do install -D -m 0644 templates/$$i ${DESTDIR}/var/lib/pmg/templates/$$i; done
188 for i in ${CLI_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man1/$$i; done
189 for i in ${CONF_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man5/$$i; done
190 for i in ${SERVICE_MANS}; do install -D -m 0644 $$i ${DESTDIR}/usr/share/man/man8/$$i; done
191 for i in ${CRONSCRIPTS}; do install -D -m 0755 bin/$$i ${DESTDIR}/usr/lib/pmg/bin/$$i; done
192 install -d -m 0755 ${DESTDIR}/lib/systemd/system
193 for i in ${TIMER_UNITS}; do install -m 0644 $$i ${DESTDIR}/lib/systemd/system/; done
194 install -D -m 0644 pmg-initramfs.conf ${DESTDIR}/etc/initramfs-tools/conf.d/pmg-initramfs.conf
195
196.PHONY: check
197check:
198 make -C tests check
199
200.PHONY: clean
201clean:
202 make cleanup-docgen
203 make -C tests clean
c8ea49f1 204 rm PMG/pmgcfg.pm
05466a9d
TL
205 rm -rf ${CONF_MANS} *.bash-completion *.service-bash-completion
206 if test -d .git; then rm -f PMG/pmgcfg.pm; fi
207 find . -name '*~' -exec rm {} ';'
208
209%.1: bin/%
210 rm -f $@
211 podselect $< |pod2man -n $(notdir $*) -s 1 -r ${PKGVER} -c"Proxmox Documentation" >$@.tmp
212 mv $@.tmp $@