remove generated files in clean target
[pve-access-control.git] / Makefile
CommitLineData
2c3a6c0a
DM
1RELEASE=2.0
2
3VERSION=1.0
4PACKAGE=libpve-access-control
1fba27e0 5PKGREL=3
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 $@
28 cat $<|pod2man -n $* -s 1 -r ${VERSION} -c "Proxmox Documentation"|gzip -c9 >$@
29
30pveum.1.pod: pveum
31 perl -I. ./pveum printmanpod >$@
32
2c3a6c0a 33.PHONY: install
362fe4c6 34install: pveum.1.pod pveum.1.gz
2c3a6c0a
DM
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
362fe4c6
DM
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}
2c3a6c0a
DM
44
45.PHONY: deb ${DEB}
46deb ${DEB}:
151acc1f
DM
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
362fe4c6
DM
52 install -D -m 0644 copyright build/${DOCDIR}/copyright
53 install -m 0644 changelog.Debian build/${DOCDIR}/
54 gzip -9 build/${DOCDIR}/changelog.Debian
151acc1f
DM
55 dpkg-deb --build build
56 mv build.deb ${DEB}
57 #rm -rf build
2c3a6c0a
DM
58 lintian ${DEB}
59
60.PHONY: upload
61upload: ${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
71clean:
eb09b155 72 rm -rf build *~ *.deb ${PACKAGE}-*.tar.gz pveum.1.pod pveum.1.gz
2c3a6c0a
DM
73 find . -name '*~' -exec rm {} ';'
74
75.PHONY: distclean
76distclean: clean