File 0001-libtss-add-correct-soname.patch of Package tss2

From c7d28f094f50b37659d3183667e0eaba3bd333f8 Mon Sep 17 00:00:00 2001
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: Fri, 16 Dec 2016 13:46:36 -0500
Subject: [PATCH 1/2] libtss: add correct soname

Shared object naming conventions on Linux are to use a major version
of the object as part of the shared object name, to facilitate the
installation of multiple major versions (which usually represent API
breaks).  So the shared object name of libtss should be libtss.so.0

Update the makefile to reflect this

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 utils/makefile        | 12 ++++++++++--
 utils/makefile-common |  2 ++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/utils/makefile b/utils/makefile
index 2c0791b..bc38891 100644
--- a/utils/makefile
+++ b/utils/makefile
@@ -86,6 +86,8 @@ LNALIBS =  -ltss -lcrypto
 # shared library
 
 LIBTSS=libtss.so
+LIBTSS_SONAME=$(LIBTSS).0
+LIBTSS_FULL=$(LIBTSS_SONAME).0.1
 
 # executable extension
 
@@ -154,8 +156,14 @@ tssntc.o:	$(TSS_HEADERS) tssntc.c
 
 # TSS shared library build
 
-$(LIBTSS): 	$(TSS_OBJS)
-		$(CC) $(LNFLAGS) $(LNLFLAGS) -shared -o $(LIBTSS) $(TSS_OBJS)
+$(LIBTSS_FULL): 	$(TSS_OBJS)
+		$(CC) $(LNFLAGS) $(LNLFLAGS) -Wl,-soname,$(LIBTSS_SONAME) -shared -o $(LIBTSS_FULL) $(TSS_OBJS) -lcrypto
+
+$(LIBTSS):	$(LIBTSS_FULL)
+		ln -sf $^ $@
+
+$(LIBTSS_SONAME):	$(LIBTSS_FULL)
+		ln -sf $^ $@
 
 .PHONY:		clean
 .PRECIOUS:	%.o
diff --git a/utils/makefile-common b/utils/makefile-common
index d95cdd8..11abe85 100644
--- a/utils/makefile-common
+++ b/utils/makefile-common
@@ -58,6 +58,8 @@ CCFLAGS += -DTPM_NUVOTON
 
 
 ALL += 	$(LIBTSS)				\
+	$(LIBTSS_FULL)				\
+	$(LIBTSS_SONAME)			\
 	$(LIBTSSA)				\
 	activatecredential$(EXE)		\
 	eventextend$(EXE)			\
-- 
2.6.6

openSUSE Build Service is sponsored by