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