X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=blobdiff_plain;f=Makefile;h=c5a6158f7a17039ce72442d1a3ecffaf2a158faf;hp=7e99240f19ce598c899ad4d1a195071b9eaaa06f;hb=HEAD;hpb=115b38dc46c3dd275f43959415aee6d79ea0381c diff --git a/Makefile b/Makefile index 7e99240..e5d1634 100644 --- a/Makefile +++ b/Makefile @@ -1,43 +1,46 @@ -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) GITVERSION:=$(shell git rev-parse HEAD) -DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb -DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc -DEB2=${PACKAGE}-dbgsym_${VERSION}-${PKGREL}_${ARCH}.deb +DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb +DSC=$(PACKAGE)_$(DEB_VERSION).dsc +DEB2=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb DEBS=$(DEB) $(DEB2) all: $(DEBS) .PHONY: dinstall -dinstall: deb - dpkg -i $(DEBS) +dinstall: $(DEB) + dpkg -i $< -${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) + cd $(BUILDDIR); dpkg-buildpackage -b -us -uc + lintian $(DEBS) .PHONY: dsc -dsc: ${DSC} -${DSC}: ${BUILDDIR} - cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d -nc - lintian ${DSC} +dsc: + rm -rf $(DSC) $(BUILDDIR) + $(MAKE) $(DSC) + lintian $(DSC) + +$(DSC): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d + +sbuild: $(DSC) + sbuild $(DSC) -.PHONY: check check: make -C test check @@ -46,8 +49,9 @@ distclean: clean clean: make -C src clean make -C test clean - rm -rf *~ debian/*~ example/*~ *.deb *.changes *.buildinfo ${BUILDDIR} ${PACKAGE}*.tar.gz *.dsc + rm -rf *.deb *.dsc *.changes *.build *.buildinfo $(PACKAGE)-[0-9]*/ $(PACKAGE)*.tar* .PHONY: upload +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) 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 $(UPLOAD_DIST) --arch $(DEB_HOST_ARCH)