-PACKAGE=libpve-guest-common-perl
-PKGVER=2.0
-PKGREL=13
+include /usr/share/dpkg/pkg-info.mk
-DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
+PACKAGE=libpve-guest-common-perl
-DESTDIR=
+DEB=$(PACKAGE)_$(DEB_VERSION)_all.deb
+DSC=$(PACKAGE)_$(DEB_VERSION).dsc
-PERL5DIR=${DESTDIR}/usr/share/perl5
-DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE}
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
all:
+$(BUILDDIR):
+ rm -rf $@ $@.tmp
+ cp -a src $@.tmp
+ cp -a debian $@.tmp/
+ echo "git clone git://git.proxmox.com/git/pve-guest-common.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE
+ mv $@.tmp $@
+
.PHONY: deb
-deb: ${DEB}
-${DEB}:
- rm -rf build
- rsync -a * build
- cd build; dpkg-buildpackage -b -us -uc
- lintian ${DEB}
-
-install: PVE
- install -d ${PERL5DIR}/PVE
- install -m 0644 PVE/GuestHelpers.pm ${PERL5DIR}/PVE/
- install -m 0644 PVE/AbstractConfig.pm ${PERL5DIR}/PVE/
- install -m 0644 PVE/AbstractMigrate.pm ${PERL5DIR}/PVE/
- install -m 0644 PVE/ReplicationConfig.pm ${PERL5DIR}/PVE/
- install -m 0644 PVE/ReplicationState.pm ${PERL5DIR}/PVE/
- install -m 0644 PVE/Replication.pm ${PERL5DIR}/PVE/
- install -d ${PERL5DIR}/PVE/VZDump
- install -m 0644 PVE/VZDump/Plugin.pm ${PERL5DIR}/PVE/VZDump/
+deb: $(DEB)
+$(DEB): $(BUILDDIR)
+ cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
+ lintian $(DEB)
+
+.PHONY: dsc
+dsc:
+ $(MAKE) $(DSC)
+ lintian $(DSC)
+
+$(DSC): $(BUILDDIR)
+ cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d -nc
+
+sbuild: $(DSC)
+ sbuild $(DSC)
.PHONY: upload
-upload: ${DEB}
- tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB)
+ tar cf - $(DEB) | ssh repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)
distclean: clean
-
clean:
- rm -rf ./build *.deb *.changes *.buildinfo
+ rm -rf $(PACKAGE)-[0-9]*/ *.deb *.dsc *.changes *.buildinfo *.build $(PACKAGE)*.tar*
.PHONY: dinstall
-dinstall: ${DEB}
- dpkg -i ${DEB}
+dinstall: $(DEB)
+ dpkg -i $(DEB)