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