flush output file handle and send kill to whole process group
[pve-access-control.git] / Makefile
1 RELEASE=2.0
2
3 VERSION=1.0
4 PACKAGE=libpve-access-control
5 PKGREL=1
6
7 DESTDIR=
8 PREFIX=/usr
9 BINDIR=${PREFIX}/bin
10 SBINDIR=${PREFIX}/sbin
11 MANDIR=${PREFIX}/share/man
12 DOCDIR=${PREFIX}/share/doc
13 MAN1DIR=${MANDIR}/man1/
14 export PERLDIR=${PREFIX}/share/perl5
15
16 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
17 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
18
19 all: ${DEB}
20
21 .PHONY: dinstall
22 dinstall: deb
23 dpkg -i ${DEB}
24
25 .PHONY: install
26 install:
27 install -d ${DESTDIR}${BINDIR}
28 install -d ${DESTDIR}${SBINDIR}
29 install -m 0755 pveum ${DESTDIR}${SBINDIR}
30 make -C PVE install
31 perl -I. ./pveum verifyapi
32 install -d ${DESTDIR}/usr/share/man/man1
33 pod2man -n pveum -s 1 -r "proxmox 2.0" -c "Proxmox Documentation" <pveum | gzip -9 > ${DESTDIR}/usr/share/man/man1/pveum.1.gz
34
35 .PHONY: deb ${DEB}
36 deb ${DEB}:
37 rm -rf build
38 mkdir build
39 make DESTDIR=`pwd`/build install
40 install -d -m 0755 build/DEBIAN
41 sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >build/DEBIAN/control
42 install -D -m 0644 copyright build/${DOCDIR}/${PACKAGE}/copyright
43 install -m 0644 changelog.Debian build/${DOCDIR}/${PACKAGE}/
44 gzip -9 build/${DOCDIR}/${PACKAGE}/changelog.Debian
45 dpkg-deb --build build
46 mv build.deb ${DEB}
47 #rm -rf build
48 lintian ${DEB}
49
50 .PHONY: upload
51 upload: ${DEB}
52 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
53 mkdir -p /pve/${RELEASE}/extra
54 rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
55 rm -f /pve/${RELEASE}/extra/Packages*
56 cp ${DEB} /pve/${RELEASE}/extra
57 cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
58 umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
59
60 .PHONY: clean
61 clean:
62 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz
63 find . -name '*~' -exec rm {} ';'
64
65 .PHONY: distclean
66 distclean: clean