bump version to 4.0-5
[pve-access-control.git] / Makefile
CommitLineData
dfbcf6d3 1RELEASE=4.0
2c3a6c0a 2
dfbcf6d3 3VERSION=4.0
2c3a6c0a 4PACKAGE=libpve-access-control
7d2df2ef 5PKGREL=5
2c3a6c0a
DM
6
7DESTDIR=
8PREFIX=/usr
9BINDIR=${PREFIX}/bin
10SBINDIR=${PREFIX}/sbin
11MANDIR=${PREFIX}/share/man
362fe4c6
DM
12DOCDIR=${PREFIX}/share/doc/${PACKAGE}
13PODDIR=${DOCDIR}/pod
2c3a6c0a
DM
14MAN1DIR=${MANDIR}/man1/
15export PERLDIR=${PREFIX}/share/perl5
16
17ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
36ad0763
DM
18GITVERSION:=$(shell cat .git/refs/heads/master)
19
2c3a6c0a
DM
20DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
21
22all: ${DEB}
23
24.PHONY: dinstall
25dinstall: deb
26 dpkg -i ${DEB}
27
362fe4c6
DM
28%.1.gz: %.1.pod
29 rm -f $@
dcfaabd7
DM
30 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@.tmp
31 mv $@.tmp $@
362fe4c6
DM
32
33pveum.1.pod: pveum
dcfaabd7
DM
34 perl -I. ./pveum printmanpod >$@.tmp
35 mv $@.tmp $@
362fe4c6 36
2c3a6c0a 37.PHONY: install
1abc2c0a 38install: pveum.1.pod pveum.1.gz oathkeygen
2c3a6c0a
DM
39 install -d ${DESTDIR}${BINDIR}
40 install -d ${DESTDIR}${SBINDIR}
41 install -m 0755 pveum ${DESTDIR}${SBINDIR}
1abc2c0a 42 install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
2c3a6c0a
DM
43 make -C PVE install
44 perl -I. ./pveum verifyapi
45 install -d ${DESTDIR}/usr/share/man/man1
362fe4c6
DM
46 install -d ${DESTDIR}${PODDIR}
47 install -m 0644 pveum.1.gz ${DESTDIR}/usr/share/man/man1/
48 install -m 0644 pveum.1.pod ${DESTDIR}/${PODDIR}
2c3a6c0a
DM
49
50.PHONY: deb ${DEB}
51deb ${DEB}:
151acc1f
DM
52 rm -rf build
53 mkdir build
54 make DESTDIR=`pwd`/build install
55 install -d -m 0755 build/DEBIAN
56 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
36ad0763 57 echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/SOURCE
3b07e2b9 58 install -m 0644 triggers build/DEBIAN
362fe4c6
DM
59 install -D -m 0644 copyright build/${DOCDIR}/copyright
60 install -m 0644 changelog.Debian build/${DOCDIR}/
61 gzip -9 build/${DOCDIR}/changelog.Debian
151acc1f
DM
62 dpkg-deb --build build
63 mv build.deb ${DEB}
64 #rm -rf build
2c3a6c0a
DM
65 lintian ${DEB}
66
67.PHONY: upload
68upload: ${DEB}
69 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
70 mkdir -p /pve/${RELEASE}/extra
71 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
72 rm -f /pve/${RELEASE}/extra/Packages*
73 cp ${DEB} /pve/${RELEASE}/extra
74 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
75 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
76
77.PHONY: clean
78clean:
eb09b155 79 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
2c3a6c0a
DM
80 find . -name '*~' -exec rm {} ';'
81
82.PHONY: distclean
83distclean: clean