]>
Commit | Line | Data |
---|---|---|
da5a5489 | 1 | VERSION=5.0 |
b6cf0a66 | 2 | PACKAGE=libpve-storage-perl |
d412b98d | 3 | PKGREL=3 |
b6cf0a66 DM |
4 | |
5 | DESTDIR= | |
6 | PREFIX=/usr | |
7 | BINDIR=${PREFIX}/bin | |
8 | SBINDIR=${PREFIX}/sbin | |
9 | MANDIR=${PREFIX}/share/man | |
630f436a | 10 | DOCDIR=${PREFIX}/share/doc/${PACKAGE} |
b6cf0a66 | 11 | MAN1DIR=${MANDIR}/man1/ |
c669f42d | 12 | BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/ |
fd69be97 WL |
13 | CRONDIR=/etc/cron.d |
14 | CRONREPLICA=${CRONDIR}/pve-replica | |
c669f42d | 15 | |
b6cf0a66 DM |
16 | export PERLDIR=${PREFIX}/share/perl5 |
17 | ||
18 | #ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) | |
19 | ARCH=all | |
19de44d4 DM |
20 | GITVERSION:=$(shell cat .git/refs/heads/master) |
21 | ||
b6cf0a66 DM |
22 | DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb |
23 | ||
dbf890f0 DM |
24 | # this require package pve-doc-generator |
25 | export NOVIEW=1 | |
26 | include /usr/share/pve-doc-generator/pve-doc-generator.mk | |
b6cf0a66 DM |
27 | |
28 | all: ${DEB} | |
29 | ||
30 | .PHONY: dinstall | |
31 | dinstall: deb | |
32 | dpkg -i ${DEB} | |
33 | ||
c669f42d DM |
34 | pvesm.bash-completion: |
35 | perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->generate_bash_completions();" >$@.tmp | |
36 | mv $@.tmp $@ | |
630f436a | 37 | |
663510b8 WL |
38 | pvesr.bash-completion: |
39 | perl -I. -T -e "use PVE::CLI::pvesr; PVE::CLI::pvesr->generate_bash_completions();" >$@.tmp | |
40 | mv $@.tmp $@ | |
41 | ||
b6cf0a66 | 42 | .PHONY: install |
663510b8 | 43 | install: pvesm.1 pvesm.bash-completion pvesr.bash-completion |
b6cf0a66 DM |
44 | install -d ${DESTDIR}${SBINDIR} |
45 | install -m 0755 pvesm ${DESTDIR}${SBINDIR} | |
663510b8 | 46 | install -m 0755 pvesr ${DESTDIR}${SBINDIR} |
fd69be97 WL |
47 | install -d ${DESTDIR}${CRONDIR} |
48 | install -m 0644 pve-replica ${DESTDIR}${CRONREPLICA} | |
b6cf0a66 | 49 | make -C PVE install |
663510b8 | 50 | install -d ${DESTDIR}/var/lib/pve-replica |
b6cf0a66 | 51 | install -d ${DESTDIR}/usr/share/man/man1 |
dbf890f0 | 52 | install -m 0644 pvesm.1 ${DESTDIR}/usr/share/man/man1/ |
ad231f5f | 53 | gzip -9 -n ${DESTDIR}/usr/share/man/man1/pvesm.1 |
c669f42d | 54 | install -m 0644 -D pvesm.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pvesm |
663510b8 WL |
55 | install -m 0644 -D pvesr.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pverepm |
56 | ||
b6cf0a66 | 57 | |
4ddba650 WB |
58 | .PHONY: deb |
59 | deb: ${DEB} | |
60 | ${DEB}: | |
b6cf0a66 DM |
61 | rm -rf debian |
62 | mkdir debian | |
63 | make DESTDIR=${CURDIR}/debian install | |
c669f42d | 64 | perl -I. -T -e "use PVE::CLI::pvesm; PVE::CLI::pvesm->verify_api();" |
b6cf0a66 DM |
65 | install -d -m 0755 debian/DEBIAN |
66 | sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >debian/DEBIAN/control | |
630f436a DM |
67 | install -D -m 0644 copyright debian/${DOCDIR}/copyright |
68 | install -m 0644 changelog.Debian debian/${DOCDIR}/ | |
e7e82e04 | 69 | install -m 0644 triggers debian/DEBIAN |
fd69be97 | 70 | install -m 0644 conffiles debian/DEBIAN |
ad231f5f | 71 | gzip -9 -n debian/${DOCDIR}/changelog.Debian |
19de44d4 | 72 | echo "git clone git://git.proxmox.com/git/pve-storage.git\\ngit checkout ${GITVERSION}" > debian/${DOCDIR}/SOURCE |
2978f2d3 | 73 | fakeroot dpkg-deb --build debian |
b6cf0a66 DM |
74 | mv debian.deb ${DEB} |
75 | rm -rf debian | |
76 | lintian ${DEB} | |
77 | ||
78 | .PHONY: clean | |
dbf890f0 DM |
79 | clean: |
80 | make cleanup-docgen | |
663510b8 | 81 | rm -rf debian *.deb ${PACKAGE}-*.tar.gz dist *.1 *.tmp pvesm.bash-completion pvesr.bash-completion |
b6cf0a66 DM |
82 | find . -name '*~' -exec rm {} ';' |
83 | ||
84 | .PHONY: distclean | |
85 | distclean: clean | |
86 | ||
87 | ||
88 | .PHONY: upload | |
89 | upload: ${DEB} | |
22588fc3 | 90 | tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch |
b6cf0a66 | 91 |