]> git.proxmox.com Git - pve-storage.git/blob - Makefile
cc5d3e09a89767b8f95ce95eebd4b3d270d82704
[pve-storage.git] / Makefile
1 RELEASE=2.2
2
3 VERSION=2.0
4 PACKAGE=libpve-storage-perl
5 PKGREL=35
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 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
20
21
22 all: ${DEB}
23
24 .PHONY: dinstall
25 dinstall: deb
26 dpkg -i ${DEB}
27
28 %.1.gz: %.1.pod
29 rm -f $@
30 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
31
32 pvesm.1.pod: pvesm PVE/Storage.pm
33 perl -I. ./pvesm printmanpod >$@
34
35 .PHONY: install
36 install: pvesm.1.pod pvesm.1.gz
37 install -d ${DESTDIR}${SBINDIR}
38 install -m 0755 pvesm ${DESTDIR}${SBINDIR}
39 make -C PVE install
40 install -d ${DESTDIR}/usr/share/man/man1
41 install -d ${DESTDIR}${PODDIR}
42 install -m 0644 pvesm.1.gz ${DESTDIR}/usr/share/man/man1/
43 install -m 0644 pvesm.1.pod ${DESTDIR}/${PODDIR}
44
45 .PHONY: deb ${DEB}
46 deb ${DEB}:
47 rm -rf debian
48 mkdir debian
49 make DESTDIR=${CURDIR}/debian install
50 perl -I. ./pvesm verifyapi
51 install -d -m 0755 debian/DEBIAN
52 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >debian/DEBIAN/control
53 install -D -m 0644 copyright debian/${DOCDIR}/copyright
54 install -m 0644 changelog.Debian debian/${DOCDIR}/
55 gzip -9 debian/${DOCDIR}/changelog.Debian
56 dpkg-deb --build debian
57 mv debian.deb ${DEB}
58 rm -rf debian
59 lintian ${DEB}
60
61 .PHONY: clean
62 clean:
63 rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1.pod *.1.gz
64 find . -name '*~' -exec rm {} ';'
65
66 .PHONY: distclean
67 distclean: clean
68
69
70 .PHONY: upload
71 upload: ${DEB}
72 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
73 mkdir -p /pve/${RELEASE}/extra
74 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
75 rm -f /pve/${RELEASE}/extra/Packages*
76 cp ${DEB} /pve/${RELEASE}/extra
77 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
78 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
79