From 983855ffce3dfbee4d4a5b5db386bec4b41f19fe Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 12 Feb 2016 09:39:35 -0500 Subject: [PATCH] fix shared library generation --- libsrtp-1.5.4-shared-fix.patch | 36 ++++++++++++++++++++++++++++++++++ libsrtp.spec | 8 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 libsrtp-1.5.4-shared-fix.patch diff --git a/libsrtp-1.5.4-shared-fix.patch b/libsrtp-1.5.4-shared-fix.patch new file mode 100644 index 0000000..b720709 --- /dev/null +++ b/libsrtp-1.5.4-shared-fix.patch @@ -0,0 +1,36 @@ +diff -up libsrtp-1.5.4/Makefile.in.sharedfix libsrtp-1.5.4/Makefile.in +--- libsrtp-1.5.4/Makefile.in.sharedfix 2016-02-02 14:56:49.000000000 -0500 ++++ libsrtp-1.5.4/Makefile.in 2016-02-12 09:38:18.228208296 -0500 +@@ -84,12 +84,14 @@ pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = libsrtp.pc + endif + +-SHAREDLIBVERSION = 1 ++SHAREDLIBMINIVER = 1 ++SHAREDLIBVERSION = $(SHAREDLIBMINIVER).0.0 + ifeq (linux,$(findstring linux,@host@)) + SHAREDLIB_DIR = $(libdir) +-SHAREDLIB_LDFLAGS = -shared -Wl,-soname,$@ + SHAREDLIBSUFFIXNOVER = so + SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION) ++SHAREDLIBMINISUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBMINIVER) ++SHAREDLIB_LDFLAGS = -shared -Wl,-soname,libsrtp.$(SHAREDLIBMINISUFFIX) + else ifeq (mingw,$(findstring mingw,@host@)) + SHAREDLIB_DIR = $(bindir) + SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp.dll.a +@@ -148,6 +150,7 @@ libsrtp.$(SHAREDLIBSUFFIX): $(srtpobj) $ + $(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \ + $^ $(LDFLAGS) $(LIBS) + if [ -n "$(SHAREDLIBVERSION)" ]; then \ ++ ln -sfn $@ libsrtp.$(SHAREDLIBMINISUFFIX); \ + ln -sfn $@ libsrtp.$(SHAREDLIBSUFFIXNOVER); \ + fi + +@@ -274,6 +277,7 @@ install: + $(INSTALL) -d $(DESTDIR)$(SHAREDLIB_DIR); \ + cp libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/; \ + ln -sfn libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/libsrtp.$(SHAREDLIBSUFFIXNOVER); \ ++ ln -sfn libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/libsrtp.$(SHAREDLIBMINISUFFIX); \ + fi + if [ "$(pkgconfig_DATA)" != "" ]; then \ + $(INSTALL) -d $(DESTDIR)$(pkgconfigdir); \ diff --git a/libsrtp.spec b/libsrtp.spec index 9526ddf..c909512 100644 --- a/libsrtp.spec +++ b/libsrtp.spec @@ -2,7 +2,7 @@ Name: libsrtp Version: 1.5.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: An implementation of the Secure Real-time Transport Protocol (SRTP) Group: System Environment/Libraries License: BSD @@ -12,6 +12,8 @@ Source0: https://github.com/cisco/libsrtp/archive/v%{version}.tar.gz Source1: libsrtp.pc # Universal config.h Source2: config.h +# Fix shared lib so ldconfig doesn't complain +Patch0: libsrtp-1.5.4-shared-fix.patch Patch1: libsrtp-srtp_aes_encrypt.patch Patch2: libsrtp-sha1-name-fix.patch Patch3: libsrtp-fix-name-collision-on-MIPS.patch @@ -33,6 +35,7 @@ developing applications that use %{name}. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 -b .sharedfix %patch1 -p1 -b .srtp_aes_encrypt %patch2 -p1 -b .sha1-name-fix %patch3 -p1 -b .mips-name-fix @@ -78,6 +81,9 @@ cp -a %{SOURCE2} %{buildroot}%{_includedir}/%{shortname}/config.h %{_libdir}/*.so %changelog +* Fri Feb 12 2016 Tom Callaway - 1.5.4-2 +- fix shared lib generation to silence ldconfig + * Thu Feb 11 2016 Tom Callaway - 1.5.4-1 - update to 1.5.4 - fix MIPS name collision (bz1305950 ) Thanks to Michal Toman