f9cebd680cae7a8ec44a5905d19696059744980b
[pve-access-control.git] / Makefile
1 RELEASE=2.0
2
3 VERSION=1.0
4 PACKAGE=libpve-access-control
5 PKGREL=12
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 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
19
20 all: ${DEB}
21
22 .PHONY: dinstall
23 dinstall: deb
24         dpkg -i ${DEB}
25
26 %.1.gz: %.1.pod
27         rm -f $@
28         cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@.tmp
29         mv $@.tmp $@
30
31 pveum.1.pod: pveum
32         perl -I. ./pveum printmanpod >$@.tmp
33         mv $@.tmp $@
34
35 .PHONY: install
36 install: pveum.1.pod pveum.1.gz
37         install -d ${DESTDIR}${BINDIR}
38         install -d ${DESTDIR}${SBINDIR}
39         install -m 0755 pveum ${DESTDIR}${SBINDIR}
40         make -C PVE install
41         perl -I. ./pveum verifyapi 
42         install -d ${DESTDIR}/usr/share/man/man1
43         install -d ${DESTDIR}${PODDIR}
44         install -m 0644 pveum.1.gz ${DESTDIR}/usr/share/man/man1/
45         install -m 0644 pveum.1.pod ${DESTDIR}/${PODDIR}
46
47 .PHONY: deb ${DEB}
48 deb ${DEB}:
49         rm -rf build
50         mkdir build
51         make DESTDIR=`pwd`/build install
52         install -d -m 0755 build/DEBIAN
53         sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
54         install -D -m 0644 copyright build/${DOCDIR}/copyright
55         install -m 0644 changelog.Debian build/${DOCDIR}/
56         gzip -9 build/${DOCDIR}/changelog.Debian
57         dpkg-deb --build build  
58         mv build.deb ${DEB}
59         #rm -rf build
60         lintian ${DEB}
61
62 .PHONY: upload
63 upload: ${DEB}
64         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
65         mkdir -p /pve/${RELEASE}/extra
66         rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
67         rm -f /pve/${RELEASE}/extra/Packages*
68         cp ${DEB} /pve/${RELEASE}/extra
69         cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
70         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
71
72 .PHONY: clean
73 clean:  
74         rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
75         find . -name '*~' -exec rm {} ';'
76
77 .PHONY: distclean
78 distclean: clean