bump version to 5.1-1
[pve-access-control.git] / Makefile
CommitLineData
b54b7474 1VERSION=5.1
2c3a6c0a 2PACKAGE=libpve-access-control
b54b7474 3PKGREL=1
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
98eb404f
TL
16export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
17
2c3a6c0a 18ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
36ad0763
DM
19GITVERSION:=$(shell cat .git/refs/heads/master)
20
2c3a6c0a
DM
21DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
22
15cebb28
DM
23# this requires package pve-doc-generator
24export NOVIEW=1
25include /usr/share/pve-doc-generator/pve-doc-generator.mk
26
98eb404f 27all:
2c3a6c0a
DM
28
29.PHONY: dinstall
30dinstall: deb
31 dpkg -i ${DEB}
32
e69dbe10
DM
33pveum.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
2c3a6c0a 37.PHONY: install
15cebb28 38install: pveum.1 oathkeygen pveum.bash-completion
2c3a6c0a
DM
39 install -d ${DESTDIR}${BINDIR}
40 install -d ${DESTDIR}${SBINDIR}
41 install -m 0755 pveum ${DESTDIR}${SBINDIR}
1abc2c0a 42 install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
2c3a6c0a 43 make -C PVE install
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
98eb404f
TL
50.PHONY: test
51test:
52 perl -I. ./pveum verifyapi
53 perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();"
54
4e515e6d
WB
55.PHONY: deb
56deb: ${DEB}
57${DEB}:
151acc1f 58 rm -rf build
98eb404f 59 rsync -a * build
98eb404f 60 echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE
a96a6fd4 61 cd build; dpkg-buildpackage -b -us -uc
2c3a6c0a
DM
62 lintian ${DEB}
63
64.PHONY: upload
65upload: ${DEB}
3b6996cd 66 tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
2c3a6c0a
DM
67
68.PHONY: clean
15cebb28
DM
69clean:
70 make cleanup-docgen
98eb404f 71 rm -rf build *.deb *.buildinfo *.changes
2c3a6c0a
DM
72 find . -name '*~' -exec rm {} ';'
73
74.PHONY: distclean
75distclean: clean