]> git.proxmox.com Git - pve-firewall.git/commitdiff
use service class to generate pod and bash-completion files
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 24 Sep 2015 10:13:10 +0000 (12:13 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 24 Sep 2015 10:13:10 +0000 (12:13 +0200)
src/Makefile

index 9d67b67b0c8b56400b34cc32256954a7d937c5f4..7cc10fb2a98a4b2b37d7596cd9bc2526ad124731 100644 (file)
@@ -6,16 +6,24 @@ export MANDIR=${PREFIX}/share/man
 export DOCDIR=${PREFIX}/share/doc/pve-firewall
 export PODDIR=${DOCDIR}/pod
 export MAN1DIR=${MANDIR}/man1/
+export MAN8DIR=${MANDIR}/man8/
 export PERLDIR=${PREFIX}/share/perl5
+export BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions
 
-all: pve-firewall.1 pvefw-logger
+all: pve-firewall.8 pvefw-logger
 
-%.1: %.1.pod
+%.8: %.8.pod
        rm -f $@
-       cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation" >$@
+       cat $<|pod2man -n $* -s 8 -r ${VERSION} -c "Proxmox Documentation" >$@.tmp
+       mv $@.tmp $@
 
-pve-firewall.1.pod: pve-firewall
-       perl -I.. ./pve-firewall printmanpod >$@
+pve-firewall.8.pod: PVE/Service/pve_firewall.pm
+       perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_pod_manpage();" >$@.tmp
+       mv $@.tmp $@
+
+pve-firewall.bash-completion: PVE/Service/pve_firewall.pm
+       perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_bash_completions();" >$@.tmp
+       mv $@.tmp $@
 
 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
@@ -27,21 +35,23 @@ pvefw-logger: pvefw-logger.c
        $(shell pkg-config libnetfilter_log glib-2.0 gthread-2.0 --libs --cflags)
 
 .PHONY: install
-install: pve-firewall pve-firewall.1 pve-firewall.1.pod pvefw-logger
+install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.8.pod pvefw-logger
        make -C PVE install
        install -d -m 0755 ${DESTDIR}/${SBINDIR}
        install -m 0755 pve-firewall ${DESTDIR}/${SBINDIR}
        install -m 0755 --strip pvefw-logger ${DESTDIR}/${SBINDIR}
-       install -d ${DESTDIR}/${MAN1DIR}
-       install -m 0644 pve-firewall.1 ${DESTDIR}/${MAN1DIR}
+       install -d ${DESTDIR}/${MAN8DIR}
+       install -m 0644 pve-firewall.8 ${DESTDIR}/${MAN8DIR}
        install -d ${DESTDIR}/${PODDIR}
-       install -m 0644 pve-firewall.1.pod ${DESTDIR}/${PODDIR}
-
+       install -m 0644 pve-firewall.8.pod ${DESTDIR}/${PODDIR}
+       install -m 0644 -D pve-firewall.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/pve-firewall
 
 .PHONY: clean
 clean:         
        make -C PVE clean
-       rm -rf *~ pvefw-logger
+       rm -rf pvefw-logger
+       find . -name '*~' -exec rm {} ';'
+
 
 .PHONY: distclean
 distclean: clean