From 482aec8fcbef482fc2c0ff484fac63de02dc30d3 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Mon, 6 Apr 2020 17:35:00 +0100 Subject: [PATCH] Actually generate symbols, add binary target --- Makefile | 8 +++++++- gensyms.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 gensyms.sh diff --git a/Makefile b/Makefile index e048524..24d3f86 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ ppa: xenial bionic debian/libopenconnect5.symbols: gensyms.sh openconnect/openconnect.h openconnect/libopenconnect.map.in ./gensyms.sh > $@ || rm $@ -cleandir: +cleandir: debian/libopenconnect5.symbols cd openconnect; \ git reset --hard HEAD; \ git clean -fdx; \ @@ -27,3 +27,9 @@ xenial bionic: cleandir cd openconnect && DEBUILD_TGZ_CHECK=no debuild -S dput openconnect openconnect_$(PKGVERSION)-$@$(DISTREV)_source.changes +bionic-binary xenial-binary: cleandir + sed -e "s/PKGVER/$(PKGVERSION)/" -e "s/GITVER/$(OCVERSION)/" \ + -e "s/COMMITDATE/$(OCDATE)/" -e "s/DISTRO/$@/g" \ + -e "s/DISTREV/$(DISTREV)/" debian/changelog.in > openconnect/debian/changelog + cd openconnect && DEBUILD_TGZ_CHECK=no debuild -b + diff --git a/gensyms.sh b/gensyms.sh new file mode 100755 index 0000000..d57a534 --- /dev/null +++ b/gensyms.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e +THISVER=$(cd openconnect && git describe --tags | sed "s/v\([0-9.]\+\(-[0-9]\+\)\?\).*/\1/") + +function extractsyms() { + SYMVER="$1" + PKGVER="$2" + + echo " $SYMVER@$SYMVER $PKGVER" + sed -n -e "/^$SYMVER/,/^}/{/openconnect_/s/^\t\(openconnect_.*\);/ \1@$SYMVER $PKGVER/p}" openconnect/libopenconnect.map.in +} + +echo "libopenconnect.so.5 libopenconnect5 #MINVER#" +( extractsyms OPENCONNECT_PRIVATE $THISVER; + sed -n openconnect/openconnect.h -e "/^ \* API version/{\ + s/.* API version \([0-9.]\+\) (v\([0-9.]\+\);.*/\1 \2/;\ + s/.* API version \([0-9.]\+\):.*/\1 $THISVER/;p}" | + while read APIVER PKGVER; do + SYMVER=${APIVER/./_} + case $APIVER in + 5.0) + # Yes, "5.0" not "5_0". And I've really only just noticed but + # now it's ABI, and has been for years. + SYMVER="OPENCONNECT_5.0" + ;; + + 5.*) + SYMVER=OPENCONNECT_${APIVER/./_} + ;; + + *) + continue + ;; + esac + extractsyms "$SYMVER" "$PKGVER" + done ) | LANG=C sort + -- 2.50.1