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