[pve-devel] [PATCH manager 2/5] build: pull REPOID into top-level Makefile
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed Oct 17 13:02:02 CEST 2018
otherwise it is missing when building in a clean chroot via a generated
source packages.
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
note: this is not strictly needed at the moment
Makefile | 4 ++++
PVE/Makefile | 2 --
debian/rules | 4 ++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index f6e2d288..8d462915 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,9 @@ SUBDIRS = aplinfo PVE bin www services configs network-hooks test
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
GITVERSION:=$(shell git rev-parse HEAD)
+# possibly set via debian/rules(.env)
+REPOID?=$(shell git rev-parse --short=8 HEAD)
+
DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
all: ${SUBDIRS}
@@ -28,6 +31,7 @@ $(DEB):
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}
diff --git a/PVE/Makefile b/PVE/Makefile
index ad460458..33e62f49 100644
--- a/PVE/Makefile
+++ b/PVE/Makefile
@@ -17,8 +17,6 @@ PERLSOURCE = \
all: pvecfg.pm ${SUBDIRS}
set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i; done
-REPOID=$(shell git rev-parse --short=8 HEAD)
-
pvecfg.pm: pvecfg.pm.in
sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp
mv $@.tmp $@
diff --git a/debian/rules b/debian/rules
index 048483aa..bafb3b12 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,9 @@
#!/usr/bin/make -f
+include debian/rules.env
+
+export REPOID=${REPOID_GENERATED}
+
override_dh_compress:
dh_compress -Xaplinfo.dat
--
2.19.1
More information about the pve-devel
mailing list