diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-08-06 10:58:30 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-08-06 12:02:00 +0200 |
commit | aef62b0c77a00e5cbb960fd4eb61c8e47db50d0b (patch) | |
tree | 70299b35bebbc901291a7fcaaa94dfb36bd5088e /scripts/osmocom-latest-packages.sh | |
parent | eb844d933a691c152db061a5cd5768e9fa0c5711 (diff) |
osmocom packages: Ensure PACKAGE_VERSION is set correctly
At the "autorecon -fi" stage, Osmocom programs either need the .git
directory peresent, or a .tarball-version file in order to determine
the exact source code version.
Normally, "make dist" exists exactly for this purpose: It runs
git-version-gen and saves the result to .tarball-version, and we then
include this file in the .tar.gz we generate.
However, as the nightly paackaging scripts use git-buildpackage, it
bypasses the "make dist" logic and hence we need to
1) manually generate the .tarball-version file
2) copy it over to the directory specified as --git-export-dir
This way, the .tarball-version is inside the tar.xz generated by gbp,
and autoreconf then has something to use as PACKAGE_VERSION.
This commit fixes "UNKNOWN-dirty" in .pc files of libraries, as well
as in "show version" commands on the vty.
Closes: OS#3449
Change-Id: I76e3713f0b01a6110091ff90e8e53aa79533c374
Diffstat (limited to 'scripts/osmocom-latest-packages.sh')
-rwxr-xr-x | scripts/osmocom-latest-packages.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh index e8d61a3..3d4f340 100755 --- a/scripts/osmocom-latest-packages.sh +++ b/scripts/osmocom-latest-packages.sh @@ -34,7 +34,10 @@ build() { git fetch VER=$(git tag -l --sort=v:refname | grep "^[0-9]*.[0-9]*.[0-9]*$" | tail -n 1) git checkout -f -B "$VER" "refs/tags/$VER" - gbp buildpackage -d -S -uc -us "--git-export-dir=$output" "--git-debian-branch=$VER" + test -x ./git-version-gen && ./git-version-gen . > .tarball-version 2>/dev/null + gbp buildpackage -d -S -uc -us "--git-export-dir=$output" "--git-debian-branch=$VER" \ + --git-ignore-new \ + --git-postexport='cp $GBP_GIT_DIR/../.tarball-version $GBP_TMP_DIR/' if [ ! -d "$TOP/$PROJ/$1" ] ; then # creating a new package is different from using old ones |