Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rogge <andreas.rogge@bareos.com>2022-10-28 13:12:30 +0300
committerAndreas Rogge <andreas.rogge@bareos.com>2022-11-07 19:40:27 +0300
commitbd1cbc9c58a72cc665a6e9aeeaa2e5d874f31965 (patch)
tree21ba200d2c09e6137dd2ff860eb142139160fb02
parent00cb0943aaa713ea68d6fbc4ffec15c20483992d (diff)
droplet: build static library instead of shared
Historically, we linked against a 3rd-party package. Thus we were using dynamic linking. As we're shipping libdroplet ourselves and there is no other consumer than the droplet storage backend, it is easier to link it directly into the backend.
-rw-r--r--core/CMakeLists.txt8
-rw-r--r--core/platforms/packaging/bareos.spec1
-rw-r--r--core/src/droplet/libdroplet/CMakeLists.txt5
-rw-r--r--debian/bareos-storage-droplet.install.in1
4 files changed, 2 insertions, 13 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index c0750dfa5..47ccae2b9 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -423,14 +423,6 @@ if(NOT client-only
# directory it is also not safe on 32-bit systems, so we only build it on
# 64-bit
add_subdirectory(src/droplet)
- if(TARGET droplet)
- set_target_properties(
- droplet
- PROPERTIES VERSION "${BAREOS_NUMERIC_VERSION}"
- SOVERSION "${BAREOS_VERSION_MAJOR}"
- PREFIX "libbareos"
- )
- endif()
endif()
include(BareosGenerateDebianInfo)
diff --git a/core/platforms/packaging/bareos.spec b/core/platforms/packaging/bareos.spec
index 155d1c8d4..5c863eb0e 100644
--- a/core/platforms/packaging/bareos.spec
+++ b/core/platforms/packaging/bareos.spec
@@ -1333,7 +1333,6 @@ mkdir -p %{?buildroot}/%{_libdir}/bareos/plugins/vmware_plugin
%files storage-droplet
%defattr(-, root, root)
%{backend_dir}/libbareossd-droplet*.so
-%{library_dir}/libbareosdroplet.so*
%attr(0640, %{director_daemon_user},%{daemon_group}) %{_sysconfdir}/%{name}/bareos-dir.d/storage/S3_Object.conf.example
%attr(0640, %{storage_daemon_user},%{daemon_group}) %{_sysconfdir}/%{name}/bareos-sd.d/device/S3_ObjectStorage.conf.example
%dir %{_sysconfdir}/%{name}/bareos-sd.d/device/droplet/
diff --git a/core/src/droplet/libdroplet/CMakeLists.txt b/core/src/droplet/libdroplet/CMakeLists.txt
index 9ff8108fd..929b12732 100644
--- a/core/src/droplet/libdroplet/CMakeLists.txt
+++ b/core/src/droplet/libdroplet/CMakeLists.txt
@@ -21,7 +21,7 @@ message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
cmake_minimum_required(VERSION 3.0)
add_library(
- droplet SHARED
+ droplet STATIC
src/conn.c
src/converters.c
src/value.c
@@ -112,6 +112,7 @@ bareos_disable_warnings(
C_ONLY
ADD_FOR_LTO
)
+set_property(TARGET droplet PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(
droplet PUBLIC include ${LIBXML2_INCLUDE_DIR} ${JSONC_INCLUDE_DIRS}
@@ -120,5 +121,3 @@ target_include_directories(
target_link_libraries(
droplet ${LIBXML2_LIBRARIES} ${JSONC_LIBRARIES} ${OPENSSL_LIBRARIES}
)
-
-install(TARGETS droplet DESTINATION ${libdir})
diff --git a/debian/bareos-storage-droplet.install.in b/debian/bareos-storage-droplet.install.in
index 39db51a3f..1be86d8e8 100644
--- a/debian/bareos-storage-droplet.install.in
+++ b/debian/bareos-storage-droplet.install.in
@@ -1,4 +1,3 @@
-@libdir@/libbareosdroplet.so*
@backenddir@/libbareossd-droplet.so*
@configtemplatedir@/bareos-dir.d/storage/S3_Object.conf.example
@configtemplatedir@/bareos-sd.d/device/S3_ObjectStorage.conf.example