]> git.proxmox.com Git - pve-firewall.git/blobdiff - Makefile
makefile: convert to use simple parenthesis
[pve-firewall.git] / Makefile
index f35f1a9ddda41d0d3ba6d7a3beaa0b7a58464788..d83dff0c4c516e8221bac2e07ea95cc273e38319 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,14 @@
-VERSION=3.0
-PKGREL=18
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
 
 PACKAGE=pve-firewall
 
-BUILDDIR ?= ${PACKAGE}-${VERSION}
-
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 GITVERSION:=$(shell git rev-parse HEAD)
 
-DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
-DEB2=${PACKAGE}-dbgsym_${VERSION}-${PKGREL}_${ARCH}.deb
+DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
+DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
+DEB2=$(PACKAGE)-dbgsym_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
 DEBS=$(DEB) $(DEB2)
 
 all: $(DEBS)
@@ -18,17 +17,23 @@ all: $(DEBS)
 dinstall: 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
+$(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: $(DEBS)
 $(DEB2): $(DEB)
-$(DEB): ${BUILDDIR} check
-       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
-       lintian ${DEBS}
+$(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:
@@ -39,8 +44,8 @@ distclean: clean
 clean:
        make -C src clean
        make -C test clean
-       rm -rf *~ debian/*~ example/*~ *.deb *.changes *.buildinfo ${BUILDDIR} ${PACKAGE}-*.tar.gz
+       rm -rf *~ debian/*~ example/*~ *.deb *.changes *.buildinfo $(BUILDDIR) $(PACKAGE)*.tar.gz *.dsc
 
 .PHONY: upload
 upload: $(DEBS)
-       tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
+       tar cf - $(DEBS) | ssh repoman@repo.proxmox.com -- upload --product pve --dist bullseye --arch $(DEB_BUILD_ARCH)