]>
Commit | Line | Data |
---|---|---|
74e8c51e | 1 | RELEASE=4.0 |
b6cf0a66 | 2 | |
74e8c51e | 3 | VERSION=4.0 |
b6cf0a66 | 4 | PACKAGE=libpve-storage-perl |
2e7912ae | 5 | PKGREL=6 |
b6cf0a66 DM |
6 | |
7 | DESTDIR= | |
8 | PREFIX=/usr | |
9 | BINDIR=${PREFIX}/bin | |
10 | SBINDIR=${PREFIX}/sbin | |
11 | MANDIR=${PREFIX}/share/man | |
630f436a DM |
12 | DOCDIR=${PREFIX}/share/doc/${PACKAGE} |
13 | PODDIR=${DOCDIR}/pod | |
b6cf0a66 DM |
14 | MAN1DIR=${MANDIR}/man1/ |
15 | export PERLDIR=${PREFIX}/share/perl5 | |
16 | ||
17 | #ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) | |
18 | ARCH=all | |
19de44d4 DM |
19 | GITVERSION:=$(shell cat .git/refs/heads/master) |
20 | ||
b6cf0a66 DM |
21 | DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb |
22 | ||
23 | ||
24 | all: ${DEB} | |
25 | ||
26 | .PHONY: dinstall | |
27 | dinstall: 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 | ||
34 | pvesm.1.pod: pvesm PVE/Storage.pm | |
35 | perl -I. ./pvesm printmanpod >$@ | |
36 | ||
b6cf0a66 | 37 | .PHONY: install |
630f436a | 38 | install: 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} | |
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 | |
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 | |
65 | clean: | |
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 | |
70 | distclean: clean | |
71 | ||
72 | ||
73 | .PHONY: upload | |
74 | upload: ${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 |