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