X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Makefile;h=3ec8890a47ee84660618a132d6536c668705f6fe;hb=856c101e97b1ba45e87a33f44e678f6b3f186e34;hp=bfb268892456d9cbb9f21745fd4fd1f860de5cb2;hpb=a96a6fd40c5b64e6877c73e7c77e72f60e680c9f;p=pve-access-control.git diff --git a/Makefile b/Makefile index bfb2688..3ec8890 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ -VERSION=5.0 +include /usr/share/dpkg/pkg-info.mk +include /usr/share/dpkg/architecture.mk + PACKAGE=libpve-access-control -PKGREL=4 + + +BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM} DESTDIR= PREFIX=/usr @@ -10,15 +14,14 @@ MANDIR=${PREFIX}/share/man DOCDIR=${PREFIX}/share/doc/${PACKAGE} MAN1DIR=${MANDIR}/man1/ BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions/ +ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions/ export PERLDIR=${PREFIX}/share/perl5 -export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp) - -ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) GITVERSION:=$(shell cat .git/refs/heads/master) -DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb +DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb +DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc # this requires package pve-doc-generator export NOVIEW=1 @@ -34,8 +37,12 @@ pveum.bash-completion: PVE/CLI/pveum.pm perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_bash_completions();" >$@.tmp mv $@.tmp $@ +pveum.zsh-completion: PVE/CLI/pveum.pm + perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->generate_zsh_completions();" >$@.tmp + mv $@.tmp $@ + .PHONY: install -install: pveum.1 oathkeygen pveum.bash-completion +install: pveum.1 oathkeygen pveum.bash-completion pveum.zsh-completion install -d ${DESTDIR}${BINDIR} install -d ${DESTDIR}${SBINDIR} install -m 0755 pveum ${DESTDIR}${SBINDIR} @@ -44,31 +51,41 @@ install: pveum.1 oathkeygen pveum.bash-completion install -d ${DESTDIR}/${MAN1DIR} install -d ${DESTDIR}/${DOCDIR} install -m 0644 pveum.1 ${DESTDIR}/${MAN1DIR} - gzip -9 -n ${DESTDIR}/${MAN1DIR}/pveum.1 install -m 0644 -D pveum.bash-completion ${DESTDIR}${BASHCOMPLDIR}/pveum + install -m 0644 -D pveum.zsh-completion ${DESTDIR}${ZSHCOMPLDIR}/_pveum .PHONY: test test: perl -I. ./pveum verifyapi perl -I. -T -e "use PVE::CLI::pveum; PVE::CLI::pveum->verify_api();" + make -C test check + +${BUILDDIR}: + rm -rf ${BUILDDIR} + rsync -a * ${BUILDDIR} + echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE .PHONY: deb deb: ${DEB} -${DEB}: - rm -rf build - rsync -a * build - echo "git clone git://git.proxmox.com/git/pve-access-control.git\\ngit checkout ${GITVERSION}" >build/debian/SOURCE - cd build; dpkg-buildpackage -b -us -uc +${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} + .PHONY: upload upload: ${DEB} - tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH} + tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist buster --arch ${DEB_BUILD_ARCH} .PHONY: clean clean: + rm -rf ${BUILDDIR} make cleanup-docgen - rm -rf build *.deb *.buildinfo *.changes + rm -rf *.deb *.buildinfo *.changes ${PACKAGE}*.tar.gz *.dsc find . -name '*~' -exec rm {} ';' .PHONY: distclean