summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-08-06 16:09:07 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-08-06 17:28:21 (EDT)
commit00491fdcc66e716d29e8091813c449935e2fcdf4 (patch)
tree8d8484d76d5b92137b0b366b96bb19a67c0212fd
parent4dadcda71517ac646f4f70192ac69d4f7f6bb88d (diff)
Manage library file with update-alternatives
-rwxr-xr-xbuild29
-rw-r--r--changelog2
-rw-r--r--libwolfssl.24-dbg.pkg/postinst8
-rw-r--r--libwolfssl.24-dbg.pkg/prerm8
-rw-r--r--libwolfssl.24.pkg/postinst8
-rw-r--r--libwolfssl.24.pkg/prerm8
6 files changed, 48 insertions, 15 deletions
diff --git a/build b/build
index 5024d50..7b9d931 100755
--- a/build
+++ b/build
@@ -17,18 +17,14 @@ common_opts = \
--disable-aescbc \
--disable-md5 \
--enable-maxstrength
-build_client_opts = $(common_opts) \
+build_std_opts = $(common_opts) \
--disable-errorstrings
-build_full_opts = $(common_opts) \
- --disable-errorstrings
-build_dbg_opts = $(common_opts) \
+build_dbg_opts = $(common_opts) \
--enable-debug
common_cflags = \
-DNO_SESSION_CACHE
-build_client_cflags = $(common_cflags) \
- -DNO_WOLFSSL_SERVER
-build_full_cflags = $(common_cflags)
-build_dbg_cflags = $(common_cflags)
+build_std_cflags = $(common_cflags)
+build_dbg_cflags = $(common_cflags)
arch = $(OPK_HOST_ARCH)
@@ -48,14 +44,14 @@ fix:
touch src/aclocal.m4 src/configure src/Makefile.in src/config.in
touch $@
-build_client build_full build_dbg: fix
+build_std build_dbg: fix
oh-autoconfigure -B $(builddir) -- $($@_opts) CFLAGS='$($@_cflags)'
oh-autobuild -B $(builddir)
touch $@
-build: build_client build_full build_dbg
+build: build_std build_dbg
-install_client install_full install_dbg: build
+install_std install_dbg: build
oh-autoinstall -B $(builddir) -d $(destdir)
rm -Rf \
$(destdir)/usr/lib/$(arch)/libwolfssl.la \
@@ -63,11 +59,14 @@ install_client install_full install_dbg: build
$(destdir)/usr/share/doc/wolfssl/README.txt \
$(destdir)/usr/share/doc/wolfssl/taoCert.txt
oh-fixperms -d $(destdir)
+ set -e; \
+ lib="$$(ls $(destdir)/usr/lib/$(arch)/libwolfssl.so.$(abi_ver).*)"; \
+ mv "$${lib}" "$${lib}.$(variant)"
set -e; if [ x"$(variant)" != x'dbg' ]; then \
oh-strip -d $(destdir); \
OPK_PACKAGES="\
- libwolfssl.$(abi_ver)-$(variant) \
- libwolfssl.$(abi_ver)-$(variant)-dev \
+ libwolfssl.$(abi_ver) \
+ libwolfssl.$(abi_ver)-dev \
" oh-installfiles -d $(destdir); \
else \
rm -Rf \
@@ -76,9 +75,9 @@ install_client install_full install_dbg: build
$(destdir)/usr/lib/$(arch)/pkgconfig/wolfssl.pc \
$(destdir)/usr/bin/wolfssl-config; \
OPK_PACKAGES="\
- libwolfssl.$(abi_ver)-$(variant) \
+ libwolfssl.$(abi_ver)-dbg \
" oh-installfiles -d $(destdir); \
fi
-install: install_client install_full install_dbg
+install: install_std install_dbg
oh-shlibdeps
diff --git a/changelog b/changelog
index 3dd5390..3a93c26 100644
--- a/changelog
+++ b/changelog
@@ -10,6 +10,8 @@ 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
+ libwolfssl.24-dbg) with update-alternatives.
* libwolfssl.24-dbg: Include debugging symbols, as well as debugging
messages which can be enabled by applications using
wolfSSL_Debugging_ON().
diff --git a/libwolfssl.24-dbg.pkg/postinst b/libwolfssl.24-dbg.pkg/postinst
new file mode 100644
index 0000000..9344a9f
--- /dev/null
+++ b/libwolfssl.24-dbg.pkg/postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+soname='libwolfssl.so.24'
+lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0"
+
+if [ x"${1}" = x'configure' ]; then
+ update-alternatives --install "${lib}" "${soname}" "${lib}.dbg" 20
+fi
diff --git a/libwolfssl.24-dbg.pkg/prerm b/libwolfssl.24-dbg.pkg/prerm
new file mode 100644
index 0000000..8f8fc95
--- /dev/null
+++ b/libwolfssl.24-dbg.pkg/prerm
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+soname='libwolfssl.so.24'
+lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0"
+
+if [ x"${1}" = x'remove' ]; then
+ update-alternatives --remove "${soname}" "${lib}.dbg"
+fi
diff --git a/libwolfssl.24.pkg/postinst b/libwolfssl.24.pkg/postinst
new file mode 100644
index 0000000..c0f8f53
--- /dev/null
+++ b/libwolfssl.24.pkg/postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+soname='libwolfssl.so.24'
+lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0"
+
+if [ x"${1}" = x'configure' ]; then
+ update-alternatives --install "${lib}" "${soname}" "${lib}.std" 10
+fi
diff --git a/libwolfssl.24.pkg/prerm b/libwolfssl.24.pkg/prerm
new file mode 100644
index 0000000..db50e77
--- /dev/null
+++ b/libwolfssl.24.pkg/prerm
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+soname='libwolfssl.so.24'
+lib="/usr/lib/$(cat /etc/proteanos_arch)/libwolfssl.so.24.1.0"
+
+if [ x"${1}" = x'remove' ]; then
+ update-alternatives --remove "${soname}" "${lib}.std"
+fi