X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Makefile;h=2829539594829afaa6075c200e4c8448bb97a686;hb=6e7cef49231efa0f8919ed75ffba03afb96e3c62;hp=8d462915e3db552dd162b670d6d499751a15cd56;hpb=fb992042c66f62ee9e0581be3b17e2dbcb256f61;p=pve-manager.git diff --git a/Makefile b/Makefile index 8d462915..28295395 100644 --- a/Makefile +++ b/Makefile @@ -1,65 +1,77 @@ +include /usr/share/dpkg/default.mk include defines.mk -export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp) +export PVERELEASE = $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d. -f1-2) +export VERSION = $(DEB_VERSION_UPSTREAM_REVISION) -DESTDIR= +BUILDDIR = $(PACKAGE)-$(DEB_VERSION_UPSTREAM) + +DSC=$(PACKAGE)_$(DEB_VERSION).dsc +DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb +DESTDIR= SUBDIRS = aplinfo PVE bin www services configs network-hooks test -ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -GITVERSION:=$(shell git rev-parse HEAD) +all: $(SUBDIRS) + set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done -# possibly set via debian/rules(.env) -REPOID?=$(shell git rev-parse --short=8 HEAD) +.PHONY: check +check: bin test www + $(MAKE) -C bin check + $(MAKE) -C test check + $(MAKE) -C www check -DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb +GITVERSION:=$(shell git rev-parse --short=16 HEAD) +$(BUILDDIR): + rm -rf $@ $@.tmp + mkdir $@.tmp + rsync -a * $@.tmp + echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE + echo "REPOID_GENERATED=$(GITVERSION)" > $@.tmp/debian/rules.env + mv $@.tmp $@ -all: ${SUBDIRS} - set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i; done +.PHONY: deb dsc +deb: $(DEB) +$(DEB): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -b -us -uc + lintian $(DEB) -check: - ${MAKE} -C test check +dsc: + rm -rf $(BUILDDIR) $(DSC) + $(MAKE) $(DSC) + lintian $(DSC) +$(DSC): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d -.PHONY: dinstall -dinstall: ${DEB} - dpkg -i ${DEB} - -.PHONY: deb -deb: $(DEB) -$(DEB): - rm -rf dest - mkdir dest - rsync -a * dest - echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout ${GITVERSION}" > dest/debian/SOURCE - echo "REPOID_GENERATED=${REPOID}" > dest/debian/rules.env - cd dest; dpkg-buildpackage -b -us -uc - # supress lintian error: statically-linked-binary usr/bin/pvemailforward - lintian -X binaries ${DEB} +sbuild: $(DSC) + sbuild $< .PHONY: upload -upload: ${DEB} check - # check if working directory is clean - git diff --exit-code --stat && git diff --exit-code --stat --staged - tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pve --dist stretch +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) +upload: $(DEB) + tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST) .PHONY: install install: vzdump-hook-script.pl - install -d -m 0700 -o www-data -g www-data ${DESTDIR}/var/log/pveproxy - install -d ${DOCDIR}/examples - install -d ${DESTDIR}/var/lib/${PACKAGE} - install -d ${DESTDIR}/var/lib/vz/images - install -d ${DESTDIR}/var/lib/vz/template/cache - install -d ${DESTDIR}/var/lib/vz/template/iso - install -d ${DESTDIR}/var/lib/vz/template/qemu - install -m 0644 vzdump-hook-script.pl ${DOCDIR}/examples/vzdump-hook-script.pl - install -m 0644 spice-example-sh ${DOCDIR}/examples/spice-example-sh - set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done + install -d -m 0700 -o www-data -g www-data $(DESTDIR)/var/log/pveproxy + install -d $(DOCDIR)/examples + install -d $(DESTDIR)/var/lib/$(PACKAGE) + install -d $(DESTDIR)/var/lib/vz/images + install -d $(DESTDIR)/var/lib/vz/template/cache + install -d $(DESTDIR)/var/lib/vz/template/iso + install -m 0644 vzdump-hook-script.pl $(DOCDIR)/examples/vzdump-hook-script.pl + install -m 0644 spice-example-sh $(DOCDIR)/examples/spice-example-sh + set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done .PHONY: distclean distclean: clean .PHONY: clean clean: - set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done - find . -name '*~' -exec rm {} ';' - rm -rf dest country.dat *.deb *.buildinfo *.changes ca-tmp + set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done + rm -f $(PACKAGE)*.tar* country.dat *.deb *.dsc *.build *.buildinfo *.changes + rm -rf dest $(PACKAGE)-[0-9]*/ + +.PHONY: dinstall +dinstall: $(DEB) + dpkg -i $(DEB)