bump version to 4.0-15
[pve-access-control.git] / Makefile
CommitLineData
6936fa1b 1RELEASE=4.1
2c3a6c0a 2
dfbcf6d3 3VERSION=4.0
2c3a6c0a 4PACKAGE=libpve-access-control
678df887 5PKGREL=15
2c3a6c0a
DM
6
7DESTDIR=
8PREFIX=/usr
9BINDIR=${PREFIX}/bin
10SBINDIR=${PREFIX}/sbin
11MANDIR=${PREFIX}/share/man
362fe4c6
DM
12DOCDIR=${PREFIX}/share/doc/${PACKAGE}
13PODDIR=${DOCDIR}/pod
2c3a6c0a 14MAN1DIR=${MANDIR}/man1/
e69dbe10
DM
15BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
16
2c3a6c0a
DM
17export PERLDIR=${PREFIX}/share/perl5
18
19ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
36ad0763
DM
20GITVERSION:=$(shell cat .git/refs/heads/master)
21
2c3a6c0a
DM
22DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
23
24all: ${DEB}
25
26.PHONY: dinstall
27dinstall: deb
28 dpkg -i ${DEB}
29
362fe4c6
DM
30%.1.gz: %.1.pod
31 rm -f $@
dcfaabd7
DM
32 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@.tmp
33 mv $@.tmp $@
362fe4c6 34
09281ad7
DM
35pveum.1.pod: PVE/CLI/pveum.pm
36 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_pod_manpage();" >$@.tmp
dcfaabd7 37 mv $@.tmp $@
362fe4c6 38
e69dbe10
DM
39pveum.bash-completion: PVE/CLI/pveum.pm
40 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp
41 mv $@.tmp $@
42
2c3a6c0a 43.PHONY: install
e69dbe10 44install: pveum.1.pod pveum.1.gz oathkeygen pveum.bash-completion
2c3a6c0a
DM
45 install -d ${DESTDIR}${BINDIR}
46 install -d ${DESTDIR}${SBINDIR}
47 install -m 0755 pveum ${DESTDIR}${SBINDIR}
1abc2c0a 48 install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
2c3a6c0a 49 make -C PVE install
09281ad7
DM
50 perl -I. ./pveum verifyapi
51 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
2c3a6c0a 52 install -d ${DESTDIR}/usr/share/man/man1
362fe4c6
DM
53 install -d ${DESTDIR}${PODDIR}
54 install -m 0644 pveum.1.gz ${DESTDIR}/usr/share/man/man1/
55 install -m 0644 pveum.1.pod ${DESTDIR}/${PODDIR}
e69dbe10 56 install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
2c3a6c0a
DM
57
58.PHONY: deb ${DEB}
59deb ${DEB}:
151acc1f
DM
60 rm -rf build
61 mkdir build
62 make DESTDIR=`pwd`/build install
63 install -d -m 0755 build/DEBIAN
64 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
36ad0763 65 echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/SOURCE
3b07e2b9 66 install -m 0644 triggers build/DEBIAN
362fe4c6
DM
67 install -D -m 0644 copyright build/${DOCDIR}/copyright
68 install -m 0644 changelog.Debian build/${DOCDIR}/
69 gzip -9 build/${DOCDIR}/changelog.Debian
151acc1f
DM
70 dpkg-deb --build build
71 mv build.deb ${DEB}
72 #rm -rf build
2c3a6c0a
DM
73 lintian ${DEB}
74
75.PHONY: upload
76upload: ${DEB}
77 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
78 mkdir -p /pve/${RELEASE}/extra
79 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
80 rm -f /pve/${RELEASE}/extra/Packages*
81 cp ${DEB} /pve/${RELEASE}/extra
82 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
83 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
84
85.PHONY: clean
86clean:
eb09b155 87 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
2c3a6c0a
DM
88 find . -name '*~' -exec rm {} ';'
89
90.PHONY: distclean
91distclean: clean