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