aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-08 15:25:47 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 11:33:40 +0100
commit873eb8fdd5608f69da668165471414a0dcde1f75 (patch)
tree0cfa506cd76e0498ea67530eca0ad67372e33b35
parent95ac7011d127c1f7b816393e23187c5e5bae1307 (diff)
Packaging: Set project version using command-line
When packaging, the build environment doesn't clone the git repository but instead use an archive and so we lose the git repository's information. This is a workaround to set the project version using the packaging system. Change-Id: I3e8edc197a12f455f4f1cc24bc452feb146bab6c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--conf.d/packaging/deb/debian.rules3
-rw-r--r--conf.d/packaging/rpm/agl-app-afb-test.spec2
2 files changed, 3 insertions, 2 deletions
diff --git a/conf.d/packaging/deb/debian.rules b/conf.d/packaging/deb/debian.rules
index 4637103..8209cd9 100644
--- a/conf.d/packaging/deb/debian.rules
+++ b/conf.d/packaging/deb/debian.rules
@@ -2,13 +2,14 @@
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+export VERSION=$(shell grep -E "^Version" ../*dsc | sed -r 's/^.*: (.*)-.*/\1/')
%:
bash /etc/profile.d/AGL-app-framework-binder.sh
dh $@
override_dh_auto_configure:
- dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/opt/AGL -DCMAKE_INSTALL_LIBDIR:PATH=lib/${DEB_HOST_MULTIARCH}
+ dh_auto_configure -- -DVERSION=${VERSION} -DCMAKE_INSTALL_PREFIX=/opt/AGL -DCMAKE_INSTALL_LIBDIR:PATH=lib/${DEB_HOST_MULTIARCH}
override_dh_auto_install:
dh_auto_install --destdir=/usr/src/packages/BUILD/debian/tmp
diff --git a/conf.d/packaging/rpm/agl-app-afb-test.spec b/conf.d/packaging/rpm/agl-app-afb-test.spec
index c1df845..408751a 100644
--- a/conf.d/packaging/rpm/agl-app-afb-test.spec
+++ b/conf.d/packaging/rpm/agl-app-afb-test.spec
@@ -47,7 +47,7 @@ afb-test is a test framework made to test other binding.
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig
[ ! -d build ] && mkdir build
cd build
-cmake -DCMAKE_BUILD_TYPE=DEBUG ..
+cmake -DCMAKE_BUILD_TYPE=DEBUG -DVERSION=%{version} ..
%__make %{?_smp_mflags}
%install