-VERSION=2.0
-PKGREL=33
+VERSION=3.0
+PKGREL=19
PACKAGE=pve-firewall
-PREFIX=/usr
-BINDIR=${PREFIX}/bin
-SBINDIR=${PREFIX}/sbin
-MANDIR=${PREFIX}/share/man
-DOCDIR=${PREFIX}/share/doc
-MAN1DIR=${MANDIR}/man1/
-PERLDIR=${PREFIX}/share/perl5
+BUILDDIR ?= ${PACKAGE}-${VERSION}
-ARCH=amd64
-GITVERSION:=$(shell cat .git/refs/heads/master)
+ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+GITVERSION:=$(shell git rev-parse HEAD)
DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
+DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc
+DEB2=${PACKAGE}-dbgsym_${VERSION}-${PKGREL}_${ARCH}.deb
+DEBS=$(DEB) $(DEB2)
-all: ${DEB}
+all: $(DEBS)
.PHONY: dinstall
dinstall: deb
- dpkg -i ${DEB}
+ dpkg -i $(DEBS)
+${BUILDDIR}:
+ rm -rf ${BUILDDIR}
+ rsync -a src/ debian ${BUILDDIR}
+ echo "git clone git://git.proxmox.com/git/pve-firewall.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
.PHONY: deb
-deb: ${DEB}
-${DEB}: check
- rm -rf build
- rsync -a src/ build
- rsync -a debian/ build/debian
- echo "git clone git://git.proxmox.com/git/pve-firewall.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
- # install
- cd build; dpkg-buildpackage -rfakeroot -b -us -uc
- lintian ${DEB}
+deb: $(DEBS)
+$(DEB2): $(DEB)
+$(DEB): ${BUILDDIR} check
+ cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
+ lintian ${DEBS}
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+ cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d
+ lintian ${DSC}
.PHONY: check
-check:
+check:
make -C test check
-.PHONY: clean
-clean:
+.PHONY: clean distclean
+distclean: clean
+clean:
make -C src clean
make -C test clean
- rm -rf *~ debian/*~ example/*~ *.deb *.changes build ${PACKAGE}-*.tar.gz
-
-.PHONY: distclean
-distclean: clean
-
+ rm -rf *~ debian/*~ example/*~ *.deb *.changes *.buildinfo ${BUILDDIR} ${PACKAGE}*.tar.gz *.dsc
.PHONY: upload
-upload: ${DEB}
- tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
+upload: $(DEBS)
+ tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}