pve-manager/Makefile
Thomas Lamprecht b597d23d35 pvecfg: adapt version and release semantic
Wit commit bcef9bde68 we switched over
to using the dpkg-dev provided helpers to set package version,
architecture and such in the buildsystem.

But unlike other repositories we used the version also for giving it
back over the API through the during build generated PVE::pvecfg
module, which wasn't fully updated to the new style.

This patch does that, and also cleans up semantics a bit, the
following two changed:

release is now the Debian release, instead of the "package release"
(i.e., the -X part of a full package version).
version is now simply the full (pve-manager) version, e.g., 6.0-1 or
the currently for testing used 6.0-0+1

This allows to do everything we used this information for even in a
slightly easier way (no  string concat needed anymore), and fits also
with the terminology we often used in our public channels (mailing
lists, forum, website)

Remove some cruft as we touch things.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-26 16:11:43 +02:00

70 lines
2.0 KiB
Makefile

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
include defines.mk
export PVERELEASE=${DEB_VERSION_UPSTREAM}
export VERSION=${DEB_VERSION_UPSTREAM_REVISION}
DESTDIR=
SUBDIRS = aplinfo PVE bin www services configs network-hooks test
GITVERSION:=$(shell git rev-parse HEAD)
# possibly set via debian/rules(.env)
REPOID?=$(shell git rev-parse --short=8 HEAD)
DEB=${PACKAGE}_${VERSION}_${DEB_BUILD_ARCH}.deb
all: ${SUBDIRS}
set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i; done
.PHONY: check
check: bin test
${MAKE} -C bin check
${MAKE} -C test check
.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}
.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 buster
.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
.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