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