bump version to 4.0-3
[pve-access-control.git] / Makefile
1 RELEASE=4.0
2
3 VERSION=4.0
4 PACKAGE=libpve-access-control
5 PKGREL=3
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 oathkeygen
39         install -d ${DESTDIR}${BINDIR}
40         install -d ${DESTDIR}${SBINDIR}
41         install -m 0755 pveum ${DESTDIR}${SBINDIR}
42         install -m 0755 oathkeygen ${DESTDIR}${BINDIR}
43         make -C PVE install
44         perl -I. ./pveum verifyapi 
45         install -d ${DESTDIR}/usr/share/man/man1
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}
49
50 .PHONY: deb ${DEB}
51 deb ${DEB}:
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
57         echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >  build/${DOCDIR}/SOURCE
58         install -m 0644 triggers build/DEBIAN
59         install -D -m 0644 copyright build/${DOCDIR}/copyright
60         install -m 0644 changelog.Debian build/${DOCDIR}/
61         gzip -9 build/${DOCDIR}/changelog.Debian
62         dpkg-deb --build build  
63         mv build.deb ${DEB}
64         #rm -rf build
65         lintian ${DEB}
66
67 .PHONY: upload
68 upload: ${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
78 clean:  
79         rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
80         find . -name '*~' -exec rm {} ';'
81
82 .PHONY: distclean
83 distclean: clean