git: 98e5e2274196 - main - sysutils/bareos18-server: fix library symlinks

Adriaan de Groot adridg at FreeBSD.org
Tue Apr 13 22:37:25 UTC 2021


The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=98e5e22741964d3ddf65ebdf4bfd66464486a7e1

commit 98e5e22741964d3ddf65ebdf4bfd66464486a7e1
Author:     Adriaan de Groot <adridg at FreeBSD.org>
AuthorDate: 2021-04-13 22:00:14 +0000
Commit:     Adriaan de Groot <adridg at FreeBSD.org>
CommitDate: 2021-04-13 22:37:22 +0000

    sysutils/bareos18-server: fix library symlinks
    
    There's a fs_violation going on, since the install runs a
    script -- only if there is exactly one DB backend -- that
    symlinks the default backend to libbareoscats.so.<version>, but:
    - the symlink was created in $PREFIX, not $DESTDIR/$PREFIX,
    - the symlink was absolute (which rules out a simple mv
      or symlinking the full path),
    - the symlink didn't get the right version, because the
      script was using the wrong variables anyway.
---
 sysutils/bareos18-server/Makefile                  |  2 +-
 ...e_cmake_bareos-symlink-default-db-backend.cmake | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/sysutils/bareos18-server/Makefile b/sysutils/bareos18-server/Makefile
index bba657d6003f..7bde97e4abe4 100644
--- a/sysutils/bareos18-server/Makefile
+++ b/sysutils/bareos18-server/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	bareos
 DISTVERSIONPREFIX=	Release/
 DISTVERSION=	18.2.10
-PORTREVISION?=	1
+PORTREVISION?=	2
 CATEGORIES?=	sysutils
 PKGNAMEPREFIX?=	#
 PKGNAMESUFFIX?=	18-server
diff --git a/sysutils/bareos18-server/files/patch-core_cmake_bareos-symlink-default-db-backend.cmake b/sysutils/bareos18-server/files/patch-core_cmake_bareos-symlink-default-db-backend.cmake
new file mode 100644
index 000000000000..811950bd6a2d
--- /dev/null
+++ b/sysutils/bareos18-server/files/patch-core_cmake_bareos-symlink-default-db-backend.cmake
@@ -0,0 +1,22 @@
+--- core/cmake/bareos-symlink-default-db-backend.cmake.orig	2021-04-13 21:34:51 UTC
++++ core/cmake/bareos-symlink-default-db-backend.cmake
+@@ -16,8 +16,17 @@
+ #   along with this program; if not, write to the Free Software
+ #   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ #   02110-1301, USA.
++
+ MESSAGE(STATUS "${CMAKE_COMMAND} -E create_symlink ${libdir}/libbareoscats${CMAKE_SHARED_LIBRARY_SUFFIX} ${backenddir}/libbareoscats-${default_db_backend}${CMAKE_SHARED_LIBRARY_SUFFIX}")
++# The ${libdir} and ${backenddir} are absolute, so figure out
++# a relative path (${backenddir} lives under ${libdir}) instead.
++# Make the link relative, placing the libbareoscats.so in ${libdir}.
++# Within this script, VERSION is set to BAREOS_NUMERIC_VERSION (see
++# core/src/cats/CMakeLists.txt).
++file(RELATIVE_PATH _rel ${libdir} ${backenddir}/libbareoscats-${default_db_backend}${CMAKE_SHARED_LIBRARY_SUFFIX})
++MESSAGE(STATUS ".. actually ${_rel} in $ENV{DESTDIR} v ${VERSION}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+-   ${backenddir}/libbareoscats-${default_db_backend}${CMAKE_SHARED_LIBRARY_SUFFIX}
+-   ${libdir}/libbareoscats${CMAKE_SHARED_LIBRARY_SUFFIX}.${BAREOS_NUMERIC_VERSION}
++   ${_rel}
++   libbareoscats${CMAKE_SHARED_LIBRARY_SUFFIX}.${VERSION}
++   WORKING_DIRECTORY $ENV{DESTDIR}${libdir} COMMAND_ECHO STDOUT
+    )


More information about the dev-commits-ports-all mailing list