X-Git-Url: https://git.proxmox.com/?p=pve-zsync.git;a=blobdiff_plain;f=Makefile;h=3000209732545da184ae33ba104662c20653e89d;hp=bf813b9045a64894f7a7d95c252572a0dfcff41f;hb=HEAD;hpb=114df8780046c93372788c2317e9a3557939c03f diff --git a/Makefile b/Makefile index bf813b9..ba995ff 100644 --- a/Makefile +++ b/Makefile @@ -1,52 +1,62 @@ -RELEASE=5.2 +include /usr/share/dpkg/pkg-info.mk -VERSION=1.7 PACKAGE=pve-zsync -PKGREL=1 DESTDIR= -SBINDIR=${DESTDIR}/usr/sbin -MAN8DIR=${DESTDIR}/usr/share/man/man8 -DOCDIR=${DESTDIR}/usr/share/doc/${PACKAGE} -WORKDIR=${DESTDIR}/var/lib/pve-zsync +SBINDIR=$(DESTDIR)/usr/sbin +MAN8DIR=$(DESTDIR)/usr/share/man/man8 +DOCDIR=$(DESTDIR)/usr/share/doc/$(PACKAGE) +WORKDIR=$(DESTDIR)/var/lib/pve-zsync -BUILDDIR=build +BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) -ARCH=all GITVERSION:=$(shell git rev-parse HEAD) -DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb +DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb +DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc all: .PHONY: dinstall dinstall: deb - dpkg -i ${DEB} + dpkg -i $(DEB) pve-zsync.8: pve-zsync - ./pve-zsync printpod | pod2man -c "Proxmox Documentation" -s 8 -r ${RELEASE} -n pve-zsync - pve-zsync.8 + ./pve-zsync printpod | pod2man -c "Proxmox Documentation" -s 8 -r $(DEB_VERSION_UPSTREAM) -n pve-zsync - pve-zsync.8 .PHONY: install install: pve-zsync.8 - install -d ${SBINDIR} - install -m 0755 pve-zsync ${SBINDIR}/pve-zsync - install -d ${WORKDIR} - install -d ${MAN8DIR} - install -m 0644 pve-zsync.8 ${MAN8DIR}/pve-zsync.8 - install -d ${DOCDIR} - echo "git clone git://git.proxmox.com/git/pve-zsync.git\\ngit checkout ${GITVERSION}" > ${DOCDIR}/SOURCE + install -d $(SBINDIR) + install -m 0755 pve-zsync $(SBINDIR)/pve-zsync + install -d $(WORKDIR) + install -d $(MAN8DIR) + install -m 0644 pve-zsync.8 $(MAN8DIR)/pve-zsync.8 + install -d $(DOCDIR) + +$(BUILDDIR): + rm -rf $@.tmp $@ + rsync -a * $@.tmp + echo "git clone git://git.proxmox.com/git/pve-zsync.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE + mv $@.tmp $@ .PHONY: deb -deb: ${DEB} -${DEB}: - rm -rf ${BUILDDIR} - rsync -a * build - cd build; dpkg-buildpackage -b -us -uc - lintian ${DEB} +deb: $(DEB) +$(DEB): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -b -us -uc + lintian $(DEB) + +.PHONY: dsc +dsc: $(DSC) +$(DSC):$(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d + lintian $(DSC) + +sbuild: $(DSC) + sbuild $(DSC) .PHONY: clean clean: - rm -rf ${BUILDDIR} *.deb *.buildinfo *.changes + rm -rf $(PACKAGE)-[0-9]*/ *.deb *.dsc $(PACKAGE)*.tar.?z *.build *.buildinfo *.changes find . -name '*~' -exec rm {} ';' .PHONY: distclean @@ -54,5 +64,6 @@ distclean: clean .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)