bump version to 5.0-4
[pve-access-control.git] / Makefile
CommitLineData
0835385b 1VERSION=5.0
2c3a6c0a 2PACKAGE=libpve-access-control
868fb1ea 3PKGREL=4
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}
8ae77032 47 gzip -9 -n ${DESTDIR}/${MAN1DIR}/pveum.1
e69dbe10 48 install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
2c3a6c0a 49
4e515e6d
WB
50.PHONY: deb
51deb: ${DEB}
52${DEB}:
151acc1f
DM
53 rm -rf build
54 mkdir build
55 make DESTDIR=`pwd`/build install
56 install -d -m 0755 build/DEBIAN
57 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
36ad0763 58 echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/SOURCE
3b07e2b9 59 install -m 0644 triggers build/DEBIAN
362fe4c6
DM
60 install -D -m 0644 copyright build/${DOCDIR}/copyright
61 install -m 0644 changelog.Debian build/${DOCDIR}/
8ae77032 62 gzip -9 -n build/${DOCDIR}/changelog.Debian
156fd8f7 63 fakeroot dpkg-deb --build build
151acc1f
DM
64 mv build.deb ${DEB}
65 #rm -rf build
2c3a6c0a
DM
66 lintian ${DEB}
67
68.PHONY: upload
69upload: ${DEB}
3b6996cd 70 tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
2c3a6c0a
DM
71
72.PHONY: clean
15cebb28
DM
73clean:
74 make cleanup-docgen
75 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1
2c3a6c0a
DM
76 find . -name '*~' -exec rm {} ';'
77
78.PHONY: distclean
79distclean: clean