]> git.proxmox.com Git - pve-storage.git/blob - Makefile
buildsys: rework doc-gen cleanup and makefile inclusion
[pve-storage.git] / Makefile
1 include /usr/share/dpkg/pkg-info.mk
2
3 PACKAGE=libpve-storage-perl
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 GITVERSION:=$(shell git rev-parse HEAD)
18
19 DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
20
21 -include /usr/share/pve-doc-generator/pve-doc-generator.mk
22
23 all:
24
25 .PHONY: dinstall
26 dinstall: deb
27 dpkg -i ${DEB}
28
29 pvesm.bash-completion:
30 perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_bash_completions();" >$@.tmp
31 mv $@.tmp $@
32
33 pvesm.zsh-completion:
34 perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_zsh_completions();" >$@.tmp
35 mv $@.tmp $@
36
37 .PHONY: install
38 install: PVE pvesm.1 pvesm.bash-completion pvesm.zsh-completion
39 install -d ${DESTDIR}${SBINDIR}
40 install -m 0755 pvesm ${DESTDIR}${SBINDIR}
41 make -C PVE install
42 make -C udev-rbd install
43 install -d ${DESTDIR}/usr/share/man/man1
44 install -m 0644 pvesm.1 ${DESTDIR}/usr/share/man/man1/
45 gzip -9 -n ${DESTDIR}/usr/share/man/man1/pvesm.1
46 install -m 0644 -D pvesm.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pvesm
47 install -m 0644 -D pvesm.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pvesm
48
49 .PHONY: deb
50 deb: ${DEB}
51 ${DEB}:
52 rm -rf build
53 rsync -a * build
54 echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE
55 cd build; dpkg-buildpackage -b -us -uc
56 lintian ${DEB}
57
58 .PHONY: test
59 test:
60 perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
61 make -C test
62
63 .PHONY: clean
64 clean:
65 rm -f *.xml.tmp *.1 *.5 *.8 *{synopsis,opts}.adoc docinfo.xml
66 rm -rf build *.deb *.buildinfo *.changes
67
68 .PHONY: distclean
69 distclean: clean
70
71
72 .PHONY: upload
73 upload: ${DEB}
74 tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist bullseye