allow dots in access paths
[pve-access-control.git] / Makefile
1 RELEASE=3.1
2
3 VERSION=3.0
4 PACKAGE=libpve-access-control
5 PKGREL=9
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 GITVERSION:=$(shell cat .git/refs/heads/master)
19
20 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
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 >$@.tmp
31 mv $@.tmp $@
32
33 pveum.1.pod: pveum
34 perl -I. ./pveum printmanpod >$@.tmp
35 mv $@.tmp $@
36
37 .PHONY: install
38 install: pveum.1.pod pveum.1.gz
39 install -d ${DESTDIR}${BINDIR}
40 install -d ${DESTDIR}${SBINDIR}
41 install -m 0755 pveum ${DESTDIR}${SBINDIR}
42 make -C PVE install
43 perl -I. ./pveum verifyapi
44 install -d ${DESTDIR}/usr/share/man/man1
45 install -d ${DESTDIR}${PODDIR}
46 install -m 0644 pveum.1.gz ${DESTDIR}/usr/share/man/man1/
47 install -m 0644 pveum.1.pod ${DESTDIR}/${PODDIR}
48
49 .PHONY: deb ${DEB}
50 deb ${DEB}:
51 rm -rf build
52 mkdir build
53 make DESTDIR=`pwd`/build install
54 install -d -m 0755 build/DEBIAN
55 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
56 echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" > build/${DOCDIR}/SOURCE
57 install -D -m 0644 copyright build/${DOCDIR}/copyright
58 install -m 0644 changelog.Debian build/${DOCDIR}/
59 gzip -9 build/${DOCDIR}/changelog.Debian
60 dpkg-deb --build build
61 mv build.deb ${DEB}
62 #rm -rf build
63 lintian ${DEB}
64
65 .PHONY: upload
66 upload: ${DEB}
67 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
68 mkdir -p /pve/${RELEASE}/extra
69 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
70 rm -f /pve/${RELEASE}/extra/Packages*
71 cp ${DEB} /pve/${RELEASE}/extra
72 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
73 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
74
75 .PHONY: clean
76 clean:
77 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
78 find . -name '*~' -exec rm {} ';'
79
80 .PHONY: distclean
81 distclean: clean