buildsys: use dpkg-architecture
[pve-firewall.git] / Makefile
1 VERSION=2.0
2 PKGREL=33
3
4 PACKAGE=pve-firewall
5
6 PREFIX=/usr
7 BINDIR=${PREFIX}/bin
8 SBINDIR=${PREFIX}/sbin
9 MANDIR=${PREFIX}/share/man
10 DOCDIR=${PREFIX}/share/doc
11 MAN1DIR=${MANDIR}/man1/
12 PERLDIR=${PREFIX}/share/perl5
13
14 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
15 GITVERSION:=$(shell cat .git/refs/heads/master)
16
17 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
18
19 all: ${DEB}
20
21 .PHONY: dinstall
22 dinstall: deb
23 dpkg -i ${DEB}
24
25
26 .PHONY: deb
27 deb: ${DEB}
28 ${DEB}: check
29 rm -rf build
30 rsync -a src/ build
31 rsync -a debian/ build/debian
32 echo "git clone git://git.proxmox.com/git/pve-firewall.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
33 # install
34 cd build; dpkg-buildpackage -rfakeroot -b -us -uc
35 lintian ${DEB}
36
37 .PHONY: check
38 check:
39 make -C test check
40
41 .PHONY: clean
42 clean:
43 make -C src clean
44 make -C test clean
45 rm -rf *~ debian/*~ example/*~ *.deb *.changes build ${PACKAGE}-*.tar.gz
46
47 .PHONY: distclean
48 distclean: clean
49
50
51 .PHONY: upload
52 upload: ${DEB}
53 tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload