diff --git a/CHANGELOG.md b/CHANGELOG.md index def7d1ef254..4f8a17fdb0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - core: fix various data races (connection_pool/heartbeat_thread) [PR #1685] - filed: skip stripped top level directories [PR #1686] - jcr: fix some compiler warnings [PR #1648] +- build: Fix debugsource RPM package generation [PR #1713] ### Removed - plugins: remove old deprecated postgres plugin [PR #1606] @@ -103,4 +104,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [PR #1695]: https://github.com/bareos/bareos/pull/1695 [PR #1696]: https://github.com/bareos/bareos/pull/1696 [PR #1708]: https://github.com/bareos/bareos/pull/1708 +[PR #1713]: https://github.com/bareos/bareos/pull/1713 [unreleased]: https://github.com/bareos/bareos/tree/master diff --git a/CMakeLists.txt b/CMakeLists.txt index e0adb0fcc81..b6be7a01245 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2019-2023 Bareos GmbH & Co. KG +# Copyright (C) 2019-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -128,6 +128,8 @@ if(BUILD_BAREOS_BINARIES) ) set(CMAKE_BUILD_TYPE "RelWithDebInfo") endif() + include(BareosCcache) + include(PrefixMap) add_subdirectory(third-party EXCLUDE_FROM_ALL) add_subdirectory(core) if(ENABLE_WEBUI) diff --git a/cmake/BareosCcache.cmake b/cmake/BareosCcache.cmake new file mode 100644 index 00000000000..930ecf49db1 --- /dev/null +++ b/cmake/BareosCcache.cmake @@ -0,0 +1,28 @@ +# BAREOS® - Backup Archiving REcovery Open Sourced +# +# Copyright (C) 2024-2024 Bareos GmbH & Co. KG +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of version three of the GNU Affero General Public +# License as published by the Free Software Foundation and included +# in the file LICENSE. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +find_program(CCACHE_PROGRAM ccache) +if(CCACHE_PROGRAM) + set(CCACHE_CMDLINE "${CCACHE_PROGRAM}") + list(APPEND CCACHE_CMDLINE "base_dir=${CMAKE_SOURCE_DIR}") + list(APPEND CCACHE_CMDLINE "hash_dir=true") + list(APPEND CCACHE_CMDLINE "namespace=bareos") + set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_CMDLINE}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_CMDLINE}") +endif() diff --git a/cmake/DebugEdit.cmake b/cmake/DebugEdit.cmake new file mode 100644 index 00000000000..10b0918cb44 --- /dev/null +++ b/cmake/DebugEdit.cmake @@ -0,0 +1,45 @@ +# BAREOS® - Backup Archiving REcovery Open Sourced +# +# Copyright (C) 2024-2024 Bareos GmbH & Co. KG +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of version three of the GNU Affero General Public +# License as published by the Free Software Foundation and included +# in the file LICENSE. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +find_program(DEBUGEDIT_PROG debugedit HINTS /usr/lib/rpm) + +option(DEBUGEDIT_REWRITE + "Rewrite DW_AT_comp_dir in ELF objects to the real path" ON +) + +if(DEBUGEDIT_REWRITE + AND DEBUGEDIT_PROG + AND NOT HAVE_WIN32 +) + get_directory_property(directory_targets BUILDSYSTEM_TARGETS) + foreach(target ${directory_targets}) + get_target_property(target_type ${target} TYPE) + if(target_type STREQUAL EXECUTABLE + OR target_type STREQUAL SHARED_LIBRARY + OR target_type STREQUAL MODULE_LIBRARY + ) + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${DEBUGEDIT_PROG} -b /usr/src/bareos -d ${CMAKE_SOURCE_DIR} + $ + ) + endif() + endforeach() +endif() diff --git a/cmake/PrefixMap.cmake b/cmake/PrefixMap.cmake new file mode 100644 index 00000000000..cdb6edd59e6 --- /dev/null +++ b/cmake/PrefixMap.cmake @@ -0,0 +1,49 @@ +# BAREOS® - Backup Archiving REcovery Open Sourced +# +# Copyright (C) 2024-2024 Bareos GmbH & Co. KG +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of version three of the GNU Affero General Public +# License as published by the Free Software Foundation and included +# in the file LICENSE. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +include(CheckCCompilerFlag) +include(CheckCXXCompilerFlag) + +set(BAREOS_PREFIX_MAP "${CMAKE_SOURCE_DIR}=/usr/src/bareos") + +check_c_compiler_flag( + -fdebug-prefix-map=${BAREOS_PREFIX_MAP} c_compiler_debug_prefix_map +) +check_cxx_compiler_flag( + -fdebug-prefix-map=${BAREOS_PREFIX_MAP} cxx_compiler_debug_prefix_map +) +if(c_compiler_debug_prefix_map AND cxx_compiler_debug_prefix_map) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=${BAREOS_PREFIX_MAP}") + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fdebug-prefix-map=${BAREOS_PREFIX_MAP}" + ) +endif() + +check_c_compiler_flag( + -fmacro-prefix-map=${BAREOS_PREFIX_MAP} c_compiler_macro_prefix_map +) +check_cxx_compiler_flag( + -fmacro-prefix-map=${BAREOS_PREFIX_MAP} cxx_compiler_macro_prefix_map +) +if(c_compiler_macro_prefix_map AND cxx_compiler_macro_prefix_map) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmacro-prefix-map=${BAREOS_PREFIX_MAP}") + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fmacro-prefix-map=${BAREOS_PREFIX_MAP}" + ) +endif() diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 0288122510d..f659de3c000 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -36,12 +36,6 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME common) include(GNUInstallDirs) include(BareosHelper) -find_program(CCACHE_FOUND ccache) -if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) -endif(CCACHE_FOUND) - # switch on CXX 17 Support # set(CMAKE_CXX_STANDARD 17) @@ -114,46 +108,6 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") endif() endif() -option(DEBUG_PREFIX_MAP - "remap absolute debug paths to relative if compiler supports it" ON -) -check_c_compiler_flag( - -fdebug-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=. c_compiler_debug_prefix_map -) -check_cxx_compiler_flag( - -fdebug-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=. - cxx_compiler_debug_prefix_map -) -if(DEBUG_PREFIX_MAP - AND c_compiler_debug_prefix_map - AND cxx_compiler_debug_prefix_map -) - set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -fdebug-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=." - ) - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -fdebug-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=." - ) -endif() - -check_c_compiler_flag( - -fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=. c_compiler_macro_prefix_map -) -check_cxx_compiler_flag( - -fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=. - cxx_compiler_macro_prefix_map -) -if(c_compiler_macro_prefix_map) - set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} -fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=." - ) -endif() -if(cxx_compiler_macro_prefix_map) - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=." - ) -endif() - check_cxx_compiler_flag(-Winvalid-offsetof compiler_has_invalid_offsetof) if(compiler_has_invalid_offsetof) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof") @@ -609,7 +563,7 @@ message(STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION}) # there are also two variables exactly for this purpose: # wheter or not -message(STATUS "CCACHE_FOUND: " ${CCACHE_FOUND}) +message(STATUS "CCACHE: " ${CCACHE_PROGRAM}) # Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug) message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE}) diff --git a/core/platforms/packaging/bareos.spec b/core/platforms/packaging/bareos.spec index c8fa15753f8..96a7f63ded4 100644 --- a/core/platforms/packaging/bareos.spec +++ b/core/platforms/packaging/bareos.spec @@ -809,7 +809,7 @@ This package contains the tray monitor (QT based). %prep # this is a hack so we always build in "bareos" and not in "bareos-version" %setup -c -n bareos -mv bareos-*/* . +[ -d bareos-* ] && mv bareos-*/* . %if 0%{?contrib} %replace_python_shebang contrib/misc/bsmc/bin/bsmc %replace_python_shebang contrib/misc/triggerjob/bareos-triggerjob.py @@ -867,7 +867,6 @@ cmake .. \ -DSYSCONF_INSTALL_DIR:PATH=/etc \ -DSHARE_INSTALL_PREFIX:PATH=/usr/share \ -DBUILD_SHARED_LIBS:BOOL=ON \ - -DDEBUG_PREFIX_MAP:BOOL=OFF \ -Dprefix=%{_prefix}\ -Dlibdir=%{library_dir} \ -Dsbindir=%{_sbindir} \ diff --git a/core/src/benchmarks/CMakeLists.txt b/core/src/benchmarks/CMakeLists.txt index 7f0e41a99e3..db16b2c988b 100644 --- a/core/src/benchmarks/CMakeLists.txt +++ b/core/src/benchmarks/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2021-2023 Bareos GmbH & Co. KG +# Copyright (C) 2021-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -65,3 +65,5 @@ bareos_add_benchmark( ) bareos_add_benchmark(digest LINK_LIBRARIES bareos benchmark::benchmark_main) + +include(DebugEdit) diff --git a/core/src/cats/CMakeLists.txt b/core/src/cats/CMakeLists.txt index 91c7d82923b..54babd2b61c 100644 --- a/core/src/cats/CMakeLists.txt +++ b/core/src/cats/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -69,3 +69,5 @@ install( PATTERN *.in EXCLUDE PATTERN *.sql EXCLUDE ) + +include(DebugEdit) diff --git a/core/src/console/CMakeLists.txt b/core/src/console/CMakeLists.txt index eaa05616b2c..2d1a8b629e7 100644 --- a/core/src/console/CMakeLists.txt +++ b/core/src/console/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -57,3 +57,5 @@ install( bareos_install_single_config_file(\"${CMAKE_CURRENT_SOURCE_DIR}/bconsole.conf\" \"${configtemplatedir}\" \".\") " ) + +include(DebugEdit) diff --git a/core/src/dird/CMakeLists.txt b/core/src/dird/CMakeLists.txt index 8deeec2c187..46a817ed5f1 100644 --- a/core/src/dird/CMakeLists.txt +++ b/core/src/dird/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -201,3 +201,5 @@ install(CODE "set(configtemplatedir \"${configtemplatedir}\")") install(CODE "set(SRC_DIR \"${PROJECT_SOURCE_DIR}\")") install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/install-dird-configfiles.cmake) + +include(DebugEdit) diff --git a/core/src/droplet/libdroplet/CMakeLists.txt b/core/src/droplet/libdroplet/CMakeLists.txt index 4be7186709b..e9d8bcf0e5b 100644 --- a/core/src/droplet/libdroplet/CMakeLists.txt +++ b/core/src/droplet/libdroplet/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2020-2023 Bareos GmbH & Co. KG +# Copyright (C) 2020-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -118,3 +118,5 @@ target_include_directories( target_link_libraries( droplet ${LIBXML2_LIBRARIES} ${JSONC_LIBRARIES} ${OPENSSL_LIBRARIES} ) + +include(DebugEdit) diff --git a/core/src/fastlz/CMakeLists.txt b/core/src/fastlz/CMakeLists.txt index 4bffee62874..8f9b673c95d 100644 --- a/core/src/fastlz/CMakeLists.txt +++ b/core/src/fastlz/CMakeLists.txt @@ -34,3 +34,5 @@ set_target_properties( bareosfastlz PROPERTIES VERSION "${BAREOS_NUMERIC_VERSION}" SOVERSION "${BAREOS_VERSION_MAJOR}" ) + +include(DebugEdit) diff --git a/core/src/filed/CMakeLists.txt b/core/src/filed/CMakeLists.txt index 58d4877d74a..ae007b0ad12 100644 --- a/core/src/filed/CMakeLists.txt +++ b/core/src/filed/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2022 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -113,3 +113,5 @@ install(CODE "set(SRC_DIR \"${PROJECT_SOURCE_DIR}\")" COMPONENT filedaemon) install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/install-filed-configfiles.cmake COMPONENT filedaemon ) + +include(DebugEdit) diff --git a/core/src/findlib/CMakeLists.txt b/core/src/findlib/CMakeLists.txt index 432debbdadc..ba8321fe855 100644 --- a/core/src/findlib/CMakeLists.txt +++ b/core/src/findlib/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -67,3 +67,5 @@ endif() if(NOT HAVE_WIN32 AND GTest_FOUND) # add_subdirectory(unittests) endif() + +include(DebugEdit) diff --git a/core/src/findlib/unittests/CMakeLists.txt b/core/src/findlib/unittests/CMakeLists.txt index 87ddc02850b..38fb05a23ba 100644 --- a/core/src/findlib/unittests/CMakeLists.txt +++ b/core/src/findlib/unittests/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2021 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -35,3 +35,5 @@ set_property( ) add_dependencies(check test_findlib) + +include(DebugEdit) diff --git a/core/src/lib/CMakeLists.txt b/core/src/lib/CMakeLists.txt index 955c973360a..09484c0bb34 100644 --- a/core/src/lib/CMakeLists.txt +++ b/core/src/lib/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -193,3 +193,5 @@ if(HAVE_WIN32) set_target_properties(bareos PROPERTIES DEFINE_SYMBOL "BUILDING_DLL") target_link_libraries(bareos PUBLIC ws2_32) endif() + +include(DebugEdit) diff --git a/core/src/lmdb/CMakeLists.txt b/core/src/lmdb/CMakeLists.txt index 783edcbb1e4..5dc93ebdc45 100644 --- a/core/src/lmdb/CMakeLists.txt +++ b/core/src/lmdb/CMakeLists.txt @@ -43,3 +43,5 @@ if(HAVE_WIN32) endif() install(TARGETS bareoslmdb DESTINATION ${libdir}) + +include(DebugEdit) diff --git a/core/src/ndmp/CMakeLists.txt b/core/src/ndmp/CMakeLists.txt index dbf8000e756..a4ee816207b 100644 --- a/core/src/ndmp/CMakeLists.txt +++ b/core/src/ndmp/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2022 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -210,3 +210,5 @@ if(build_ndmjob) add_executable(ndmjob ${NDMJOB_SRCS}) target_link_libraries(ndmjob bareosndmp) endif() + +include(DebugEdit) diff --git a/core/src/plugins/dird/python/CMakeLists.txt b/core/src/plugins/dird/python/CMakeLists.txt index 053e51a0f23..b41e673cb4a 100644 --- a/core/src/plugins/dird/python/CMakeLists.txt +++ b/core/src/plugins/dird/python/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2020-2023 Bareos GmbH & Co. KG +# Copyright (C) 2020-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -73,3 +73,5 @@ if(Python3_FOUND) "ASAN_OPTIONS=detect_leaks=0 verify_asan_link_order=0" ) endif() + +include(DebugEdit) diff --git a/core/src/plugins/filed/CMakeLists.txt b/core/src/plugins/filed/CMakeLists.txt index 7c13b841d65..6402d63b5a0 100644 --- a/core/src/plugins/filed/CMakeLists.txt +++ b/core/src/plugins/filed/CMakeLists.txt @@ -94,3 +94,5 @@ if(HAVE_GLUSTERFS AND ENABLE_GFAPI_FD) target_link_libraries(gfapi-fd gfapi) target_include_directories(gfapi-fd PRIVATE ${GFAPI_INCLUDE_DIRS}) endif() + +include(DebugEdit) diff --git a/core/src/plugins/filed/python/CMakeLists.txt b/core/src/plugins/filed/python/CMakeLists.txt index 03f8ac96043..b667964db52 100644 --- a/core/src/plugins/filed/python/CMakeLists.txt +++ b/core/src/plugins/filed/python/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2020-2023 Bareos GmbH & Co. KG +# Copyright (C) 2020-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -141,3 +141,5 @@ install( DESTINATION ${plugindir} COMPONENT filedaemon ) + +include(DebugEdit) diff --git a/core/src/plugins/stored/CMakeLists.txt b/core/src/plugins/stored/CMakeLists.txt index 7e72f1a7bb3..cca458b4f8c 100644 --- a/core/src/plugins/stored/CMakeLists.txt +++ b/core/src/plugins/stored/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2021 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -54,3 +54,5 @@ if(NOT HAVE_WIN32 AND NOT HAVE_DARWIN_OS) target_link_libraries(scsitapealert-sd bareossd) endif() endif() + +include(DebugEdit) diff --git a/core/src/plugins/stored/python/CMakeLists.txt b/core/src/plugins/stored/python/CMakeLists.txt index 1eb3d6b9979..5b28800a9be 100644 --- a/core/src/plugins/stored/python/CMakeLists.txt +++ b/core/src/plugins/stored/python/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2020-2023 Bareos GmbH & Co. KG +# Copyright (C) 2020-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -72,3 +72,5 @@ if(Python3_FOUND) "ASAN_OPTIONS=detect_leaks=0 verify_asan_link_order=0" ) endif() + +include(DebugEdit) diff --git a/core/src/qt-tray-monitor/CMakeLists.txt b/core/src/qt-tray-monitor/CMakeLists.txt index aa9a6809f6c..bb3c045025d 100644 --- a/core/src/qt-tray-monitor/CMakeLists.txt +++ b/core/src/qt-tray-monitor/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2022 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -39,7 +39,9 @@ else() message(STATUS "QT5Widgets NOT found, checking for Qt4 ...") find_package(Qt4) if(NOT Qt4_FOUND) - message(FATAL_ERROR "Both Qt5 and Qt4 not found, cannot build tray-monitor") + message( + FATAL_ERROR "Both Qt5 and Qt4 not found, cannot build tray-monitor" + ) endif() endif() endif() @@ -106,3 +108,5 @@ install( DESTINATION ${datarootdir}/pixmaps/ RENAME bareos-tray-monitor.png ) + +include(DebugEdit) diff --git a/core/src/stored/CMakeLists.txt b/core/src/stored/CMakeLists.txt index 71b15f4039f..0e1678e5714 100644 --- a/core/src/stored/CMakeLists.txt +++ b/core/src/stored/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -216,3 +216,5 @@ add_subdirectory(backends) if(TARGET droplet) target_compile_definitions(bareossd PRIVATE HAVE_BAREOSSD_DROPLET_DEVICE) endif() + +include(DebugEdit) diff --git a/core/src/stored/backends/CMakeLists.txt b/core/src/stored/backends/CMakeLists.txt index abe21813f58..857dd9fd3b8 100644 --- a/core/src/stored/backends/CMakeLists.txt +++ b/core/src/stored/backends/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2022-2023 Bareos GmbH & Co. KG +# Copyright (C) 2022-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -74,3 +74,5 @@ if(HAVE_DYNAMIC_SD_BACKENDS) unix_file_device.cc ) endif() + +include(DebugEdit) diff --git a/core/src/tests/CMakeLists.txt b/core/src/tests/CMakeLists.txt index d16f8f79951..45a97698577 100644 --- a/core/src/tests/CMakeLists.txt +++ b/core/src/tests/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -518,3 +518,5 @@ bareos_add_test( if(NOT HAVE_WIN32) bareos_add_test(fvec LINK_LIBRARIES GTest::gtest_main) endif() + +include(DebugEdit) diff --git a/core/src/tools/CMakeLists.txt b/core/src/tools/CMakeLists.txt index 83413da0318..49352d0a679 100644 --- a/core/src/tools/CMakeLists.txt +++ b/core/src/tools/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2017-2023 Bareos GmbH & Co. KG +# Copyright (C) 2017-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -83,3 +83,5 @@ install(TARGETS ${TOOLS_SBIN} DESTINATION "${sbindir}") # install bsmtp for non-root directors install(TARGETS bsmtp DESTINATION "${bindir}") install(TARGETS bsmtp DESTINATION "${sbindir}") + +include(DebugEdit) diff --git a/core/src/vmware/vadp_dumper/CMakeLists.txt b/core/src/vmware/vadp_dumper/CMakeLists.txt index 3f6a29b5a32..a91d85124ee 100644 --- a/core/src/vmware/vadp_dumper/CMakeLists.txt +++ b/core/src/vmware/vadp_dumper/CMakeLists.txt @@ -1,6 +1,6 @@ # BAREOS® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2020-2020 Bareos GmbH & Co. KG +# Copyright (C) 2020-2024 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -42,3 +42,5 @@ install( WORLD_READ WORLD_EXECUTE DESTINATION "${CMAKE_INSTALL_SBINDIR}" ) + +include(DebugEdit) diff --git a/debian/rules b/debian/rules index a44bba3223b..65a5f68847d 100755 --- a/debian/rules +++ b/debian/rules @@ -16,7 +16,6 @@ STORAGE_DAEMON_GROUP = $(DAEMON_GROUP) BAREOS_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/Version: //g') define CONFIGURE_COMMON - -DDEBUG_PREFIX_MAP:BOOL=OFF \ -Dsbindir=/usr/sbin \ -Dbindir=/usr/bin \ -Dlibdir=/usr/lib/bareos \ diff --git a/devtools/build-rpm.sh b/devtools/build-rpm.sh new file mode 100755 index 00000000000..eab0570ecfc --- /dev/null +++ b/devtools/build-rpm.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# BAREOS® - Backup Archiving REcovery Open Sourced +# +# Copyright (C) 2024-2024 Bareos GmbH & Co. KG +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of version three of the GNU Affero General Public +# License as published by the Free Software Foundation and included +# in the file LICENSE. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +set -u +set -e +set -x +shopt -s nullglob + +if [ -t ${BAREOS_VERSION:+x} ]; then + BAREOS_VERSION="$(cmake -P get_version.cmake | sed -e 's,^-- ,,')" +fi + +RPMDIR="$(rpm --eval "%{_rpmdir}")" +BUILDDIR="$(rpm --eval "%{_builddir}")" +for d in $RPMDIR $BUILDDIR ; do + [ ! -d "$d" ] && mkdir -p "$d" +done + +CCACHE_BASEDIR="$(pwd)" +CCACHE_SLOPPINESS="file_macro" +export CCACHE_BASEDIR CCACHE_SLOPPINESS + +# Make sure we use the default generator +unset CMAKE_GENERATOR + +spec="core/platforms/packaging/bareos.spec" + +rpmdev-bumpspec \ + --comment="- See https://docs.bareos.org/release-notes/" \ + --userstring="Bareos Jenkins " \ + --new="${BAREOS_VERSION}-${BUILD_ID:-1}%{?dist}" \ + "${spec}" + +opts=() +if rpm -q bareos-vmware-vix-disklib-devel; then + opts+=("--define=vmware 1") +fi +rpmbuild -bb --build-in-place --noclean "${opts[@]}" "$@" "${spec}"