]> git.proxmox.com Git - pve-storage.git/blame - Makefile
replica: get_syncable_disks: skip disks with replica=0
[pve-storage.git] / Makefile
CommitLineData
da5a5489 1VERSION=5.0
b6cf0a66 2PACKAGE=libpve-storage-perl
d412b98d 3PKGREL=3
b6cf0a66
DM
4
5DESTDIR=
6PREFIX=/usr
7BINDIR=${PREFIX}/bin
8SBINDIR=${PREFIX}/sbin
9MANDIR=${PREFIX}/share/man
630f436a 10DOCDIR=${PREFIX}/share/doc/${PACKAGE}
b6cf0a66 11MAN1DIR=${MANDIR}/man1/
c669f42d 12BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/
fd69be97
WL
13CRONDIR=/etc/cron.d
14CRONREPLICA=${CRONDIR}/pve-replica
c669f42d 15
b6cf0a66
DM
16export PERLDIR=${PREFIX}/share/perl5
17
18#ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
19ARCH=all
19de44d4
DM
20GITVERSION:=$(shell cat .git/refs/heads/master)
21
b6cf0a66
DM
22DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
23
dbf890f0
DM
24# this require package pve-doc-generator
25export NOVIEW=1
26include /usr/share/pve-doc-generator/pve-doc-generator.mk
b6cf0a66
DM
27
28all: ${DEB}
29
30.PHONY: dinstall
31dinstall: deb
32 dpkg -i ${DEB}
33
c669f42d
DM
34pvesm.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
38pvesr.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 43install: 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
59deb: ${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
79clean:
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
85distclean: clean
86
87
88.PHONY: upload
89upload: ${DEB}
22588fc3 90 tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch
b6cf0a66 91