Skip to content

Commit

Permalink
cmake: configure individual files in core/scripts/
Browse files Browse the repository at this point in the history
Instead of configuring all .in files, the CMakeLists now configure only
the files they need and put those in the output directory
  • Loading branch information
arogge authored and BareosBot committed Mar 12, 2024
1 parent 1c29bcf commit 3967d1d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
14 changes: 0 additions & 14 deletions .gitignore
Expand Up @@ -22,20 +22,6 @@ webui/version.php
# Ignore files created by core/cmake/BareosConfigureFile.cmake
# can be regenerated by running the following command:
# find debian/ core/src/ core/scripts/ -not -path 'core/src/droplet/*' -name '*.in' -print | sed -e 's/\.in$//' | sort
core/scripts/bareos
core/scripts/bareos-config
core/scripts/bareos-config-lib.sh
core/scripts/bareos-ctl-dir
core/scripts/bareos-ctl-fd
core/scripts/bareos-ctl-sd
core/scripts/bareos-explorer
core/scripts/bareos-glusterfind-wrapper
core/scripts/bconsole
core/scripts/btraceback
core/scripts/disk-changer
core/scripts/logrotate
core/scripts/logwatch/logfile.bareos.conf
core/scripts/mtx-changer
core/src/cats/create_bareos_database
core/src/cats/ddl/versions.map
core/src/cats/delete_catalog_backup
Expand Down
2 changes: 1 addition & 1 deletion core/CMakeLists.txt
Expand Up @@ -729,7 +729,7 @@ endif()

include(BareosConfigureFile)
bareos_configure_file(
GLOB_RECURSE "${CMAKE_SOURCE_DIR}/debian/*.in" "src/*.in" "scripts/*.in"
GLOB_RECURSE "${CMAKE_SOURCE_DIR}/debian/*.in" "src/*.in"
IN_TREE
)

Expand Down
41 changes: 32 additions & 9 deletions core/scripts/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
Expand All @@ -18,31 +18,50 @@
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

include(BareosConfigureFile)
bareos_configure_file(
FILES
bareos-config-lib.sh.in
bareos-config.in
bareos-ctl-dir.in
bareos-ctl-fd.in
bareos-ctl-sd.in
bareos-explorer.in
bareos-glusterfind-wrapper.in
bareos.in
btraceback.in
disk-changer.in
logrotate.in
mtx-changer.in
)

install(
FILES bareos btraceback
FILES ${CMAKE_CURRENT_BINARY_DIR}/bareos
${CMAKE_CURRENT_BINARY_DIR}/btraceback
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION "${sbindir}"
)

install(
FILES bareos-ctl-fd
FILES ${CMAKE_CURRENT_BINARY_DIR}/bareos-ctl-fd
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION "${scriptdir}"
COMPONENT filedaemon
)

install(
FILES bareos bareos-config
FILES ${CMAKE_CURRENT_BINARY_DIR}/bareos
${CMAKE_CURRENT_BINARY_DIR}/bareos-config
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION "${scriptdir}"
)

install(
FILES bareos-config-lib.sh bareos-ctl-funcs btraceback.gdb btraceback.dbx
btraceback.mdb
FILES ${CMAKE_CURRENT_BINARY_DIR}/bareos-config-lib.sh bareos-ctl-funcs
btraceback.gdb btraceback.dbx btraceback.mdb
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION "${scriptdir}"
)
Expand All @@ -57,8 +76,12 @@ endif()

if(NOT client-only)
install(
FILES mtx-changer disk-changer bareos-explorer bareos-glusterfind-wrapper
bareos-ctl-dir bareos-ctl-sd
FILES ${CMAKE_CURRENT_BINARY_DIR}/mtx-changer
${CMAKE_CURRENT_BINARY_DIR}/disk-changer
${CMAKE_CURRENT_BINARY_DIR}/bareos-explorer
${CMAKE_CURRENT_BINARY_DIR}/bareos-glusterfind-wrapper
${CMAKE_CURRENT_BINARY_DIR}/bareos-ctl-dir
${CMAKE_CURRENT_BINARY_DIR}/bareos-ctl-sd
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION "${scriptdir}"
Expand All @@ -67,7 +90,7 @@ if(NOT client-only)
install(FILES mtx-changer.conf DESTINATION "${confdir}")

install(
FILES logrotate
FILES ${CMAKE_CURRENT_BINARY_DIR}/logrotate
DESTINATION "${sysconfdir}/logrotate.d"
RENAME bareos-dir
)
Expand Down

0 comments on commit 3967d1d

Please sign in to comment.