iimported from svn 'pve-access-control/trunk'
[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 debian
38         mkdir debian
39         make DESTDIR=${CURDIR}/debian install
40         install -d -m 0755 debian/DEBIAN
41         sed -e s/@@VERSION@@/${VERSION}/ -e s/@@PKGRELEASE@@/${PKGREL}/ -e s/@@ARCH@@/${ARCH}/ <control.in >debian/DEBIAN/control
42         install -D -m 0644 copyright debian/${DOCDIR}/${PACKAGE}/copyright
43         install -m 0644 changelog.Debian debian/${DOCDIR}/${PACKAGE}/
44         gzip -9 debian/${DOCDIR}/${PACKAGE}/changelog.Debian
45         install -m 0644 ChangeLog debian/${DOCDIR}/${PACKAGE}/changelog
46         gzip -9 debian/${DOCDIR}/${PACKAGE}/changelog
47         dpkg-deb --build debian 
48         mv debian.deb ${DEB}
49         #rm -rf debian
50         lintian ${DEB}
51
52 .PHONY: upload
53 upload: ${DEB}
54         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
55         mkdir -p /pve/${RELEASE}/extra
56         rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
57         rm -f /pve/${RELEASE}/extra/Packages*
58         cp ${DEB} /pve/${RELEASE}/extra
59         cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
60         umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
61
62 .PHONY: clean
63 clean:  
64         rm -rf debian *~ *.deb ${PACKAGE}-*.tar.gz
65         find . -name '*~' -exec rm {} ';'
66
67 .PHONY: distclean
68 distclean: clean