bump version to 4.0-22
[pve-access-control.git] / Makefile
1 VERSION=4.0
2 PACKAGE=libpve-access-control
3 PKGREL=22
4
5 DESTDIR=
6 PREFIX=/usr
7 BINDIR=${PREFIX}/bin
8 SBINDIR=${PREFIX}/sbin
9 MANDIR=${PREFIX}/share/man
10 DOCDIR=${PREFIX}/share/doc/${PACKAGE}
11 MAN1DIR=${MANDIR}/man1/
12 BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
13
14 export PERLDIR=${PREFIX}/share/perl5
15
16 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
17 GITVERSION:=$(shell cat .git/refs/heads/master)
18
19 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
20
21 # this requires package pve-doc-generator
22 export NOVIEW=1
23 include /usr/share/pve-doc-generator/pve-doc-generator.mk
24
25 all: ${DEB}
26
27 .PHONY: dinstall
28 dinstall: deb
29         dpkg -i ${DEB}
30
31 pveum.bash-completion: PVE/CLI/pveum.pm
32         perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp
33         mv $@.tmp $@
34
35 .PHONY: install
36 install: pveum.1 oathkeygen pveum.bash-completion
37         install -d ${DESTDIR}${BINDIR}
38         install -d ${DESTDIR}${SBINDIR}
39         install -m 0755 pveum ${DESTDIR}${SBINDIR}
40         install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
41         make -C PVE install
42         perl -I. ./pveum verifyapi
43         perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
44         install -d ${DESTDIR}/${MAN1DIR}
45         install -d ${DESTDIR}/${DOCDIR}
46         install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR}
47         gzip -9 ${DESTDIR}/${MAN1DIR}/pveum.1
48         install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
49
50 .PHONY: deb ${DEB}
51 deb ${DEB}:
52         rm -rf build
53         mkdir build
54         make DESTDIR=`pwd`/build install
55         install -d -m 0755 build/DEBIAN
56         sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
57         echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >  build/${DOCDIR}/SOURCE
58         install -m 0644 triggers build/DEBIAN
59         install -D -m 0644 copyright build/${DOCDIR}/copyright
60         install -m 0644 changelog.Debian build/${DOCDIR}/
61         gzip -9 build/${DOCDIR}/changelog.Debian
62         dpkg-deb --build build  
63         mv build.deb ${DEB}
64         #rm -rf build
65         lintian ${DEB}
66
67 .PHONY: upload
68 upload: ${DEB}
69         tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
70
71 .PHONY: clean
72 clean:
73         make cleanup-docgen
74         rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1
75         find . -name '*~' -exec rm {} ';'
76
77 .PHONY: distclean
78 distclean: clean