Fix client library installation 93/25093/4
authorPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Tue, 29 Jul 2014 10:33:10 +0000 (12:33 +0200)
committerPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Tue, 29 Jul 2014 14:17:03 +0000 (16:17 +0200)
[Bug/Feature]   Missing so versioning
[Cause]         N/A
[Solution]      N/A
[Verification]  Build, install

Change-Id: I4f5c3715b177506c6c6e967512acf969944fa246

client/CMakeLists.txt
client/security-containers.pc.in
packaging/security-containers.spec

index 8d45be5..8a34575 100644 (file)
@@ -21,10 +21,14 @@ MESSAGE(STATUS "Generating makefile for the Client...")
 FILE(GLOB         project_SRCS *.cpp *.hpp)
 FILE(GLOB_RECURSE common_SRCS ${COMMON_FOLDER}/*.cpp ${COMMON_FOLDER}/*.hpp)
 
+SET(_LIB_VERSION_ "0.0.1")
+SET(_LIB_SOVERSION_ "0")
+SET(PC_FILE "${PROJECT_NAME}.pc")
 
 ## Setup target ################################################################
-SET(CLIENT_CODENAME "${PROJECT_NAME}-client")
-ADD_LIBRARY(${CLIENT_CODENAME} SHARED ${project_SRCS})
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${project_SRCS})
+SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY SOVERSION ${_LIB_SOVERSION_})
+SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY   VERSION ${_LIB_VERSION_})
 
 
 ## Link libraries ##############################################################
@@ -32,17 +36,16 @@ INCLUDE_DIRECTORIES(${COMMON_FOLDER})
 
 
 ## Generate the pc file ########################################################
-CONFIGURE_FILE(security-containers.pc.in
-               ${CMAKE_BINARY_DIR}/security-containers.pc @ONLY)
+CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_BINARY_DIR}/${PC_FILE} @ONLY)
 
 
 ## Install #####################################################################
-INSTALL(FILES       ${CMAKE_BINARY_DIR}/security-containers.pc
+INSTALL(FILES       ${CMAKE_BINARY_DIR}/${PC_FILE}
         DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-INSTALL(TARGETS     ${CLIENT_CODENAME}
+INSTALL(TARGETS     ${PROJECT_NAME}
         DESTINATION ${CMAKE_INSTALL_LIBDIR}
         COMPONENT   RuntimeLibraries)
 
 INSTALL(FILES       security-containers-client.h
-        DESTINATION ${INCLUDE_INSTALL_DIR}/security-containers)
+        DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME})
index 16a4330..186218e 100644 (file)
@@ -1,10 +1,12 @@
+# Package Information for pkg-config
+
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
 libdir=@LIB_INSTALL_DIR@
 includedir=${prefix}/include
 
 Name: security-containers
-Description: Security Containers Package
-Version: @PACKAGE_VERSION@
+Description: Security Containers library
+Version: @_LIB_VERSION_@
 Libs: -L${libdir} -lsecurity-containers-client
 Cflags: -I${includedir}/security-containers
index e639a98..af4751c 100644 (file)
@@ -113,7 +113,13 @@ Library interface to the security-containers daemon
 
 %files client
 %manifest packaging/libsecurity-containers-client.manifest
-%attr(644,root,root) %{_libdir}/libsecurity-containers-client.so
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libsecurity-containers.so.0.0.1
+%{_libdir}/libsecurity-containers.so.0
+
+%post client -p /sbin/ldconfig
+
+%postun client -p /sbin/ldconfig
 
 
 ## Devel Package ###############################################################
@@ -129,8 +135,9 @@ Development package including the header files for the client library
 %files devel
 %manifest packaging/security-containers.manifest
 %defattr(644,root,root,755)
+%{_libdir}/libsecurity-containers.so
 %{_includedir}/security-containers
-%{_libdir}/pkgconfig/*
+%{_libdir}/pkgconfig/*.pc
 
 
 ## Container Support Package ###################################################