5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2024-12-23 17:34:34 +03:00
pve-storage/Makefile
2015-08-07 09:46:49 +02:00

84 lines
2.2 KiB
Makefile

RELEASE=4.0
VERSION=4.0
PACKAGE=libpve-storage-perl
PKGREL=14
DESTDIR=
PREFIX=/usr
BINDIR=${PREFIX}/bin
SBINDIR=${PREFIX}/sbin
MANDIR=${PREFIX}/share/man
DOCDIR=${PREFIX}/share/doc/${PACKAGE}
PODDIR=${DOCDIR}/pod
MAN1DIR=${MANDIR}/man1/
export PERLDIR=${PREFIX}/share/perl5
#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
ARCH=all
GITVERSION:=$(shell cat .git/refs/heads/master)
DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
all: ${DEB}
.PHONY: dinstall
dinstall: deb
dpkg -i ${DEB}
%.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 >$@
.PHONY: install
install: pvesm.1.pod pvesm.1.gz
install -d ${DESTDIR}${SBINDIR}
install -m 0755 pvesm ${DESTDIR}${SBINDIR}
make -C PVE install
install -d ${DESTDIR}/usr/share/man/man1
install -d ${DESTDIR}${PODDIR}
install -m 0644 pvesm.1.gz ${DESTDIR}/usr/share/man/man1/
install -m 0644 pvesm.1.pod ${DESTDIR}/${PODDIR}
.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
install -D -m 0644 copyright debian/${DOCDIR}/copyright
install -m 0644 changelog.Debian debian/${DOCDIR}/
install -m 0644 triggers debian/DEBIAN
gzip -9 debian/${DOCDIR}/changelog.Debian
echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" > debian/${DOCDIR}/SOURCE
dpkg-deb --build debian
mv debian.deb ${DEB}
rm -rf debian
lintian ${DEB}
.PHONY: clean
clean:
rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz
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