]> git.proxmox.com Git - pve-storage.git/blob - Makefile
bump version to 5.0-41
[pve-storage.git] / Makefile
1 VERSION=5.0
2 PACKAGE=libpve-storage-perl
3 PKGREL=41
4
5 DESTDIR=
6 PREFIX=/usr
7 BINDIR=${PREFIX}/bin
8 SBINDIR=${PREFIX}/sbin
9 MANDIR=${PREFIX}/share/man
10 DOCDIR=${PREFIX}/share/doc/${PACKAGE}
11 MAN1DIR=${MANDIR}/man1/
12 BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
13 ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/
14
15 export PERLDIR=${PREFIX}/share/perl5
16
17 export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
18
19 ARCH=all
20 GITVERSION:=$(shell git rev-parse HEAD)
21
22 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
23
24 # this require package pve-doc-generator
25 export NOVIEW=1
26 include /usr/share/pve-doc-generator/pve-doc-generator.mk
27
28 all:
29
30 .PHONY: dinstall
31 dinstall: deb
32 dpkg -i ${DEB}
33
34 pvesm.bash-completion:
35 perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_bash_completions();" >$@.tmp
36 mv $@.tmp $@
37
38 pvesm.zsh-completion:
39 perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_zsh_completions();" >$@.tmp
40 mv $@.tmp $@
41
42 .PHONY: install
43 install: PVE pvesm.1 pvesm.bash-completion pvesm.zsh-completion
44 install -d ${DESTDIR}${SBINDIR}
45 install -m 0755 pvesm ${DESTDIR}${SBINDIR}
46 make -C PVE install
47 install -d ${DESTDIR}/usr/share/man/man1
48 install -m 0644 pvesm.1 ${DESTDIR}/usr/share/man/man1/
49 gzip -9 -n ${DESTDIR}/usr/share/man/man1/pvesm.1
50 install -m 0644 -D pvesm.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pvesm
51 install -m 0644 -D pvesm.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pvesm
52
53 .PHONY: deb
54 deb: ${DEB}
55 ${DEB}:
56 rm -rf build
57 rsync -a * build
58 echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE
59 cd build; dpkg-buildpackage -b -us -uc
60 lintian ${DEB}
61
62 .PHONY: test
63 test:
64 perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
65 make -C test
66
67 .PHONY: clean
68 clean:
69 make cleanup-docgen
70 rm -rf build *.deb *.buildinfo *.changes
71 find . -name '*~' -exec rm {} ';'
72
73 .PHONY: distclean
74 distclean: clean
75
76
77 .PHONY: upload
78 upload: ${DEB}
79 tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch
80