]> git.proxmox.com Git - pve-storage.git/blame - Makefile
bump version to 4.0-6
[pve-storage.git] / Makefile
CommitLineData
74e8c51e 1RELEASE=4.0
b6cf0a66 2
74e8c51e 3VERSION=4.0
b6cf0a66 4PACKAGE=libpve-storage-perl
2e7912ae 5PKGREL=6
b6cf0a66
DM
6
7DESTDIR=
8PREFIX=/usr
9BINDIR=${PREFIX}/bin
10SBINDIR=${PREFIX}/sbin
11MANDIR=${PREFIX}/share/man
630f436a
DM
12DOCDIR=${PREFIX}/share/doc/${PACKAGE}
13PODDIR=${DOCDIR}/pod
b6cf0a66
DM
14MAN1DIR=${MANDIR}/man1/
15export PERLDIR=${PREFIX}/share/perl5
16
17#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
18ARCH=all
19de44d4
DM
19GITVERSION:=$(shell cat .git/refs/heads/master)
20
b6cf0a66
DM
21DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
22
23
24all: ${DEB}
25
26.PHONY: dinstall
27dinstall: deb
28 dpkg -i ${DEB}
29
630f436a
DM
30%.1.gz: %.1.pod
31 rm -f $@
32 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
33
34pvesm.1.pod: pvesm PVE/Storage.pm
35 perl -I. ./pvesm printmanpod >$@
36
b6cf0a66 37.PHONY: install
630f436a 38install: pvesm.1.pod pvesm.1.gz
b6cf0a66
DM
39 install -d ${DESTDIR}${SBINDIR}
40 install -m 0755 pvesm ${DESTDIR}${SBINDIR}
41 make -C PVE install
42 install -d ${DESTDIR}/usr/share/man/man1
630f436a
DM
43 install -d ${DESTDIR}${PODDIR}
44 install -m 0644 pvesm.1.gz ${DESTDIR}/usr/share/man/man1/
45 install -m 0644 pvesm.1.pod ${DESTDIR}/${PODDIR}
b6cf0a66
DM
46
47.PHONY: deb ${DEB}
48deb ${DEB}:
49 rm -rf debian
50 mkdir debian
51 make DESTDIR=${CURDIR}/debian install
52 perl -I. ./pvesm verifyapi
53 install -d -m 0755 debian/DEBIAN
54 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >debian/DEBIAN/control
630f436a
DM
55 install -D -m 0644 copyright debian/${DOCDIR}/copyright
56 install -m 0644 changelog.Debian debian/${DOCDIR}/
57 gzip -9 debian/${DOCDIR}/changelog.Debian
19de44d4 58 echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" > debian/${DOCDIR}/SOURCE
b6cf0a66
DM
59 dpkg-deb --build debian
60 mv debian.deb ${DEB}
61 rm -rf debian
62 lintian ${DEB}
63
64.PHONY: clean
65clean:
630f436a 66 rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz
b6cf0a66
DM
67 find . -name '*~' -exec rm {} ';'
68
69.PHONY: distclean
70distclean: clean
71
72
73.PHONY: upload
74upload: ${DEB}
75 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
76 mkdir -p /pve/${RELEASE}/extra
77 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
78 rm -f /pve/${RELEASE}/extra/Packages*
79 cp ${DEB} /pve/${RELEASE}/extra
80 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
81 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
82