2016-06-03 13:06:00 +03:00
RELEASE = 4.2
2011-08-23 09:43:03 +04:00
2015-02-26 15:38:01 +03:00
VERSION = 4.0
2011-08-23 09:43:03 +04:00
PACKAGE = libpve-storage-perl
2016-09-07 10:14:53 +03:00
PKGREL = 58
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/
2011-08-23 09:43:03 +04:00
export PERLDIR = ${ PREFIX } /share/perl5
#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
ARCH = all
2013-09-05 15:02:40 +04:00
GITVERSION := $( shell cat .git/refs/heads/master)
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
all : ${DEB }
.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
2011-08-23 09:43:03 +04:00
.PHONY : install
2016-04-06 12:26:44 +03:00
install : pvesm .1 pvesm .bash -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/
gzip -9 ${ 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
2011-08-23 09:43:03 +04:00
.PHONY : deb ${DEB }
deb ${DEB} :
rm -rf debian
mkdir debian
make DESTDIR = ${ CURDIR } /debian install
2015-09-18 09:21:17 +03:00
perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();"
2011-08-23 09:43:03 +04:00
install -d -m 0755 debian/DEBIAN
sed -e s/@@VERSION@@/${ VERSION } / -e s/@@PKGRELEASE@@/${ PKGREL } / -e s/@@ARCH@@/${ ARCH } / <control.in >debian/DEBIAN/control
2011-10-20 10:20:37 +04:00
install -D -m 0644 copyright debian/${ DOCDIR } /copyright
install -m 0644 changelog.Debian debian/${ DOCDIR } /
2015-06-16 11:05:22 +03:00
install -m 0644 triggers debian/DEBIAN
2011-10-20 10:20:37 +04:00
gzip -9 debian/${ DOCDIR } /changelog.Debian
2013-09-05 15:02:40 +04:00
echo " git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${ GITVERSION } " > debian/${ DOCDIR } /SOURCE
2011-08-23 09:43:03 +04:00
dpkg-deb --build debian
mv debian.deb ${ DEB }
rm -rf debian
lintian ${ DEB }
.PHONY : clean
2016-04-06 12:26:44 +03:00
clean :
make cleanup-docgen
rm -rf debian *.deb ${ PACKAGE } -*.tar.gz dist *.1 *.tmp pvesm.bash-completion
2011-08-23 09:43:03 +04:00
find . -name '*~' -exec rm { } ';'
.PHONY : distclean
distclean : clean
.PHONY : upload
upload : ${DEB }
umount /pve/${ RELEASE } ; mount /pve/${ RELEASE } -o rw
mkdir -p /pve/${ RELEASE } /extra
rm -f /pve/${ RELEASE } /extra/${ PACKAGE } _*.deb
rm -f /pve/${ RELEASE } /extra/Packages*
cp ${ DEB } /pve/${ RELEASE } /extra
cd /pve/${ RELEASE } /extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
umount /pve/${ RELEASE } ; mount /pve/${ RELEASE } -o ro