add new environment type 'ha'
[pve-access-control.git] / Makefile
CommitLineData
2c3a6c0a
DM
1RELEASE=2.0
2
3VERSION=1.0
4PACKAGE=libpve-access-control
e42eedbc 5PKGREL=4
2c3a6c0a
DM
6
7DESTDIR=
8PREFIX=/usr
9BINDIR=${PREFIX}/bin
10SBINDIR=${PREFIX}/sbin
11MANDIR=${PREFIX}/share/man
362fe4c6
DM
12DOCDIR=${PREFIX}/share/doc/${PACKAGE}
13PODDIR=${DOCDIR}/pod
2c3a6c0a
DM
14MAN1DIR=${MANDIR}/man1/
15export PERLDIR=${PREFIX}/share/perl5
16
17ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
18DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
19
20all: ${DEB}
21
22.PHONY: dinstall
23dinstall: deb
24 dpkg -i ${DEB}
25
362fe4c6
DM
26%.1.gz: %.1.pod
27 rm -f $@
dcfaabd7
DM
28 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@.tmp
29 mv $@.tmp $@
362fe4c6
DM
30
31pveum.1.pod: pveum
dcfaabd7
DM
32 perl -I. ./pveum printmanpod >$@.tmp
33 mv $@.tmp $@
362fe4c6 34
2c3a6c0a 35.PHONY: install
362fe4c6 36install: pveum.1.pod pveum.1.gz
2c3a6c0a
DM
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
362fe4c6
DM
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}
2c3a6c0a
DM
46
47.PHONY: deb ${DEB}
48deb ${DEB}:
151acc1f
DM
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
362fe4c6
DM
54 install -D -m 0644 copyright build/${DOCDIR}/copyright
55 install -m 0644 changelog.Debian build/${DOCDIR}/
56 gzip -9 build/${DOCDIR}/changelog.Debian
151acc1f
DM
57 dpkg-deb --build build
58 mv build.deb ${DEB}
59 #rm -rf build
2c3a6c0a
DM
60 lintian ${DEB}
61
62.PHONY: upload
63upload: ${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
73clean:
eb09b155 74 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
2c3a6c0a
DM
75 find . -name '*~' -exec rm {} ';'
76
77.PHONY: distclean
78distclean: clean