Commit dad05b7e authored by Vasilis Tsiligiannis's avatar Vasilis Tsiligiannis

debian: Support GNU Radio style versions

Signed-off-by: Vasilis Tsiligiannis's avatarVasilis Tsiligiannis <[email protected]>
parent 83657701
Pipeline #153609482 passed with stages
in 37 minutes and 42 seconds
......@@ -86,8 +86,6 @@ debian:
dch -b -M -v "${PACKAGE_VERSION}-1" "Bump to version '${PACKAGE_VERSION}-1'"
dch -r -m ""
}
- |
[ -n "$CI_COMMIT_TAG" ] || sed -i '/0001-remove-git-maint-version.patch/ d' debian/patches/series
- gbp buildpackage -us -uc --git-upstream-tag='HEAD' --git-ignore-branch --git-ignore-new
- mkdir artifacts
- cp -a ../*.{deb,debian.tar.xz,dsc,build,buildinfo,changes,orig.tar.gz} artifacts/
......
......@@ -43,10 +43,14 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
# Set the version information here
set(VERSION_MAJOR 2)
set(VERSION_API 1)
set(VERSION_ABI 2)
set(VERSION_PATCH git)
if(NOT VERSION_MAJOR OR NOT VERSION_API OR NOT VERSION_ABI)
set(VERSION_MAJOR 2)
set(VERSION_API 1)
set(VERSION_ABI 2)
endif()
if(NOT VERSION_PATCH)
set(VERSION_PATCH git)
endif()
cmake_policy(SET CMP0011 NEW)
......
Index: gr-satnogs/CMakeLists.txt
===================================================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,4 +46,4 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
-set(VERSION_PATCH git)
+set(VERSION_PATCH 0)
cmake_policy(SET CMP0011 NEW)
0001-remove-git-maint-version.patch
......@@ -4,14 +4,25 @@ export DEB_HOST_MULTIARCH
DEB_DEBIAN_DIR=$(dir $(firstword $(MAKEFILE_LIST)))
VER=$(shell dpkg-parsechangelog -l$(DEB_DEBIAN_DIR)/changelog \
| sed -rne 's,^Version: ([^-]+).*,\1,p')
GITREV=$(shell echo $(VER) | sed -rne 's,^[0-9]+\.[0-9]+.*\+[0-9]+\+g([0-f]{8})$$,\1,p' -e 's,^([0-9]+\.[0-9]+(\.[0-9]+)?)$$,v\1,p')
VER_MAJOR=$(shell echo $(VER) | sed -rne 's,^([0-9]+)(\.[0-9]+){3}(\+.*)?$$,\1,p')
VER_API=$(shell echo $(VER) | sed -rne 's,^[0-9]+\.([0-9]+)(\.[0-9]+){2}(\+.*)?$$,\1,p')
VER_ABI=$(shell echo $(VER) | sed -rne 's,^([0-9]+\.){2}([0-9]+)\.[0-9]+(\+.*)?$$,\2,p')
VER_PATCH=$(shell echo $(VER) | sed -rne 's,^([0-9]+\.){3}([0-9]+)$$,\2,p')
GITREV=$(shell echo $(VER) | sed -rne 's,^[0-9]+\.[0-9]+.*\+[0-9]+\+g([0-f]{8})$$,\1,p' -e 's,^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)$$,v\1,p')
GITCOUNT=$(shell echo $(VER) | sed -rne 's,^[0-9]+\.[0-9]+.*\+([0-9]+)\+g[0-f]{8}$$,\1,p')
%:
dh [email protected] --with python3 --parallel
override_dh_auto_configure:
dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" -DGR_GIT_COUNT="$(GITCOUNT)" -DGR_GIT_HASH="$(GITREV)"
dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" \
-DGR_GIT_COUNT="$(GITCOUNT)" \
-DGR_GIT_HASH="$(GITREV)" \
-DVERSION_MAJOR="$(VER_MAJOR)" \
-DVERSION_API="$(VER_API)" \
-DVERSION_ABI="$(VER_ABI)" \
-DVERSION_PATCH="$(VER_PATCH)"
version-to-get:
echo $(VER) is $(GITREV)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment