summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2012-06-14 20:07:01 +0200
committerEnrico Zini <enrico@enricozini.org>2012-06-14 20:21:09 +0200
commit127f453f7a674caea46ecf6ebabdad829e37b5d8 (patch)
tree6078a7d9e9f67b3eb03d2fd841dc4866e9900fdc
parent7d4383bd070a53e6c679fe189c9f15fdb7b1dcef (diff)
downloadlibept-127f453f7a674caea46ecf6ebabdad829e37b5d8.tar.gz
Separate the software version and shared library version
Not all version changes warrant a SONAME bump, so don't abuse the version as SONAME. This changes the soname to libept.so.1.aptpkg<version>, with <version> replaced by the libapt-pkg soversion, which is now detected at build time instead of being hardcoded. Add a compatibility symlink for libept.so.1.0.5.4.12.
-rw-r--r--CMakeLists.txt15
-rw-r--r--debian/libept1.4.12.install2
-rw-r--r--debian/libept1.4.12.links1
-rwxr-xr-xdebian/rules2
-rw-r--r--ept/CMakeLists.txt4
5 files changed, 18 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c0c72d..88fad42 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,8 +3,19 @@ include( FindDoxygen )
add_custom_target( unit )
-set( LIBAPT_ABI_VERSION "4.12" )
-set( EPT_VERSION "1.0.7.${LIBAPT_ABI_VERSION}" )
+set( EPT_VERSION "1.0.7" )
+
+# Get the soversion from libapt-pkg to include in our own
+execute_process(
+ COMMAND "cc" "-xc" "-shared" "/dev/null" "-lapt-pkg"
+ )
+execute_process(
+ COMMAND "objdump" "-p" "a.out"
+ COMMAND "awk" "/NEEDED.*libapt-pkg/ { sub(\".*\\\\.so\\\\.\", \"\"); print }"
+ OUTPUT_VARIABLE LIBAPT_ABI_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+set( LIBEPT_SOVERSION "1.aptpkg${LIBAPT_ABI_VERSION}" )
set( APT_INCLUDES "/usr/include/" CACHE STRING "apt include path" )
set( APT_LINKDIRS "/usr/lib/" CACHE STRING "apt library path" )
set( OPT_FLAGS "-O0 -g" CACHE STRING "optimization level" )
diff --git a/debian/libept1.4.12.install b/debian/libept1.4.12.install
index c45ebcf..389d6db 100644
--- a/debian/libept1.4.12.install
+++ b/debian/libept1.4.12.install
@@ -1 +1 @@
-debian/tmp/usr/lib/lib*.so.*
+debian/tmp/usr/lib/libept.so.1.aptpkg4.12
diff --git a/debian/libept1.4.12.links b/debian/libept1.4.12.links
new file mode 100644
index 0000000..133c3b6
--- /dev/null
+++ b/debian/libept1.4.12.links
@@ -0,0 +1 @@
+usr/lib/libept.so.1.aptpkg4.12 usr/lib/libept.so.1.0.5.4.12
diff --git a/debian/rules b/debian/rules
index 65e693c..d47988e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,7 +10,7 @@ DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_MAKE_CHECK_TARGET := unit
-DEB_DH_MAKESHLIBS_ARGS_libept0 = -V
+DEB_DH_MAKESHLIBS_ARGS_libept1.4.12 = -V
# comment out CONFIGURE and uncomment CMAKE flags to use cmake
#DEB_CONFIGURE_EXTRA_FLAGS += --disable-shared --with-pic
diff --git a/ept/CMakeLists.txt b/ept/CMakeLists.txt
index c28b3ec..201e87a 100644
--- a/ept/CMakeLists.txt
+++ b/ept/CMakeLists.txt
@@ -26,8 +26,8 @@ add_definitions( -fexceptions -fPIC -fvisibility=default )
add_library( ept SHARED ${src} )
add_library( ept-static STATIC ${src} )
-set_target_properties( ept PROPERTIES VERSION ${EPT_VERSION} CLEAN_DIRECT_OUTPUT 1)
-set_target_properties( ept-static PROPERTIES VERSION ${EPT_VERSION} OUTPUT_NAME "ept" CLEAN_DIRECT_OUTPUT 1)
+set_target_properties( ept PROPERTIES SOVERSION ${LIBEPT_SOVERSION} CLEAN_DIRECT_OUTPUT 1)
+set_target_properties( ept-static PROPERTIES SOVERSION ${LIBEPT_SOVERSION} OUTPUT_NAME "ept" CLEAN_DIRECT_OUTPUT 1)
set( TEST_ENV_DIR ${ept_BINARY_DIR}/test-env/ )