2014-09-10 16:18:42 +04:00
RELEASE = 3.3
2011-08-23 09:43:03 +04:00
2013-03-15 11:15:35 +04:00
VERSION = 3.0
2011-08-23 09:43:03 +04:00
PACKAGE = libpve-storage-perl
2014-10-25 11:47:39 +04:00
PKGREL = 25
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 }
PODDIR = ${ DOCDIR } /pod
2011-08-23 09:43:03 +04:00
MAN1DIR = ${ MANDIR } /man1/
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
all : ${DEB }
.PHONY : dinstall
dinstall : deb
dpkg -i ${ DEB }
2011-10-20 10:20:37 +04:00
%.1.gz : %.1.pod
rm -f $@
cat $<| pod2man -n $* -s 1 -r ${ VERSION } -c "Proxmox Documentation" | gzip -c9 >$@
pvesm.1.pod : pvesm PVE /Storage .pm
perl -I. ./pvesm printmanpod >$@
2011-08-23 09:43:03 +04:00
.PHONY : install
2011-10-20 10:20:37 +04:00
install : pvesm .1.pod pvesm .1.gz
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
2011-10-20 10:20:37 +04:00
install -d ${ DESTDIR } ${ PODDIR }
install -m 0644 pvesm.1.gz ${ DESTDIR } /usr/share/man/man1/
install -m 0644 pvesm.1.pod ${ DESTDIR } /${ PODDIR }
2011-08-23 09:43:03 +04:00
.PHONY : deb ${DEB }
deb ${DEB} :
rm -rf debian
mkdir debian
make DESTDIR = ${ CURDIR } /debian install
perl -I. ./pvesm verifyapi
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 } /
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
clean :
2011-10-20 10:20:37 +04:00
rm -rf debian *.deb ${ PACKAGE } -*.tar.gz dist *.1.pod *.1.gz
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