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