2017-03-10 11:24:11 +03:00
VERSION = 5.0
2011-08-23 09:43:03 +04:00
PACKAGE = libpve-storage-perl
2019-05-15 17:16:58 +03:00
PKGREL = 43
2011-08-23 09:43:03 +04:00
DESTDIR =
PREFIX = /usr
BINDIR = ${ PREFIX } /bin
SBINDIR = ${ PREFIX } /sbin
MANDIR = ${ PREFIX } /share/man
2011-10-20 10:20:37 +04:00
DOCDIR = ${ PREFIX } /share/doc/${ PACKAGE }
2011-08-23 09:43:03 +04:00
MAN1DIR = ${ MANDIR } /man1/
2015-09-18 09:21:17 +03:00
BASHCOMPLDIR = ${ PREFIX } /share/bash-completion/completions/
2019-02-21 16:25:02 +03:00
ZSHCOMPLDIR = ${ PREFIX } /share/zsh/vendor-completions/
2015-09-18 09:21:17 +03:00
2011-08-23 09:43:03 +04:00
export PERLDIR = ${ PREFIX } /share/perl5
2017-06-09 18:20:09 +03:00
export SOURCE_DATE_EPOCH ?= $( shell dpkg-parsechangelog -STimestamp)
2011-08-23 09:43:03 +04:00
ARCH = all
2018-05-16 11:09:37 +03:00
GITVERSION := $( shell git rev-parse HEAD)
2013-09-05 15:02:40 +04:00
2011-08-23 09:43:03 +04:00
DEB = ${ PACKAGE } _${ VERSION } -${ PKGREL } _${ ARCH } .deb
2016-04-06 12:26:44 +03:00
# this require package pve-doc-generator
export NOVIEW = 1
i n c l u d e / u s r / s h a r e / p v e - d o c - g e n e r a t o r / p v e - d o c - g e n e r a t o r . m k
2011-08-23 09:43:03 +04:00
2017-06-09 18:20:09 +03:00
all :
2011-08-23 09:43:03 +04:00
.PHONY : dinstall
dinstall : deb
dpkg -i ${ DEB }
2015-09-18 09:21:17 +03:00
pvesm.bash-completion :
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_bash_completions();" >$@ .tmp
mv $@ .tmp $@
2011-10-20 10:20:37 +04:00
2019-02-21 16:25:02 +03:00
pvesm.zsh-completion :
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_zsh_completions();" >$@ .tmp
mv $@ .tmp $@
2011-08-23 09:43:03 +04:00
.PHONY : install
2019-02-21 16:25:02 +03:00
install : PVE pvesm .1 pvesm .bash -completion pvesm .zsh -completion
2011-08-23 09:43:03 +04:00
install -d ${ DESTDIR } ${ SBINDIR }
install -m 0755 pvesm ${ DESTDIR } ${ SBINDIR }
make -C PVE install
install -d ${ DESTDIR } /usr/share/man/man1
2016-04-06 12:26:44 +03:00
install -m 0644 pvesm.1 ${ DESTDIR } /usr/share/man/man1/
2017-02-06 13:50:37 +03:00
gzip -9 -n ${ DESTDIR } /usr/share/man/man1/pvesm.1
2015-09-18 09:21:17 +03:00
install -m 0644 -D pvesm.bash-completion ${ DESTDIR } ${ BASHCOMPLDIR } /pvesm
2019-02-21 16:25:02 +03:00
install -m 0644 -D pvesm.zsh-completion ${ DESTDIR } ${ ZSHCOMPLDIR } /_pvesm
2011-08-23 09:43:03 +04:00
2017-02-06 13:50:01 +03:00
.PHONY : deb
deb : ${DEB }
2017-06-09 18:20:09 +03:00
${DEB} :
rm -rf build
rsync -a * build
echo " git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${ GITVERSION } " >build/debian/SOURCE
2017-06-12 11:14:54 +03:00
cd build; dpkg-buildpackage -b -us -uc
2011-08-23 09:43:03 +04:00
lintian ${ DEB }
2017-06-09 18:20:09 +03:00
.PHONY : test
test :
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
2017-05-17 12:42:38 +03:00
make -C test
2011-08-23 09:43:03 +04:00
.PHONY : clean
2016-04-06 12:26:44 +03:00
clean :
make cleanup-docgen
2017-06-09 18:20:09 +03:00
rm -rf build *.deb *.buildinfo *.changes
2011-08-23 09:43:03 +04:00
find . -name '*~' -exec rm { } ';'
.PHONY : distclean
distclean : clean
.PHONY : upload
upload : ${DEB }
2017-03-10 11:23:51 +03:00
tar cf - ${ DEB } | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch
2011-08-23 09:43:03 +04:00