]> git.proxmox.com Git - libpve-u2f-server-perl.git/blobdiff - Makefile
buildsys: add sbuild convenience target
[libpve-u2f-server-perl.git] / Makefile
index 38adc7e5ebc51120249a403334b586c98fb3ee6e..91a3cafc67852ef7aca950a085468ff7ee761129 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ include /usr/share/dpkg/architecture.mk
 
 PACKAGE=libpve-u2f-server-perl
 
-BUILDSRC := $(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM)
+BUILDDIR := $(PACKAGE)-$(DEB_VERSION)
 
 DESTDIR=
 PREFIX=/usr
@@ -22,8 +22,8 @@ CFLAGS := -shared -fPIC -O2 -Werror -Wtype-limits -Wall -Wl,-z,relro \
 CFLAGS += `pkg-config --cflags u2f-server`
 LIBS += `pkg-config --libs u2f-server`
 
-DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_$(DEB_BUILD_ARCH).deb
-DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
+DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
+DSC=$(PACKAGE)_$(DEB_VERSION).dsc
 
 GITVERSION:=$(shell git rev-parse HEAD)
 
@@ -48,34 +48,39 @@ install: PVE/U2F.pm U2F.so
        install -D -m 0644 PVE/U2F.pm $(DESTDIR)$(PERLDIR)/PVE/U2F.pm
        install -D -m 0644 -s U2F.so $(DESTDIR)$(PERLSODIR)/PVE/U2F/U2F.so
 
-.PHONY: $(BUILDSRC)
-$(BUILDSRC):
-       rm -rf $(BUILDSRC)
-       mkdir $(BUILDSRC)
-       rsync -a debian Makefile PVE U2F.xs $(BUILDSRC)/
-       echo "git clone git://git.proxmox.com/git/libpve-u2f-server-perl.git\\ngit checkout $(GITVERSION)" > $(BUILDSRC)/debian/SOURCE
+$(BUILDDIR):
+       rm -rf $@ $@.tmp
+       mkdir $@.tmp
+       cp -a debian Makefile PVE U2F.xs base64.h $@.tmp/
+       echo "git clone git://git.proxmox.com/git/libpve-u2f-server-perl.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
+       mv $@.tmp $@
 
 .PHONY: deb
 deb: $(DEB)
-$(DEB): $(BUILDSRC)
-       cd $(BUILDSRC); dpkg-buildpackage -b -us -uc
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
        lintian $(DEB)
 
 .PHONY: dsc
 dsc: $(DSC)
-$(DSC): $(BUILDSRC)
-       cd $(BUILDSRC); dpkg-buildpackage -S -us -uc -d -nc
+       rm -rf $(BUILDDIR) $(DSC)
+       $(MAKE) $(DSC)
        lintian $(DSC)
 
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
+
+sbuild: $(DSC)
+       sbuild $(DSC)
+
 .PHONY: clean
 clean:
-       rm -rf *~ ${BUILDSRC} *.deb *.changes *.buildinfo *.dsc *.tar.gz
-       find . -name '*~' -exec rm {} ';'
+       rm -rf *~ $(PACKAGE)-[0-9]*/ *.deb *.changes *.buildinfo *.build *.dsc $(PACKAGE)*.tar*
 
 .PHONY: distclean
 distclean: clean
 
 
 .PHONY: upload
-upload: $$DEB)
-       tar cf - $(DEB) | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch $(ARCH)
+upload: $(DEB)
+       tar cf - $(DEB) | ssh repoman@repo.proxmox.com -- upload --product pve --dist bullseye --arch $(DEB_HOST_ARCH)