buildsys: no need to not pre-clean for source package
[pve-firewall.git] / Makefile
1 VERSION=3.0
2 PKGREL=18
3
4 PACKAGE=pve-firewall
5
6 BUILDDIR ?= ${PACKAGE}-${VERSION}
7
8 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
9 GITVERSION:=$(shell git rev-parse HEAD)
10
11 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
12 DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc
13 DEB2=${PACKAGE}-dbgsym_${VERSION}-${PKGREL}_${ARCH}.deb
14 DEBS=$(DEB) $(DEB2)
15
16 all: $(DEBS)
17
18 .PHONY: dinstall
19 dinstall: deb
20         dpkg -i $(DEBS)
21
22 ${BUILDDIR}:
23         rm -rf ${BUILDDIR}
24         rsync -a  src/ debian ${BUILDDIR}
25         echo "git clone git://git.proxmox.com/git/pve-firewall.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
26
27 .PHONY: deb
28 deb: $(DEBS)
29 $(DEB2): $(DEB)
30 $(DEB): ${BUILDDIR} check
31         cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
32         lintian ${DEBS}
33
34 .PHONY: dsc
35 dsc: ${DSC}
36 ${DSC}: ${BUILDDIR}
37         cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
38         lintian ${DSC}
39
40 .PHONY: check
41 check:
42         make -C test check
43
44 .PHONY: clean distclean
45 distclean: clean
46 clean:
47         make -C src clean
48         make -C test clean
49         rm -rf *~ debian/*~ example/*~ *.deb *.changes *.buildinfo ${BUILDDIR} ${PACKAGE}*.tar.gz *.dsc
50
51 .PHONY: upload
52 upload: $(DEBS)
53         tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}