5 # this requires package pmg-doc-generator
7 include /usr
/share
/pmg-doc-generator
/pmg-doc-generator.mk
10 DEB
=${PACKAGE}_
${PKGVER}-${PKGREL}_all.deb
14 PERL5DIR
=${DESTDIR}/usr
/share
/perl5
15 DOCDIR
=${DESTDIR}/usr
/share
/doc
/${PACKAGE}
16 BASHCOMPLDIR
=${DESTDIR}/usr
/share
/bash-completion
/completions
/
18 REPOID
=`./repoid.pl .git`
20 SERVICES
= pmgdaemon pmgproxy pmgtunnel pmgmirror
21 CLITOOLS
= pmgdb pmgconfig pmgperf pmgcm pmgqm pmgreport pmgversion pmgupgrade pmgsubscription pmgbackup
22 CLISCRIPTS
= pmg-smtp-filter pmgsh pmgpolicy pmgbanner
23 CRONSCRIPTS
= pmg-hourly pmg-daily
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}))
28 TIMER_UNITS
= $(addprefix debian
/, $(addsuffix .timer
, ${CRONSCRIPTS} pmgspamreport pmgreport
))
30 CLI_BINARIES
= $(addprefix bin
/, ${CLITOOLS} ${CLISCRIPTS} ${CRONSCRIPTS})
31 CLI_MANS
= $(addsuffix .1, ${CLITOOLS}) pmgsh
.1
34 SERVICE_MANS
= $(addsuffix .8, ${SERVICES}) pmg-smtp-filter
.8 pmgpolicy
.8
35 CONF_MANS
= pmg.conf
.5 cluster.conf
.5
40 spamreport-verbose.tt \
56 TEMPLATES_FILES
= $(addprefix templates
/, ${TEMPLATES})
60 PMG
/RESTEnvironment.pm \
67 PMG
/ClusterConfig.pm \
70 PMG
/AccessControl.pm \
88 PMG
/RuleDB
/Object.pm \
89 PMG
/RuleDB
/Quarantine.pm \
90 PMG
/RuleDB
/WhoRegex.pm \
91 PMG
/RuleDB
/IPAddress.pm \
93 PMG
/RuleDB
/ModField.pm \
94 PMG
/RuleDB
/MatchFilename.pm \
95 PMG
/RuleDB
/ReceiverRegex.pm \
97 PMG
/RuleDB
/Receiver.pm \
98 PMG
/RuleDB
/Domain.pm \
99 PMG
/RuleDB
/ReceiverDomain.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 \
107 PMG
/RuleDB
/Virus.pm \
108 PMG
/RuleDB
/ReportSpam.pm \
109 PMG
/RuleDB
/Remove.pm \
110 PMG
/RuleDB
/Attach.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 \
120 PMG
/API2
/Subscription.pm \
122 PMG
/API2
/Network.pm \
123 PMG
/API2
/Services.pm \
126 PMG
/API2
/Domains.pm \
127 PMG
/API2
/Fetchmail.pm \
129 PMG
/API2
/Transport.pm \
130 PMG
/API2
/MyNetworks.pm \
131 PMG
/API2
/MimeTypes.pm \
133 PMG
/API2
/Cluster.pm \
135 PMG
/API2
/SpamAssassin.pm \
136 PMG
/API2
/Statistics.pm \
137 PMG
/API2
/MailTracker.pm \
140 PMG
/API2
/Postfix.pm \
141 PMG
/API2
/Quarantine.pm \
142 PMG
/API2
/AccessControl.pm \
143 PMG
/API2
/ObjectGroupHelpers.pm \
146 PMG
/API2
/SMTPWhitelist.pm \
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
158 deb
${DEB}: ${SOURCES}
161 cd build
; dpkg-buildpackage
-b
-us
-uc
165 PMG
/pmgcfg.pm
: PMG
/pmgcfg.pm.in
166 sed
-e s
/@VERSION@
/${PKGVER}/ -e s
/@PACKAGERELEASE@
/${PKGREL}/ -e s
/@PACKAGE@
/${PACKAGE}/ -e s
/@REPOID@
/${REPOID}/ $< >$@.tmp
170 perl
-I.
-T
-e
"use PMG::CLI::$*; PMG::CLI::$*->generate_bash_completions();" >$@.tmp
173 %.service-bash-completion
:
174 perl
-I.
-T
-e
"use PMG::Service::$*; PMG::Service::$*->generate_bash_completions();" >$@.tmp
177 install: ${SOURCES} $(addsuffix .service-bash-completion
, ${SERVICES}) $(addsuffix .bash-completion
, ${CLITOOLS})
178 for i in
${SERVICES}; do perl
-I.
-T
-e
"use PMG::Service::$$i; PMG::Service::$$i->verify_api();"; done
179 for i in
${CLITOOLS}; do perl
-I.
-T
-e
"use PMG::CLI::$$i; PMG::CLI::$$i->verify_api();"; done
180 perl
-I. bin
/pmgsh verifyapi
181 install -d
-m
0755 ${DESTDIR}/usr
/bin
182 install -d
-m
0755 -o www-data
-g www-data
${DESTDIR}/var
/log
/pmgproxy
183 install -d
-m
0755 ${DOCDIR}
184 # TODO: is there a better location ?
185 install -m
0644 favicon.ico
${DOCDIR}
186 install -D
-m
0644 pmg-apt.conf
${DESTDIR}/etc
/apt
/apt.conf.d
/75pmgconf
187 install -D
-m
0644 pmg-sources.list
${DESTDIR}/etc
/apt
/sources.list.d
/pmg-enterprise.list
188 for i in
${LIBSOURCES}; do
install -D
-m
0644 $$i ${PERL5DIR}/$$i; done
189 for i in
${SERVICES}; do
install -D
-m
0644 PMG
/Service
/$$i.pm
${PERL5DIR}/PMG
/Service
/$$i.pm
; done
190 for i in
${SERVICES}; do
install -m
0755 bin
/$$i ${DESTDIR}/usr
/bin
; done
191 for i in
${SERVICES}; do
install -m
0644 -D
$$i.service-bash-completion
${BASHCOMPLDIR}/$$i; done
192 for i in
${CLITOOLS}; do
install -D
-m
0644 PMG
/CLI
/$$i.pm
${PERL5DIR}/PMG
/CLI
/$$i.pm
; done
193 for i in
${CLITOOLS}; do
install -D
-m
0755 bin
/$$i ${DESTDIR}/usr
/bin
/$$i; done
194 for i in
${CLITOOLS}; do
install -D
-m
0644 $$i.bash-completion
${BASHCOMPLDIR}/$$i; done
195 for i in
${CLISCRIPTS}; do
install -D
-m
0755 bin
/$$i ${DESTDIR}/usr
/bin
/$$i; done
196 for i in
${TEMPLATES}; do
install -D
-m
0644 templates
/$$i ${DESTDIR}/var
/lib
/pmg
/templates
/$$i; done
197 for i in
${CLI_MANS}; do
install -D
-m
0644 $$i ${DESTDIR}/usr
/share
/man
/man1
/$$i; done
198 for i in
${CONF_MANS}; do
install -D
-m
0644 $$i ${DESTDIR}/usr
/share
/man
/man5
/$$i; done
199 for i in
${SERVICE_MANS}; do
install -D
-m
0644 $$i ${DESTDIR}/usr
/share
/man
/man8
/$$i; done
200 for i in
${CRONSCRIPTS}; do
install -D
-m
0755 bin
/$$i ${DESTDIR}/usr
/lib
/pmg
/bin
/$$i; done
201 install -d
-m
0755 ${DESTDIR}/lib
/systemd
/system
202 for i in
${TIMER_UNITS}; do
install -m
0644 $$i ${DESTDIR}/lib
/systemd
/system
/; done
203 install -D
-m
0644 pmg-initramfs.conf
${DESTDIR}/etc
/initramfs-tools
/conf.d
/pmg-initramfs.conf
207 .
/repoid.pl .git
/ check
208 tar cf
- ${DEB} | ssh
-X repoman@repo.proxmox.com
-- upload
--product pmg
--dist stretch
219 rm -rf
${CONF_MANS} .
/build
*.deb
*.changes
*.buildinfo
*.bash-completion
*.service-bash-completion
220 if
test -d .git
; then
rm -f PMG
/pmgcfg.pm
; fi
221 find .
-name
'*~' -exec
rm {} ';'