PACKAGE=libpve-u2f-server-perl
-BUILDSRC := $(PACKAGE)-$(DEB_VERSION_EPOCH_UPSTREAM)
+BUILDDIR := $(PACKAGE)-$(DEB_VERSION)
DESTDIR=
PREFIX=/usr
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)
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)