From fab24d25f3dd4f1aa24dbe1ac02def2d4c10e816 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 06 Aug 2020 17:44:04 -0400 Subject: Manage SONAME link with update-alternatives --- diff --git a/build b/build index 7b9d931..03d5287 100755 --- a/build +++ b/build @@ -61,7 +61,10 @@ install_std install_dbg: build oh-fixperms -d $(destdir) set -e; \ lib="$$(ls $(destdir)/usr/lib/$(arch)/libwolfssl.so.$(abi_ver).*)"; \ - mv "$${lib}" "$${lib}.$(variant)" + mv "$${lib}" "$${lib}.$(variant)"; \ + rm -f $(destdir)/usr/lib/$(arch)/libwolfssl.so.$(abi_ver); \ + ln -sf "$${lib##*/}.$(variant)" \ + $(destdir)/usr/lib/$(arch)/libwolfssl.so.$(abi_ver).$(variant) set -e; if [ x"$(variant)" != x'dbg' ]; then \ oh-strip -d $(destdir); \ OPK_PACKAGES="\ diff --git a/changelog b/changelog index 3a93c26..8920457 100644 --- a/changelog +++ b/changelog @@ -10,7 +10,7 @@ wolfssl.24 (4.4.0-2) trunk libwolfssl.24-common. - Make libwolfssl.24-dbg depend on libwolfssl.24, instead of conflicting with, replacing, and providing it. - - Manage library file (provided by both libwolfssl.24 and + - Manage library file and SONAME link (provided by both libwolfssl.24 and libwolfssl.24-dbg) with update-alternatives. * libwolfssl.24-dbg: Include debugging symbols, as well as debugging messages which can be enabled by applications using diff --git a/libwolfssl.24-dbg.pkg/postinst b/libwolfssl.24-dbg.pkg/postinst index 9344a9f..7638dde 100644 --- a/libwolfssl.24-dbg.pkg/postinst +++ b/libwolfssl.24-dbg.pkg/postinst @@ -1,8 +1,12 @@ #!/bin/sh soname='libwolfssl.so.24' -lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +libfile="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +liblink="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24" if [ x"${1}" = x'configure' ]; then - update-alternatives --install "${lib}" "${soname}" "${lib}.dbg" 20 + update-alternatives --install "${libfile}" "${soname}" \ + "${libfile}.dbg" 20 + update-alternatives --install "${liblink}" "${soname}" \ + "${liblink}.dbg" 20 fi diff --git a/libwolfssl.24-dbg.pkg/prerm b/libwolfssl.24-dbg.pkg/prerm index 8f8fc95..7d26d18 100644 --- a/libwolfssl.24-dbg.pkg/prerm +++ b/libwolfssl.24-dbg.pkg/prerm @@ -1,8 +1,10 @@ #!/bin/sh soname='libwolfssl.so.24' -lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +libfile="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +liblink="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24" if [ x"${1}" = x'remove' ]; then - update-alternatives --remove "${soname}" "${lib}.dbg" + update-alternatives --remove "${soname}" "${libfile}.dbg" + update-alternatives --remove "${soname}" "${liblink}.dbg" fi diff --git a/libwolfssl.24.pkg/postinst b/libwolfssl.24.pkg/postinst index c0f8f53..ab80e84 100644 --- a/libwolfssl.24.pkg/postinst +++ b/libwolfssl.24.pkg/postinst @@ -1,8 +1,12 @@ #!/bin/sh soname='libwolfssl.so.24' -lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +libfile="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +liblink="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24" if [ x"${1}" = x'configure' ]; then - update-alternatives --install "${lib}" "${soname}" "${lib}.std" 10 + update-alternatives --install "${libfile}" "${soname}" \ + "${libfile}.std" 10 + update-alternatives --install "${liblink}" "${soname}" \ + "${liblink}.std" 10 fi diff --git a/libwolfssl.24.pkg/prerm b/libwolfssl.24.pkg/prerm index db50e77..a028b4c 100644 --- a/libwolfssl.24.pkg/prerm +++ b/libwolfssl.24.pkg/prerm @@ -1,8 +1,10 @@ #!/bin/sh soname='libwolfssl.so.24' -lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +libfile="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0" +liblink="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24" if [ x"${1}" = x'remove' ]; then - update-alternatives --remove "${soname}" "${lib}.std" + update-alternatives --remove "${soname}" "${libfile}.std" + update-alternatives --remove "${soname}" "${liblink}.std" fi -- cgit v0.9.1