Commit 1b8d6a29 authored by Michael Davis's avatar Michael Davis
Browse files

Adds shared object versioning

parent 46d36ae1
......@@ -61,7 +61,9 @@ else (OCCI_SUPPORT)
endif (OCCI_SUPPORT)
add_library (ctacatalogue SHARED
${CATALOGUE_LIB_SRC_FILES})
${CATALOGUE_LIB_SRC_FILES})
set_property(TARGET ctacatalogue PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacatalogue PROPERTY VERSION "${CTA_LIBVERSION}")
install (TARGETS ctacatalogue DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......@@ -94,6 +96,8 @@ set(IN_MEMORY_CATALOGUE_UNIT_TESTS_LIB_SRC_FILES
add_library (ctainmemorycatalogueunittests SHARED
${IN_MEMORY_CATALOGUE_UNIT_TESTS_LIB_SRC_FILES})
set_property(TARGET ctainmemorycatalogueunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctainmemorycatalogueunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctainmemorycatalogueunittests
ctacatalogue)
......@@ -106,6 +110,8 @@ set (CATALOGUE_UNIT_TESTS_LIB_SRC_FILES
add_library (ctacatalogueunittests SHARED
${CATALOGUE_UNIT_TESTS_LIB_SRC_FILES})
set_property(TARGET ctacatalogueunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacatalogueunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctacatalogueunittests
ctacatalogue)
......@@ -195,4 +201,7 @@ set (CATALOGUE_CMD_LINE_UNIT_TESTS_LIB_SRC_FILES
add_library (ctacataloguecmdlineunittests SHARED
${CATALOGUE_CMD_LINE_UNIT_TESTS_LIB_SRC_FILES})
set_property(TARGET ctacataloguecmdlineunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacataloguecmdlineunittests PROPERTY VERSION "${CTA_LIBVERSION}")
install (TARGETS ctacataloguecmdlineunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
#Default values
# Default CTA Version
set(CTA_VERSION 0)
set(CTA_RELEASE 0)
#Get version number from environment if set.
# Shared object internal version (used in SONAME)
set(CTA_SOVERSION 0)
# Shared object external version (used in filename)
set(CTA_SOMAJOR ${CTA_SOVERSION})
set(CTA_SOMINOR 1)
set(CTA_SOPATCH 0)
# Get version number from environment if set.
if(NOT $ENV{CTA_VERSION} STREQUAL "")
set(CTA_VERSION $ENV{CTA_VERSION})
message(STATUS "Got CTA_VERSION from environment: ${CTA_VERSION}")
......@@ -11,7 +18,7 @@ else(NOT $ENV{CTA_VERSION} STREQUAL "")
message(STATUS "Using default CTA_VERSION: ${CTA_VERSION}")
endif(NOT $ENV{CTA_VERSION} STREQUAL "")
#Get release number from environment if set
# Get release number from environment if set
if(NOT $ENV{CTA_RELEASE} STREQUAL "")
set(CTA_RELEASE $ENV{CTA_RELEASE})
message(STATUS "Got CTA_RELEASE from environment: ${CTA_RELEASE}")
......@@ -26,3 +33,8 @@ if(DEFINED VCS_VERSION)
endif(DEFINED VCS_VERSION)
message(STATUS "CTA version is ${CTA_VERSION}-${CTA_RELEASE}")
# Shared library versioning
set(CTA_LIBVERSION ${CTA_SOMAJOR}.${CTA_SOMINOR}.${CTA_SOPATCH})
message(STATUS "CTA shared object version is ${CTA_LIBVERSION} (${CTA_SOVERSION})")
......@@ -135,6 +135,9 @@ set (COMMON_LIB_SRC_FILES
add_library (ctacommon SHARED
${COMMON_LIB_SRC_FILES})
set_property(TARGET ctacommon PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommon PROPERTY VERSION "${CTA_LIBVERSION}")
install (TARGETS ctacommon DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
target_link_libraries (ctacommon
......@@ -176,6 +179,8 @@ set (COMMON_UNIT_TESTS_LIB_SRC_FILES
add_library (ctacommonunittests SHARED
${COMMON_UNIT_TESTS_LIB_SRC_FILES})
set_property(TARGET ctacommonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommonunittests PROPERTY VERSION "${CTA_LIBVERSION}")
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......
......@@ -4,5 +4,7 @@ include_directories(${PROJECT_SOURCE_DIR}/tapeserver)
add_library (ctaexceptionunittests SHARED
ExceptionTest.cpp)
set_property(TARGET ctaexceptionunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctaexceptionunittests PROPERTY VERSION "${CTA_LIBVERSION}")
install(TARGETS ctaexceptionunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......@@ -12,10 +12,14 @@
%define mydist %{?dist}
%endif
# Skipping unit tests (for developpers)
#--------------------------------------
# Skipping unit tests (for developers)
#-------------------------------------
%define skip_unit_tests @SKIP_UNIT_TESTS@
# Build with XRootD SSI extensions (for developers)
#--------------------------------------------------
%define build_xroot_ssi 0@BUILD_XROOT_SSI@
# General settings
#-----------------
Summary: CERN Tape Archive
......@@ -37,10 +41,17 @@ BuildRequires: xrootd-client-devel = 1:4.2.3
BuildRequires: xrootd-devel = 1:4.2.3
BuildRequires: cryptopp-devel >= 5.6.2
%else
%if "%{?build_xroot_ssi}" == "0"
BuildRequires: xrootd-client-devel = 1:4.4.1
BuildRequires: xrootd-devel = 1:4.4.1
BuildRequires: xrootd-server-devel = 1:4.4.1
BuildRequires: xrootd-private-devel = 1:4.4.1
%else
BuildRequires: xrootd-client-devel >= 1:20170801
BuildRequires: xrootd-devel >= 1:20170801
BuildRequires: xrootd-server-devel >= 1:20170801
BuildRequires: xrootd-private-devel >= 1:20170801
%endif
BuildRequires: librados-devel >= 11.0, libradosstriper-devel >= 11.0,
BuildRequires: protobuf3-compiler >= 3.3.1 protobuf3-devel >= 3.3.1
BuildRequires: gmock-devel >= 1.5.0 gtest-devel >= 1.5.0
......@@ -154,10 +165,10 @@ The xroot plugin
/usr/bin/getent group cta || /usr/sbin/groupadd cta
/usr/bin/getent passwd cta || /usr/sbin/useradd -s /bin/nologin -c "CTA system account" -g cta cta
%files -n cta-frontend
%defattr(-,root,root)
%defattr(0755,root,root)
%{_libdir}/libXrdCtaOfs.so*
%attr(0755,cta,cta) %dir /var/log/cta
%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/cta-frontend
%attr(0755,root,root) %{_libdir}/libXrdCtaOfs.so
%attr(0644,root,root) %config(noreplace) /etc/xrootd/xrootd-cta.cfg
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cta/cta-frontend.conf
......@@ -184,17 +195,17 @@ Requires: oracle-instantclient12.1-basic
CERN Tape Archive:
The shared libraries
%files -n cta-lib
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libctacatalogue.so
%attr(0755,root,root) %{_libdir}/libctacommon.so
%defattr(0755,root,root,-)
%{_libdir}/libctacatalogue.so*
%{_libdir}/libctacommon.so*
#TODO: merge util and common
%attr(0755,root,root) %{_libdir}/libctautils.so
%attr(0755,root,root) %{_libdir}/libctascheduler.so
%attr(0755,root,root) %{_libdir}/libctaobjectstore.so
%attr(0755,root,root) %{_libdir}/libctamediachanger.so
%attr(0755,root,root) %{_libdir}/libctamessages.so
%attr(0755,root,root) %{_libdir}/libctamessagesutils.so
%attr(0755,root,root) %{_libdir}/libctardbms.so
%{_libdir}/libctautils.so*
%{_libdir}/libctascheduler.so*
%{_libdir}/libctaobjectstore.so*
%{_libdir}/libctamediachanger.so*
%{_libdir}/libctamessages.so*
%{_libdir}/libctamessagesutils.so*
%{_libdir}/libctardbms.so*
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cta/cta_catalogue_db.conf.example
#CTA-lib installs libraries so we need ldconfig.
......@@ -210,29 +221,30 @@ Requires: cta-taped = %{ctaVersion}-%{ctaRelease}%{mydist}
CERN Tape Archive:
Unit tests and system tests with virtual tape drives
%files -n cta-systemtests
%attr(0755,root,root) %{_libdir}/libsystemTestHelperTests.so
%attr(0755,root,root) %{_libdir}/libcta-tapedSystemTests.so
%attr(0755,root,root) %{_bindir}/cta-catalogueUnitTests
%attr(0755,root,root) %{_bindir}/cta-unitTests
%attr(0755,root,root) %{_bindir}/cta-unitTests-multiProcess
%attr(0755,root,root) %{_bindir}/cta-valgrindUnitTests.sh
%attr(0755,root,root) %{_bindir}/cta-unitPlusSystemTests.sh
%attr(0755,root,root) %{_libdir}/libctacatalogueunittests.so
%attr(0755,root,root) %{_libdir}/libctacataloguecmdlineunittests.so
%attr(0755,root,root) %{_libdir}/libctacommonunittests.so
%attr(0755,root,root) %{_libdir}/libctaexceptionunittests.so
%attr(0755,root,root) %{_libdir}/libctainmemorycatalogueunittests.so
%attr(0755,root,root) %{_libdir}/libctaobjectstoreunittests.so
%attr(0755,root,root) %{_libdir}/libctardbmsunittests.so
%attr(0755,root,root) %{_libdir}/libctaschedulerunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverdaemonunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverdriveunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverfileunittests.so
%attr(0755,root,root) %{_libdir}/libctatapeserverscsiunittests.so
%attr(0755,root,root) %{_libdir}/libctadaemonunittests.so
%attr(0755,root,root) %{_libdir}/libctamediachangerunittests.so
%attr(0755,root,root) %{_bindir}/cta-systemTests
%attr(0755,root,root) %{_libdir}/libctadaemonunittests-multiprocess.so
%defattr(0755,root,root,-)
%{_libdir}/libsystemTestHelperTests.so*
%{_libdir}/libcta-tapedSystemTests.so*
%{_bindir}/cta-catalogueUnitTests
%{_bindir}/cta-unitTests
%{_bindir}/cta-unitTests-multiProcess
%{_bindir}/cta-valgrindUnitTests.sh
%{_bindir}/cta-unitPlusSystemTests.sh
%{_libdir}/libctacatalogueunittests.so*
%{_libdir}/libctacataloguecmdlineunittests.so*
%{_libdir}/libctacommonunittests.so*
%{_libdir}/libctaexceptionunittests.so*
%{_libdir}/libctainmemorycatalogueunittests.so*
%{_libdir}/libctaobjectstoreunittests.so*
%{_libdir}/libctardbmsunittests.so*
%{_libdir}/libctaschedulerunittests.so*
%{_libdir}/libctatapeserverdaemonunittests.so*
%{_libdir}/libctatapeserverdriveunittests.so*
%{_libdir}/libctatapeserverfileunittests.so*
%{_libdir}/libctatapeserverscsiunittests.so*
%{_libdir}/libctadaemonunittests.so*
%{_libdir}/libctamediachangerunittests.so*
%{_bindir}/cta-systemTests
%{_libdir}/libctadaemonunittests-multiprocess.so*
%attr(0644,root,root) %{_datadir}/%{name}-%{ctaVersion}/unittest/*.suppr
%package -n cta-objectstore-tools
......
......@@ -25,3 +25,4 @@ add_library (ctaeos
DiskReporter.cpp
DiskReporterFactory.cpp
EOSReporter.cpp)
......@@ -55,6 +55,8 @@ set (MEDIACHANGER_LIB_SRC_FILES
include_directories (${PROTOBUF3_INCLUDE_DIRS})
add_library (ctamediachanger SHARED
${MEDIACHANGER_LIB_SRC_FILES})
set_property(TARGET ctamediachanger PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctamediachanger PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctamediachanger
ctacommon
......@@ -77,6 +79,8 @@ set (MEDIACHANGER_UNIT_TESTS_LIB_SRC_FILES
add_library (ctamediachangerunittests SHARED
${MEDIACHANGER_UNIT_TESTS_LIB_SRC_FILES})
set_property(TARGET ctamediachangerunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctamediachangerunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctamediachangerunittests
ctamediachanger)
......
......@@ -70,6 +70,9 @@ add_library (ctaobjectstore SHARED
SchedulerGlobalLock.cpp
ValueCountMap.cpp
Helpers.cpp)
set_property(TARGET ctaobjectstore PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctaobjectstore PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctaobjectstore rados json-c ctautils)
set_source_files_properties(BackendRados.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
install (TARGETS ctaobjectstore DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......@@ -82,6 +85,9 @@ set(ObjectStoreUnitTests
)
add_library(ctaobjectstoreunittests SHARED ${ObjectStoreUnitTests})
set_property(TARGET ctaobjectstoreunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctaobjectstoreunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctaobjectstoreunittests
${PROTOBUF3_LIBRARIES} rados ctacommon gtest ctaobjectstore)
install(TARGETS ctaobjectstoreunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......
......@@ -75,6 +75,8 @@ endif (OCCI_SUPPORT)
add_library (ctardbms SHARED
${RDBMS_LIB_SRC_FILES})
set_property(TARGET ctardbms PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctardbms PROPERTY VERSION "${CTA_LIBVERSION}")
set (CTARDBMS_LINK_LIBRARIES
ctacommon
......@@ -108,6 +110,8 @@ endif (OCCI_SUPPORT)
add_library (ctardbmsunittests SHARED
${RDBMS_UNIT_TESTS_LIB_SRC_FILES})
set_property(TARGET ctardbmsunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctardbmsunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctardbmsunittests
ctacatalogue)
......
......@@ -25,6 +25,9 @@ find_package(Protobuf3 REQUIRED)
include_directories (${PROTOBUF3_INCLUDE_DIRS})
add_library (ctascheduler SHARED
${CTA_SCHEDULER_SRC_FILES})
set_property(TARGET ctascheduler PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctascheduler PROPERTY VERSION "${CTA_LIBVERSION}")
install (TARGETS ctascheduler DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
target_link_libraries (ctascheduler ctacommon ctaobjectstore ${PROTOBUF3_LIBRARIES} ctautils ctaeos)
......@@ -37,6 +40,8 @@ add_library (ctaschedulerunittests SHARED
SchedulerDatabaseTest.cpp
SchedulerTest.cpp
OStoreDB/OStoreDBTest.cpp)
set_property(TARGET ctaschedulerunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctaschedulerunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (ctaschedulerunittests
ctascheduler)
......
......@@ -25,6 +25,8 @@ install (FILES cta-taped.service DESTINATION /etc/systemd/system)
# CTA's cta-taped system tests.
add_library(cta-tapedSystemTests SHARED
cta-tapedSystemtests.cpp)
set_property(TARGET cta-tapedSystemTests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET cta-tapedSystemTests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(cta-tapedSystemTests
unitTestHelper
......
......@@ -33,6 +33,9 @@ add_library(ctamessagesprotobuf
add_library(ctamessagesutils SHARED
TapeserverProxyDummy.cpp)
set_property(TARGET ctamessagesutils PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctamessagesutils PROPERTY VERSION "${CTA_LIBVERSION}")
install(TARGETS ctamessagesutils DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
set(CtaMessageSrcs
......@@ -44,6 +47,9 @@ set(CtaMessageSrcs
add_library(ctamessages SHARED
${CtaMessageSrcs})
set_property(TARGET ctamessages PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctamessages PROPERTY VERSION "${CTA_LIBVERSION}")
install (TARGETS ctamessages DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_dependencies(ctamessages ctamessagesprotobuf)
......
......@@ -37,5 +37,7 @@ add_library(SCSI Device.cpp Structures.cpp Constants.cpp Exception.cpp)
add_library(ctatapeserverscsiunittests SHARED
DeviceTest.cpp
StructuresTest.cpp)
set_property(TARGET ctatapeserverscsiunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctatapeserverscsiunittests PROPERTY VERSION "${CTA_LIBVERSION}")
install(TARGETS ctatapeserverscsiunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......@@ -90,6 +90,8 @@ add_library(ctatapeserverdaemonunittests SHARED
RecallTaskInjectorTest.cpp
TaskWatchDogTest.cpp
)
set_property(TARGET ctatapeserverdaemonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctatapeserverdaemonunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctatapeserverdaemonunittests
ctamessagesutils)
......
......@@ -66,6 +66,8 @@ endif(CMAKE_COMPILER_IS_GNUCC)
add_library(ctatapeserverdriveunittests SHARED
DriveTest.cpp)
set_property(TARGET ctatapeserverdriveunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctatapeserverdriveunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctatapeserverdriveunittests
ctaTapeServerDaemon
......
......@@ -79,6 +79,8 @@ add_library(ctatapeserverfileunittests SHARED
StructuresTest.cpp
FileTest.cpp
CryptoPPTest.cpp)
set_property(TARGET ctatapeserverfileunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctatapeserverfileunittests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctatapeserverfileunittests
File)
......
......@@ -26,6 +26,8 @@ set (UTILS_LIB_SRC_FILES
../common/CastorConfiguration.cpp)
add_library (ctautils SHARED ${UTILS_LIB_SRC_FILES})
set_property(TARGET ctautils PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctautils PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctautils)
......
......@@ -49,10 +49,14 @@ add_library(ctadaemonunittests SHARED
TapedConfigurationTests.cpp
TpconfigTests.cpp
SourcedParameterTests.cpp)
set_property(TARGET ctadaemonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctadaemonunittests PROPERTY VERSION "${CTA_LIBVERSION}")
add_library(ctadaemonunittests-multiprocess SHARED
ProcessManagerTests.cpp
SignalHandlerTests.cpp)
set_property(TARGET ctadaemonunittests-multiprocess PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctadaemonunittests-multiprocess PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(ctadaemonunittests
ctatapedaemon
......
......@@ -76,6 +76,8 @@ add_library(unitTestHelper
add_library(systemTestHelperTests SHARED
SubprocessSystemTests.cpp)
set_property(TARGET systemTestHelperTests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET systemTestHelperTests PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries(systemTestHelperTests
ctacommon)
......
......@@ -25,6 +25,8 @@ include_directories(${CMAKE_SOURCE_DIR}/tapeserver)
find_package(Protobuf3 REQUIRED)
include_directories(${PROTOBUF3_INCLUDE_DIRS})
add_library (XrdCtaOfs MODULE ListArchiveFilesCmd.cpp XrdCtaFilesystem.cpp XrdCtaFile.cpp XrdCtaDir.cpp)
set_property(TARGET XrdCtaOfs PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET XrdCtaOfs PROPERTY VERSION "${CTA_LIBVERSION}")
target_link_libraries (XrdCtaOfs ctacatalogue ctaeosmessages ctascheduler ctacommon ${PROTOBUF3_LIBRARIES} ctaobjectstore cryptopp)
set_target_properties(XrdCtaOfs PROPERTIES INSTALL_RPATH ${PROTOBUF3_RPATH})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment