bump version to 5.1-5
[pve-access-control.git] / Makefile
CommitLineData
b54b7474 1VERSION=5.1
2c3a6c0a 2PACKAGE=libpve-access-control
374647e8 3PKGREL=5
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 12BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
f4f506b8 13ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
e69dbe10 14
2c3a6c0a
DM
15export PERLDIR=${PREFIX}/share/perl5
16
98eb404f
TL
17export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
18
2c3a6c0a 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
15cebb28
DM
24# this requires package pve-doc-generator
25export NOVIEW=1
26include /usr/share/pve-doc-generator/pve-doc-generator.mk
27
98eb404f 28all:
2c3a6c0a
DM
29
30.PHONY: dinstall
31dinstall: deb
32 dpkg -i ${DEB}
33
e69dbe10
DM
34pveum.bash-completion: PVE/CLI/pveum.pm
35 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp
36 mv $@.tmp $@
37
f4f506b8
CE
38pveum.zsh-completion: PVE/CLI/pveum.pm
39 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_zsh_completions();" >$@.tmp
40 mv $@.tmp $@
41
2c3a6c0a 42.PHONY: install
f4f506b8 43install: pveum.1 oathkeygen pveum.bash-completion pveum.zsh-completion
2c3a6c0a
DM
44 install -d ${DESTDIR}${BINDIR}
45 install -d ${DESTDIR}${SBINDIR}
46 install -m 0755 pveum ${DESTDIR}${SBINDIR}
1abc2c0a 47 install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
2c3a6c0a 48 make -C PVE install
15cebb28
DM
49 install -d ${DESTDIR}/${MAN1DIR}
50 install -d ${DESTDIR}/${DOCDIR}
51 install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR}
8ae77032 52 gzip -9 -n ${DESTDIR}/${MAN1DIR}/pveum.1
e69dbe10 53 install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum
f4f506b8 54 install -m 0644 -D pveum.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pveum
2c3a6c0a 55
98eb404f
TL
56.PHONY: test
57test:
58 perl -I. ./pveum verifyapi
59 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
60
4e515e6d
WB
61.PHONY: deb
62deb: ${DEB}
63${DEB}:
151acc1f 64 rm -rf build
98eb404f 65 rsync -a * build
98eb404f 66 echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE
a96a6fd4 67 cd build; dpkg-buildpackage -b -us -uc
2c3a6c0a
DM
68 lintian ${DEB}
69
70.PHONY: upload
71upload: ${DEB}
3b6996cd 72 tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
2c3a6c0a
DM
73
74.PHONY: clean
15cebb28
DM
75clean:
76 make cleanup-docgen
98eb404f 77 rm -rf build *.deb *.buildinfo *.changes
2c3a6c0a
DM
78 find . -name '*~' -exec rm {} ';'
79
80.PHONY: distclean
81distclean: clean