From 30c092b3a9fd201bb83360c3cbf6d5184071f5cd Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Mon, 11 Feb 2019 14:08:20 +0100 Subject: [PATCH] cmake: adapt for building and packaging on Darwin (Mac) - adapt CMAKE PATH variables to be relative so that cpack works. - removed osx Makefile packaging files --- core/CMakeLists.txt | 77 +++------ core/cmake/BareosExtractVersionInfo.cmake | 6 + core/cmake/BareosInstallConfigFiles.cmake | 23 ++- core/cmake/BareosSetVariableDefaults.cmake | 22 +-- core/platforms/CMakeLists.txt | 30 ++-- core/platforms/darwin/CMakeLists.txt | 60 +++++++ core/platforms/darwin/description.txt | 1 + .../platforms/darwin/resources/ReadMe.html.in | 53 ++++++ .../darwin/resources/bareos-client.plist | 25 +++ .../resources}/org.bareos.bareos-fd.plist.in | 8 +- .../{osx => darwin}/resources/postinstall.in | 6 +- .../{osx => darwin}/resources/preinstall.in | 1 - .../darwin/resources/uninstall.command | 29 ++++ .../resources}/uninstall.command.in | 0 core/platforms/darwin/resources/welcome.txt | 1 + .../platforms/darwin/resources/welcome.txt.in | 1 + core/platforms/osx/Makefile-standalone.in | 149 ----------------- core/platforms/osx/README | 68 -------- core/platforms/osx/configure.sh | 32 ---- .../files/installer.pmdoc/01destdir.xml.in | 27 ---- .../osx/files/installer.pmdoc/index.xml.in | 30 ---- core/platforms/osx/installer-gencontents.py | 56 ------- core/platforms/osx/resources/ReadMe.html.in | 152 ------------------ core/scripts/CMakeLists.txt | 2 - core/src/CMakeLists.txt | 2 +- core/src/console/CMakeLists.txt | 2 + core/src/filed/CMakeLists.txt | 4 + core/src/lib/CMakeLists.txt | 4 +- core/src/ndmp/CMakeLists.txt | 7 +- core/src/plugins/filed/CMakeLists.txt | 2 +- core/src/plugins/stored/CMakeLists.txt | 6 +- core/src/stored/CMakeLists.txt | 4 + core/src/stored/backends/CMakeLists.txt | 6 + 33 files changed, 284 insertions(+), 612 deletions(-) create mode 100644 core/platforms/darwin/CMakeLists.txt create mode 100644 core/platforms/darwin/description.txt create mode 100644 core/platforms/darwin/resources/ReadMe.html.in create mode 100644 core/platforms/darwin/resources/bareos-client.plist rename core/platforms/{osx/files => darwin/resources}/org.bareos.bareos-fd.plist.in (72%) rename core/platforms/{osx => darwin}/resources/postinstall.in (63%) rename core/platforms/{osx => darwin}/resources/preinstall.in (99%) create mode 100644 core/platforms/darwin/resources/uninstall.command rename core/platforms/{osx/files => darwin/resources}/uninstall.command.in (100%) create mode 100644 core/platforms/darwin/resources/welcome.txt create mode 100644 core/platforms/darwin/resources/welcome.txt.in delete mode 100644 core/platforms/osx/Makefile-standalone.in delete mode 100644 core/platforms/osx/README delete mode 100755 core/platforms/osx/configure.sh delete mode 100644 core/platforms/osx/files/installer.pmdoc/01destdir.xml.in delete mode 100644 core/platforms/osx/files/installer.pmdoc/index.xml.in delete mode 100644 core/platforms/osx/installer-gencontents.py delete mode 100644 core/platforms/osx/resources/ReadMe.html.in diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 0f01baa4d8d..ae33cd027e9 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -20,6 +20,8 @@ cmake_minimum_required(VERSION 3.0) project(bareos) +INCLUDE(GNUInstallDirs) + # switch on CXX 11 Support # if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") @@ -44,6 +46,7 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") include_directories(/usr/include) endif() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/../../SOURCES @@ -55,16 +58,11 @@ SET(host ${CMAKE_SYSTEM}) SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) - - - - # enable "make check" enable_testing() set(CMAKE_CTEST_COMMAND ctest -V) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) - # run git-info to collect sourcecode info file(MAKE_DIRECTORY build) execute_process( @@ -77,13 +75,17 @@ add_definitions(-DVERSION="${BAREOS_FULL_VERSION}") INCLUDE(BareosLocalBuildDefinitions RESULT_VARIABLE BareosLocalBuildDefinitionsFile) +IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) + set(Readline_ROOT_DIR /usr/local/opt/readline) +ENDIF() + INCLUDE(BareosFindAllLibraries) IF (NOT ${OPENSSL_FOUND}) MESSAGE(FATAL_ERROR "FATAL ERROR: OpenSSL is required but was not found.") ENDIF() - IF (coverage) set(COVERAGE_COMPILER_FLAGS "-g -O0 --coverage -fprofile-arcs -ftest-coverage" CACHE INTERNAL "") MESSAGE(STATUS "coverage requested, adding COVERAGE_COMPILER_FLAGS : ${COVERAGE_COMPILER_FLAGS}") @@ -117,6 +119,15 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") link_libraries(intl) endif() +IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(HAVE_DARWIN_OS 1) + #set(CMAKE_INCLUDE_PATH "${OPENSSL_INCLUDE_DIR}:${CMAKE_INCLUDE_PATH}") + set(CMAKE_INCLUDE_PATH "/usr/local/opt/:${CMAKE_INCLUDE_PATH}") + link_directories(/usr/local/lib) + link_libraries(intl) + set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}-${BAREOS_FULL_VERSION}") +ENDIF() + # hpux if (${CMAKE_SYSTEM_NAME} MATCHES "HP-UX") set(HAVE_HPUX_OS 1) @@ -135,6 +146,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "AIX") link_libraries(intl) endif() + if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") include_directories( ${PROJECT_SOURCE_DIR}/src/win32/include @@ -161,6 +173,8 @@ else() add_definitions("-D_FILE_OFFSET_BITS=64") endif() +INCLUDE(FindIntl) + IF(developer) add_definitions("-DDEVELOPER=1") ENDIF() @@ -175,7 +189,6 @@ endif() INCLUDE(BareosFindPrograms) -INCLUDE(GNUInstallDirs) INCLUDE(BareosSetVariableDefaults) @@ -183,10 +196,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "AIX") SET(ENABLE_NLS 0) endif() + INCLUDE(BareosGetDistInfo) INCLUDE(BareosGenerateDebianInfo) - IF (${CMAKE_SYSTEM_NAME} MATCHES "Windows") add_definitions(-DWIN32_VSS -DMINGW64 -DHAVE_WIN32 -DHAVE_MINGW -D_WIN32_WINNT=${WINDOWS_VERSION}) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${WINDOWS_BITS} -mwin32 -mthreads") @@ -208,44 +221,27 @@ mark_as_advanced(INSTALL_LIB_DIR) # RPATH settings (from https://cmake.org/Wiki/CMake_RPATH_handling) -# use, i.e. don')t skip the full RPATH for the build tree SET(CMAKE_SKIP_BUILD_RPATH FALSE) -# when building, don't use the install RPATH already -# (but later on when installing) -#SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) -#SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}") -#SET(CMAKE_INSTALL_RPATH "/${INSTALL_LIB_DIR}") SET(CMAKE_INSTALL_RPATH "${libdir}") -# add the automatically determined parts of the RPATH -# which point to directories outside the build tree to the install RPATH SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - -#cmake_host_system_information(RESULT hostname QUERY HOSTNAME) site_name(hostname) set(dbdriver sqlite3) #manual definitions set (BAREOS "Bareos") -#set(CONFDIR \"${CMAKE_INSTALL_FULL_SYSCONFDIR}\") -set(LOCALEDIR \"${CMAKE_INSTALL_FULL_LOCALEDIR}\") - - - +set(LOCALEDIR \"${CMAKE_INSTALL_LOCALEDIR}\") set(HAVE_CRYPTO 1) INCLUDE(BareosTypeSizes) - - INCLUDE(TestBigEndian) TEST_BIG_ENDIAN(IS_BIGENDIAN) IF(IS_BIGENDIAN) @@ -255,13 +251,9 @@ ELSE() SET(HAVE_LITTLE_ENDIAN 1) ENDIF() - - MESSAGE( STATUS "VERSION: " ${CMAKE_MATCH_1} ) - MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} ) - # needed for check_include set(CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") INCLUDE(BareosCheckIncludes) @@ -285,7 +277,6 @@ set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") check_type_size("socklen_t" HAVE_SOCKLEN_T) set(CMAKE_EXTRA_INCLUDE_FILES) - set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) @@ -474,25 +465,18 @@ if ("${PAM_FOUND}") set(HAVE_PAM 1) endif() - set(have_tls "${HAVE_TLS}" ) set(have_crypto "${HAVE_CRYPTO}" ) set(have_openssl "${HAVE_OPENSSL}" ) set(have_zlib "${ZLIB_FOUND}" ) set(have_fastlz "${HAVE_FASTLZLIB_H}" ) - - - set(HAVE_CAPABILITY "${HAVE_CAPABILITY_H}" CACHE BOOL "compile with capability support") if ("${HAVE_CAPABILITY}") set(CAPABILITY_LIBS cap) message( STATUS "CAPABILITY set") endif() - - - set(ndmp "${ndmp}" ) set(lmdb "${lmdb}" ) set(build_client_only "${client-only}" ) @@ -521,7 +505,6 @@ if(${HAVE_RADOSSTRIPER_LIBRADOSSTRIPER_H}) set(have_ceph_rados_striper ${HAVE_CEPH_RADOS_STRIPER}) endif() - if(${HAVE_GLUSTERFS_API_GLFS_H}) set(HAVE_GLUSTERFS 1) endif() @@ -530,8 +513,6 @@ if (${HAVE_GLUSTERFS}) include_directories(/usr/include/glusterfs) endif() - - if (NOT HAVE_WIN32) if (${ndmp}) set(HAVE_NDMP 1) @@ -544,8 +525,6 @@ if (${lmdb}) set(LMDB_LIBS bareoslmdb) endif() - - # info what the config files need to be installed ##### PLUGINS ############ SET(PLUGINS python-ldap-conf.d) @@ -561,7 +540,6 @@ LIST(APPEND PLUGINS gfapi-conf.d) endif() ##### BACKENDS #### - IF(build_client_only) SET(BACKENDS "") ELSE() @@ -578,8 +556,6 @@ ELSE() endif() ENDIF() - - set(have_elasto "" ) set(support_systemd "" ) set(batch_insert_db_backends "" ) @@ -589,19 +565,15 @@ set(_PATH_BAREOS_BACKENDDIR \"${backenddir}\") set(_PATH_BAREOS_PIDDIR \"${piddir}\") set(_PATH_BAREOS_WORKINGDIR \"${workingdir}\") - - - IF(HAVE_WIN32) INSTALL(DIRECTORY DESTINATION var/log) ENDIF() INSTALL(DIRECTORY DESTINATION ${logdir}) - +INSTALL(DIRECTORY DESTINATION ${workingdir}) INCLUDE(BareosConfigureFile) - add_subdirectory(scripts) add_subdirectory(manpages) add_subdirectory(platforms) @@ -670,7 +642,7 @@ MESSAGE(" File Daemon Group: ${fd_group} ") MESSAGE(" ") MESSAGE(" Large file support: ${largefile_support}") MESSAGE(" Bareos conio support: ${got_conio} ${CONS_LIBS} ") -MESSAGE(" readline support: ${got_readline} ${Readline_ROOT_DIR} ${Readline_INCLUDE_DIR} ${Readline_LIBRARY} +MESSAGE(" readline support: ${got_readline} ROOT_DIR:${Readline_ROOT_DIR} INCLUDE_DIR:${Readline_INCLUDE_DIR} LIBRARY:${Readline_LIBRARY} ") MESSAGE(" TCP Wrappers support: ${WRAP_FOUND} ${WRAP_LIBRARIES} ${WRAP_INCLUDE_DIRS} ") MESSAGE(" TLS support: ${have_tls} ") @@ -707,6 +679,7 @@ MESSAGE(" Python support: ${PYTHONLIBS_FOUND} ${PYTHONLIBS_VERSI MESSAGE(" systemd support: ${WITH_SYSTEMD} ${SYSTEMD_UNITDIR}") MESSAGE(" Batch insert enabled: ${USE_BATCH_FILE_INSERT}") MESSAGE(" gtest support: ${GTEST_FOUND} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} ") +MESSAGE(" Intl support: ${Intl_FOUND} ${INTLINCLUDE_DIRS} ${INTL_LIBRARIES}") MESSAGE(" Dynamic cats backends: ${dynamic-cats-backends} ${HAVE_DYNAMIC_CATS_BACKENDS} ") MESSAGE(" Dynamic storage backends: ${dynamic-storage-backends} ${HAVE_DYNAMIC_SD_BACKENDS} ") diff --git a/core/cmake/BareosExtractVersionInfo.cmake b/core/cmake/BareosExtractVersionInfo.cmake index 2035008e220..43a75ca5f26 100644 --- a/core/cmake/BareosExtractVersionInfo.cmake +++ b/core/cmake/BareosExtractVersionInfo.cmake @@ -31,6 +31,12 @@ ENDIF() string(REGEX MATCH [0-9]+.[0-9]+.[0-9]+ BAREOS_NUMERIC_VERSION ${VERSION_STRING}) string(REGEX MATCH [0-9]+ SOVERSION ${VERSION_STRING}) +string(REPLACE "." ";" VERSION_LIST ${BAREOS_NUMERIC_VERSION}) +list(GET VERSION_LIST 0 BAREOS_VERSION_MAJOR) +list(GET VERSION_LIST 1 BAREOS_VERSION_MINOR) +list(GET VERSION_LIST 2 BAREOS_VERSION_PATCH) + + MESSAGE("BAREOS_NUMERIC_VERSION is ${BAREOS_NUMERIC_VERSION}") MESSAGE("BAREOS_FULL_VERSION is ${BAREOS_FULL_VERSION}") MESSAGE("SOVERSION is ${SOVERSION}") diff --git a/core/cmake/BareosInstallConfigFiles.cmake b/core/cmake/BareosInstallConfigFiles.cmake index 519950d4c92..56fdcc906db 100644 --- a/core/cmake/BareosInstallConfigFiles.cmake +++ b/core/cmake/BareosInstallConfigFiles.cmake @@ -21,9 +21,19 @@ MACRO(BareosInstallConfigFiles CONFDIR CONFIGBASEDIRECTORY PLUGINS BACKENDS SRC_DIR) - MESSAGE(STATUS "BareosInstallConfigFiles called with CONFDIR:${CONFDIR} CONFIGBASEDIRECTORY:${CONFIGBASEDIRECTORY} PLUGINS:${PLUGINS} BACKENDS:${BACKENDS} SRC_DIR:${SRC_DIR}") +MESSAGE(STATUS "BareosInstallConfigFiles called with CONFDIR:${CONFDIR} CONFIGBASEDIRECTORY:${CONFIGBASEDIRECTORY} PLUGINS:${PLUGINS} BACKENDS:${BACKENDS} SRC_DIR:${SRC_DIR}") +MESSAGE(STATUS "CPACK_PACKAGING_INSTALL_PREFIX: ${CPACK_PACKAGING_INSTALL_PREFIX}") +MESSAGE(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS "DESTDIR: $ENV{DESTDIR}") + +IF (IS_ABSOLUTE ${CONFDIR}) + set (DESTCONFDIR "$ENV{DESTDIR}${CONFDIR}/${CONFIGBASEDIRECTORY}/") +ELSE() + set (DESTCONFDIR "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CONFDIR}/${CONFIGBASEDIRECTORY}/") +ENDIF() + + -set (DESTCONFDIR "$ENV{DESTDIR}/${CONFDIR}/${CONFIGBASEDIRECTORY}/") MESSAGE(STATUS "installing configuration ${CONFIGBASEDIRECTORY} resource files to ${DESTCONFDIR}") MESSAGE(STATUS "globbing ${SRC_DIR}/src/defaultconfigs/${CONFIGBASEDIRECTORY}/*") @@ -34,12 +44,15 @@ foreach(resdir ${resourcedirs}) foreach(configfile ${configfiles}) get_filename_component(fname ${configfile} NAME) if (EXISTS ${DESTCONFDIR}/${resname}/${fname}) - MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname}.new (keep existing)") + MESSAGE(STATUS "${DESTCONFDIR}/${resname}/${fname} exists") + MESSAGE(STATUS "rename ${configfile} to ${configfile}.new") FILE (RENAME "${configfile}" "${configfile}.new") - FILE (COPY "${configfile}.new" DESTINATION "${DESTCONFDIR}/${resname}") + + MESSAGE(STATUS "copy ${configfile}.new to ${DESTCONFDIR}/${resname}") + FILE (INSTALL "${configfile}.new" DESTINATION "${DESTCONFDIR}/${resname}") FILE (RENAME "${configfile}.new" "${configfile}") else() - MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname} (keep existing)") + MESSAGE(STATUS "${resname}/${fname} as ${resname}/${fname} (new installation)") FILE (COPY "${configfile}" DESTINATION "${DESTCONFDIR}/${resname}") endif() endforeach() diff --git a/core/cmake/BareosSetVariableDefaults.cmake b/core/cmake/BareosSetVariableDefaults.cmake index ec15e118ee1..24a44180359 100644 --- a/core/cmake/BareosSetVariableDefaults.cmake +++ b/core/cmake/BareosSetVariableDefaults.cmake @@ -31,30 +31,30 @@ ENDIF() # libdir IF(NOT DEFINED libdir) - set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}) + set(libdir ${CMAKE_INSTALL_LIBDIR}/${CMAKE_PROJECT_NAME}) ENDIF() # includedir IF(NOT DEFINED includedir) - set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) + set(includedir ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}) ENDIF() # bindir IF(NOT DEFINED bindir) - set(bindir ${CMAKE_INSTALL_FULL_BINDIR}) + set(bindir ${CMAKE_INSTALL_BINDIR}) MESSAGE(STATUS "set bindir to default ${bindir}") ENDIF() # sbindir IF(NOT DEFINED sbindir) - set(sbindir ${CMAKE_INSTALL_FULL_SBINDIR}) + set(sbindir ${CMAKE_INSTALL_SBINDIR}) MESSAGE(STATUS "set sbindir to default ${sbindir}") ENDIF() # sysconfdir IF(NOT DEFINED sysconfdir) - set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR}) + set(sysconfdir ${CMAKE_INSTALL_SYSCONFDIR}) ENDIF() set(SYSCONFDIR "\"${sysconfdir}\"") @@ -70,7 +70,7 @@ ENDIF() # mandir IF(NOT DEFINED mandir) - set(mandir ${CMAKE_INSTALL_FULL_MANDIR}) + set(mandir ${CMAKE_INSTALL_MANDIR}) ENDIF() # docdir @@ -90,23 +90,23 @@ ENDIF() # backenddir IF(NOT DEFINED backenddir) - set(backenddir ${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}/backends) + set(backenddir ${CMAKE_INSTALL_LIBDIR}/${CMAKE_PROJECT_NAME}/backends) ENDIF() # scriptdir IF(NOT DEFINED scriptdir) - set(scriptdir "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_PROJECT_NAME}/scripts") + set(scriptdir "lib/${CMAKE_PROJECT_NAME}/scripts") ENDIF() # workingdir IF(NOT DEFINED workingdir) - set(workingdir "/${CMAKE_INSTALL_LOCALSTATEDIR}/lib/${CMAKE_PROJECT_NAME}") + set(workingdir "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/${CMAKE_PROJECT_NAME}") ENDIF() set(working_dir "${workingdir}") # plugindir IF(NOT DEFINED plugindir) - set(plugindir ${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}/plugins) + set(plugindir ${CMAKE_INSTALL_LIBDIR}/${CMAKE_PROJECT_NAME}/plugins) ENDIF() # piddir @@ -126,7 +126,7 @@ ENDIF() # datarootdir IF(NOT DEFINED datarootdir) - set(datarootdir "${CMAKE_INSTALL_FULL_DATAROOTDIR}") + set(datarootdir "${CMAKE_INSTALL_DATAROOTDIR}") ENDIF() # subsysdir diff --git a/core/platforms/CMakeLists.txt b/core/platforms/CMakeLists.txt index a2f42585516..bcb8d2ce386 100644 --- a/core/platforms/CMakeLists.txt +++ b/core/platforms/CMakeLists.txt @@ -17,24 +17,22 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. -IF(NOT client-only) - IF(NOT HAVE_WIN32) +IF(NOT HAVE_WIN32) - MESSAGE( STATUS "UNITDIR: " ${UNITDIR} ) - MESSAGE( STATUS "DISTNAME: " ${DISTNAME} ) + MESSAGE( STATUS "UNITDIR: " ${UNITDIR} ) + MESSAGE( STATUS "DISTNAME: " ${DISTNAME} ) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake) - if (${DISTNAME} STREQUAL ubuntu) - add_subdirectory(debian) - elseif (${DISTNAME} STREQUAL hpux) - MESSAGE( STATUS "DISTNAME: " ${DISTNAME} ) - else() - add_subdirectory(${DISTNAME}) - endif() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake) + if (${DISTNAME} STREQUAL ubuntu) + add_subdirectory(debian) + elseif (${DISTNAME} STREQUAL hpux) + MESSAGE( STATUS "DISTNAME: " ${DISTNAME} ) + else() + add_subdirectory(${DISTNAME}) + endif() - if (${systemd}) - add_subdirectory(systemd) - endif() + if (${systemd}) + add_subdirectory(systemd) + endif() - ENDIF() ENDIF() diff --git a/core/platforms/darwin/CMakeLists.txt b/core/platforms/darwin/CMakeLists.txt new file mode 100644 index 00000000000..72ebd226135 --- /dev/null +++ b/core/platforms/darwin/CMakeLists.txt @@ -0,0 +1,60 @@ +# BAREOS® - Backup Archiving REcovery Open Sourced +# +# Copyright (C) 2019-2019 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. + +INSTALL(FILES resources/org.bareos.bareos-fd.plist + DESTINATION "${scriptdir}") + +# cpack settings +SET(CPACK_PACKAGE_VENDOR "bareos.com") +SET(CPACK_PACKAGE_NAME "bareos-fd") +SET(CPACK_PACKAGE_HOMEPAGE_URL "https://www.bareos.com/") +SET(CPACK_PACKAGE_VERSION_MAJOR "${BAREOS_VERSION_MAJOR}") +SET(CPACK_PACKAGE_VERSION_MINOR "${BAREOS_VERSION_MINOR}") +SET(CPACK_PACKAGE_VERSION_PATCH "${BAREOS_VERSION_PATCH}") +SET(CPACK_MONOLITHIC_INSTALL FALSE) +SET(CPACK_COMPONENTS_ALL Unspecified) + +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Bareos File Daemon") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/description.txt") + +SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/bareos-logo.png") + + +SET(CPACK_PRODUCTBUILD_RESOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}/resources") + +SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_LIST_DIR}/resources/welcome.txt") +SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/resources/ReadMe.html") +SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/AGPL-3.0.txt") + + +SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-client-${BAREOS_VERSION_MAJOR}.${BAREOS_VERSION_MINOR}.${BAREOS_VERSION_PATCH}") +SET(CPACK_GENERATOR "productbuild") + +#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "bareos") + +# if unset, next points to goes to /Application +set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + +SET(CPACK_PREFLIGHT_UNSPECIFIED_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/resources/preinstall") +SET(CPACK_POSTFLIGHT_UNSPECIFIED_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/resources/postinstall") + +SET(CPACK_PREFLIGHT_BAREOS_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/resources/preinstall") +SET(CPACK_POSTFLIGHT_BAREOS_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/resources/postinstall") + +INCLUDE(CPACK) diff --git a/core/platforms/darwin/description.txt b/core/platforms/darwin/description.txt new file mode 100644 index 00000000000..4784e6a8c01 --- /dev/null +++ b/core/platforms/darwin/description.txt @@ -0,0 +1 @@ +This is the description. diff --git a/core/platforms/darwin/resources/ReadMe.html.in b/core/platforms/darwin/resources/ReadMe.html.in new file mode 100644 index 00000000000..84e5e28b87d --- /dev/null +++ b/core/platforms/darwin/resources/ReadMe.html.in @@ -0,0 +1,53 @@ + + + + + + Bareos File Daemon @BAREOS_NUMERIC_VERSION@ + + + + +

Bareos Client @BAREOS_NUMERIC_VERSION@ for MacOS X

+

+ Bareos is on Open Source, enterprise ready, network based backup program. + This installer package contains the Bareos File Daemon (and bconsole) for Mac OS X >= 10.5. +

+

Requirements

+

+ The Bareos File Daemon (bareos-fd) is only the client component of the backup system. + For proper operation the file daemon needs to be accessed by a Bareos + Director and Bareos Storage Daemon, typically installed on a (Linux) server machine in + the local network. +

+

Bareos File Daemon Configuration

+

+ To make use of your Bareos File Daemon on your system, it is required to configure the Bareos Director and the local Bareos File Daemon. + + Configure the server-side by follow the instructions at docs.bareos.org. + +

Restart bareos-fd after changing the configuration

+ + +The bareos-fd must be restarted to reread its configuration: + +
+sudo launchctl stop org.bareos.bareos-fd
+sudo launchctl start org.bareos.bareos-fd
+
+ + +Following command can be used to check its status: + +
+sudo launchctl list org.bareos.bareos-fd
+
+You can also manually start bareos-fd in debug mode by: +
+sudo /usr/local/sbin/bareos-fd -f -d 100
+
+ + diff --git a/core/platforms/darwin/resources/bareos-client.plist b/core/platforms/darwin/resources/bareos-client.plist new file mode 100644 index 00000000000..39c1efe9453 --- /dev/null +++ b/core/platforms/darwin/resources/bareos-client.plist @@ -0,0 +1,25 @@ + + + + + Label + bareos.bareos-fd + ProgramArguments + + /Applications/sbin/bareos-fd + -f + + + StandardOutPath + /usr/local/var/run/bareos-fd.log + + StandardErrorPath + /usr/local/var/run/bareos.log + + RunAtLoad + + + @CMAKE_INSTALL_PREFIX@ + + + diff --git a/core/platforms/osx/files/org.bareos.bareos-fd.plist.in b/core/platforms/darwin/resources/org.bareos.bareos-fd.plist.in similarity index 72% rename from core/platforms/osx/files/org.bareos.bareos-fd.plist.in rename to core/platforms/darwin/resources/org.bareos.bareos-fd.plist.in index 424f2d8abfa..15ebbc1c9ea 100644 --- a/core/platforms/osx/files/org.bareos.bareos-fd.plist.in +++ b/core/platforms/darwin/resources/org.bareos.bareos-fd.plist.in @@ -3,11 +3,10 @@ Label - org.bareos.bareos-fd - + bareos.bareos-fd ProgramArguments - @sbindir@/bareos-fd + @CMAKE_INSTALL_PREFIX@/@sbindir@/bareos-fd -f @@ -19,5 +18,8 @@ RunAtLoad + + WorkingDirectory + @CMAKE_INSTALL_PREFIX@ diff --git a/core/platforms/osx/resources/postinstall.in b/core/platforms/darwin/resources/postinstall.in similarity index 63% rename from core/platforms/osx/resources/postinstall.in rename to core/platforms/darwin/resources/postinstall.in index 036c4af44a8..9ddf45bf8f0 100755 --- a/core/platforms/osx/resources/postinstall.in +++ b/core/platforms/darwin/resources/postinstall.in @@ -1,10 +1,14 @@ #!/bin/sh - LOG=/tmp/bareos-client-postinstall.log date > $LOG echo "Postinstall. Parameter: $@" >> $LOG +cd @CMAKE_INSTALL_PREFIX@ +echo "doing cp -v @libdir@/org.bareos.bareos-fd.plist $3/Library/LaunchDaemons/org.bareos.bareos-fd.plist " >> $LOG +cp -v @scriptdir@/org.bareos.bareos-fd.plist $3/Library/LaunchDaemons/org.bareos.bareos-fd.plist >> $LOG + + @scriptdir@/bareos-config deploy_config "@configtemplatedir@" "@confdir@" bareos-fd >> $LOG 2>&1 @scriptdir@/bareos-config deploy_config "@configtemplatedir@" "@confdir@" bconsole >> $LOG 2>&1 diff --git a/core/platforms/osx/resources/preinstall.in b/core/platforms/darwin/resources/preinstall.in similarity index 99% rename from core/platforms/osx/resources/preinstall.in rename to core/platforms/darwin/resources/preinstall.in index 8eeae762e90..4d9b783212f 100755 --- a/core/platforms/osx/resources/preinstall.in +++ b/core/platforms/darwin/resources/preinstall.in @@ -11,4 +11,3 @@ if [ -f "$3/Library/LaunchDaemons/org.bareos.bareos-fd.plist" ]; then fi echo "finished" >> $LOG - diff --git a/core/platforms/darwin/resources/uninstall.command b/core/platforms/darwin/resources/uninstall.command new file mode 100644 index 00000000000..7c188b451bc --- /dev/null +++ b/core/platforms/darwin/resources/uninstall.command @@ -0,0 +1,29 @@ +#!/bin/sh + +echo "Bareos file daemon uninstaller" + +# Remove startup item +echo "* Bareos startup item... " +if [ -f /Library/LaunchDaemons/org.bareos.bareos-fd.plist ]; then + sudo launchctl unload /Library/LaunchDaemons/org.bareos.bareos-fd.plist + sudo rm /Library/LaunchDaemons/org.bareos.bareos-fd.plist + echo " + removed successfully" +else + echo " - not found, nothing to remove" +fi + +echo "* Bareos file daemon... " +if [ -d "/usr/local/bareos-" ]; then + sudo rm -r "/usr/local/bareos-" + echo " + removed successfully" +else + echo " - not found, nothing to remove" +fi + +echo "* Installer receipt... " +if [ -d "/Library/Receipts/Bareos File Daemon .pkg" ]; then + sudo rm -r "/Library/Receipts/Bareos File Daemon .pkg" + echo " + removed successfully" +else + echo " - not found, nothing to remove" +fi diff --git a/core/platforms/osx/files/uninstall.command.in b/core/platforms/darwin/resources/uninstall.command.in similarity index 100% rename from core/platforms/osx/files/uninstall.command.in rename to core/platforms/darwin/resources/uninstall.command.in diff --git a/core/platforms/darwin/resources/welcome.txt b/core/platforms/darwin/resources/welcome.txt new file mode 100644 index 00000000000..8a73dd1cf15 --- /dev/null +++ b/core/platforms/darwin/resources/welcome.txt @@ -0,0 +1 @@ +Welcome to the Bareos client 19.1.2 installer! diff --git a/core/platforms/darwin/resources/welcome.txt.in b/core/platforms/darwin/resources/welcome.txt.in new file mode 100644 index 00000000000..8efb7ad9b8b --- /dev/null +++ b/core/platforms/darwin/resources/welcome.txt.in @@ -0,0 +1 @@ +Welcome to the Bareos client @BAREOS_NUMERIC_VERSION@ installer! diff --git a/core/platforms/osx/Makefile-standalone.in b/core/platforms/osx/Makefile-standalone.in deleted file mode 100644 index c646049da96..00000000000 --- a/core/platforms/osx/Makefile-standalone.in +++ /dev/null @@ -1,149 +0,0 @@ -# -# This is the makefile template for the platform directory -# which contains general platform installation. -# -# 17 August 2009 -- Lorenz Schori -# -# for Bareos release @VERSION@ (@DATE@) -- @DISTNAME@ -# - -GITVERSION=$(shell git log --pretty=format:"%at" -1) - -# bareos version and download site -BAREOS_VERSION:=@VERSION@.git.$(GITVERSION) -BAREOS_DL_URL:=http://github.com/bareos/bareos/archive/Release/${BAREOS_VERSION}.tar.gz - -# Build universal binary -ARCHFLAGS:= -MACOSX_SDK_SYSROOT:= -MACOSX_VERSION_FLAGS:= - -# Tools -PB:=pkgbuild -MAKE:=/usr/bin/make -CURL:=/usr/bin/curl -TAR:=/usr/bin/tar - -########### you should not have to edit anything beyond this line ########### - -# Build paths -DL_DIR:=dl -BUILD_DIR:=build -PRODUCTS_DIR:=products - -WORKING_DIR:=${BUILD_DIR}/${BAREOS_VERSION} -BAREOS_TAR:=${DL_DIR}/bareos-${BAREOS_VERSION}.tar.gz -BAREOS_SOURCE:=${WORKING_DIR}/bareos-${BAREOS_VERSION} -BAREOS_DESTDIR:=${WORKING_DIR}/destdir -BAREOS_PREFIX:=/usr/local -BAREOS_FD_CONF:=${BAREOS_PREFIX}/etc/bareos/bareos-fd.conf -BAREOS_WORKING_DIR:=/var/run/bareos/working -#BAREOS_PMDOC:=${WORKING_DIR}/installer.pmdoc - -# Detect whether we sit inside the bareos source tree. In this case we won't -# download the tar from sourceforge but instead work with what its there -# already -CURSUB:=$(CURDIR:%/platforms/osx=%) -ifneq ($(CURDIR),$(CURSUB)) - BAREOS_TAR:= - BAREOS_SOURCE:=../../ -# BAREOS_VERSION:=$(shell sed -n 's,^VERSION=,,p' $(CURSUB)/autoconf/Make.common) -endif - -PACKAGE_TITLE:=bareos-filedaemon-${BAREOS_VERSION} -PACKAGE_ID:=org.bareos.bareos-fd.pkg -PACKAGE_DIR:=${PRODUCTS_DIR}/${PACKAGE_TITLE} -PACKAGE_BUNDLE:=${PACKAGE_DIR}/${PACKAGE_TITLE}.pkg -PACKAGE_DMG:=${PRODUCTS_DIR}/${PACKAGE_TITLE}.dmg -PACKAGE_RESOURCES:=ReadMe.html postflight preupgrade -PACKAGE_XRESOURCES:=postflight preupgrade - -# Flags for the toolchain -CONFIGFLAGS:=--enable-client-only --prefix=${BAREOS_PREFIX} \ - --with-dir-password=@DIR_PW@ --with-fd-password=@FD_PW@ \ - --with-sd-password=@SD_PW@ --with-mon-dir-password=@MON_DIR_PW@ \ - --with-mon-fd-password=@MON_FD_PW@ --with-mon-sd-password=@MON_SD_PW@ \ - --with-basename=@BASENAME@ --with-hostname=@HOSTNAME@ \ - --with-working-dir=${BAREOS_WORKING_DIR} -CPPFLAGS:= -CFLAGS:=-O -g -CXXFLAGS:=${CFLAGS} -LDFLAGS:= - -CC:=gcc -CPP:=cpp -CXX:=g++ -CXXPP:=cpp - -# Placeholders for *.in files -INFILE_SUBST=\ - -e "s,@PREFIX@,${BAREOS_PREFIX},g" \ - -e "s,@BAREOS_VERSION@,${BAREOS_VERSION},g" \ - -e "s,@FD_CONF@,${BAREOS_FD_CONF},g" \ - -e "s,@BAREOS_DESTDIR@,${BAREOS_DESTDIR},g" \ - -e "s,@PACKAGE_ID@,${PACKAGE_ID},g" - -nothing: - -all: dmg - -dmg: pkg - hdiutil create -srcfolder "${PACKAGE_DIR}" "${PACKAGE_DMG}" - -pkg: ${BAREOS_DESTDIR} ${WORKING_DIR}/resources - mkdir -p "${PACKAGE_DIR}" - mkdir -p "${CURDIR}/${BAREOS_DESTDIR}${BAREOS_WORKING_DIR}" - ${PB} --identifier "${PACKAGE_ID}" --root "${CURDIR}/${BAREOS_DESTDIR}" "bareos-${BAREOS_VERSION}.pkg" - - cp "bareos-${BAREOS_VERSION}.pkg" "${PACKAGE_DIR}" - cp ${WORKING_DIR}/resources/ReadMe.html "${PACKAGE_DIR}/ReadMe.html" - - # sed ${INFILE_SUBST} \ - # files/uninstall.command.in > "${PACKAGE_DIR}/uninstall.command"; - # chmod 0775 "${PACKAGE_DIR}/uninstall.command" - -${WORKING_DIR}/resources: ${BAREOS_DESTDIR} - mkdir -p "${WORKING_DIR}/resources" - - for res in ${PACKAGE_RESOURCES}; do \ - sed ${INFILE_SUBST} \ - resources/$$res.in > "${WORKING_DIR}/resources/$$res"; \ - done - - for xres in ${PACKAGE_XRESOURCES}; do \ - chmod +x "${WORKING_DIR}/resources/$$xres"; \ - done - - cp "${BAREOS_SOURCE}/LICENSE" "${WORKING_DIR}/resources/License.txt" - -install: - -${BAREOS_DESTDIR}: ${BAREOS_SOURCE} - (cd ${BAREOS_SOURCE} && ./configure ${CONFIGFLAGS} CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" CC="${CC}" CPP="${CPP}" CXX="${CXX}" CXXPP="${CXXPP}") - ${MAKE} -C ${BAREOS_SOURCE} - ${MAKE} -C ${BAREOS_SOURCE} install DESTDIR="${CURDIR}/${BAREOS_DESTDIR}" - - rm -rf "${BAREOS_DESTDIR}/tmp" - - for conffile in ${BAREOS_DESTDIR}${BAREOS_PREFIX}/etc/bareos/*.conf; do \ - mv $$conffile $$conffile.example; \ - done - - mkdir -p "${BAREOS_DESTDIR}/Library/LaunchDaemons" - sed ${INFILE_SUBST} ${CURDIR}/files/org.bareos.bareos-fd.plist.in \ - > "${BAREOS_DESTDIR}/Library/LaunchDaemons/org.bareos.bareos-fd.plist" - -${BAREOS_SOURCE}: ${BAREOS_TAR} - mkdir -p "${WORKING_DIR}" - ${TAR} -xzf "${BAREOS_TAR}" -C "${WORKING_DIR}" - -${BAREOS_TAR}: - mkdir -p "${DL_DIR}" - ${CURL} -L -o "${BAREOS_TAR}" "${BAREOS_DL_URL}" - -.PHONY: distclean clean install -distclean: clean - rm -rf "${DL_DIR}" "${PRODUCTS_DIR}" - -clean: - rm -rf "${BUILD_DIR}" "${PACKAGE_DIR}" "${PACKAGE_DMG}" diff --git a/core/platforms/osx/README b/core/platforms/osx/README deleted file mode 100644 index 1d81fdce251..00000000000 --- a/core/platforms/osx/README +++ /dev/null @@ -1,68 +0,0 @@ -Bareos file daemon package builder for Mac OS X -=============================================== - -This package build script lets you download, compile and package the bareos -file daemon easily with a single command line. Beside the bareos file daemon -the resulting installer package contains a short ReadMe file with instructions -on how to install and use the software. Also a basic launchd property list is -included along with preugrade and postflight installer scripts to stop and -restart the daemon while upgrading. To ensure the security of the users the -passwords in the configuration files are generated during a first time -installation and file permissions are checked and corrected on upgrades. - -Requirements: -* Mac OS X 10.5 or later (building/packaging), 10.4 or later (deployment) -* Mac OS X developer tools installed - -Example (compile and create package from within bareos source tree): - -platforms/osx/configure.sh -make -C platforms/osx/ all - - -make -c platforms/osx all -creates a pkg package file and from this a dmg file. -Instead of the parameter "all", you can call it also with "pkg" or "dmg". - -If you don't want to create packages, you can use following commands to install it directly: - -platforms/osx/configure.sh -make -make install DESTDIR="$DESTDIR" - - -By moving the contents of platforms/osx to some other directory (e.g. -~/bareos-standalone-bulder), it is possible to create installer packages from -older bareos versions and for specific platforms. - -Examples (standalone mode): - 1. Create an installer package from the newest supported bareos source - containing the bareos file daemon as a PPC/Intel universal binary. - $ make dmg - - 2. Create an installer package from a specified version of the bareos source - containing the bareos file daemon as a PPC/Intel universal binary. - $ make dmg BAREOS_VERSION=3.0.0 - - 3. Create an installer package from the newest supported bareos source - containing the bareos file daemon for PPC architecture only. - $ make dmg ARCHFLAGS="-arch ppc" PACKAGE_TITLE="Bareos File Daemon PPC x.y.z" - - 4. Create an installer package from a specified version of the bareos source - containing the bareos file daemon for the current architecture. - $ make dmg BAREOS_VERSION=2.4.4 ARCHFLAGS="" - -You find the built disk images in the products folder. - -Misc commands: - 1. Cleanup the build directory - $ make clean - 2. Additionally remove the downloads and products: - $ make distclean - -Additional notes on the build-script: - * The following *FLAGS are used tu build universal binary with 10.4 SDK: - CPPFLAGS=-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 - CFLAGS=-O -g -arch i386 -arch ppc - CXXFLAGS=${CFLAGS} - LDFLAGS=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch ppc diff --git a/core/platforms/osx/configure.sh b/core/platforms/osx/configure.sh deleted file mode 100755 index eba94d640df..00000000000 --- a/core/platforms/osx/configure.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -# TODO: why /usr/local? Use /usr instead? -BAREOS_PREFIX=/usr/local -#BAREOS_PMDOC=${WORKING_DIR}/installer.pmdoc - -# Flags for the toolchain -CONFIGFLAGS="--enable-client-only \ - --prefix=${BAREOS_PREFIX} \ - --with-archivedir=${BAREOS_PREFIX}/var/bareos \ - --with-configtemplatedir=${BAREOS_PREFIX}/lib/bareos/defaultconfigs \ - --with-scriptdir=${BAREOS_PREFIX}/lib/bareos/scripts \ - --with-plugindir=${BAREOS_PREFIX}/lib/bareos/plugins \ - --with-fd-password=XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX \ - --with-mon-fd-password=XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \ - --with-basename=XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX \ - --with-hostname=XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX \ - --with-python \ - " - -# failed to compile console -# --disable-conio --enable-readline \ - - -#export CPPFLAGS= -#export CFLAGS="-g -Wall -O2" -export CFLAGS="-g -O2" -export CXXFLAGS="${CFLAGS}" -#export LDFLAGS= - -./configure ${CONFIGFLAGS} "$@" - diff --git a/core/platforms/osx/files/installer.pmdoc/01destdir.xml.in b/core/platforms/osx/files/installer.pmdoc/01destdir.xml.in deleted file mode 100644 index cb105d625f4..00000000000 --- a/core/platforms/osx/files/installer.pmdoc/01destdir.xml.in +++ /dev/null @@ -1,27 +0,0 @@ - - - - @PACKAGE_ID@ - @BAREOS_VERSION@ - - - - destdir - / - - - - - version - identifier - parent - - - resources/postflight - resources/preupgrade - - - 01destdir-contents.xml - /\.DS_Store$ - - diff --git a/core/platforms/osx/files/installer.pmdoc/index.xml.in b/core/platforms/osx/files/installer.pmdoc/index.xml.in deleted file mode 100644 index 61ade5561ab..00000000000 --- a/core/platforms/osx/files/installer.pmdoc/index.xml.in +++ /dev/null @@ -1,30 +0,0 @@ - - - - Bareos File Daemon @BAREOS_VERSION@ - org.bareos - - - - - - - - - - - - - - - - resources/License.txt - resources/ReadMe.html - - - - 01destdir.xml - properties.title - properties.anywhereDomain - properties.systemDomain - diff --git a/core/platforms/osx/installer-gencontents.py b/core/platforms/osx/installer-gencontents.py deleted file mode 100644 index d807415ecbf..00000000000 --- a/core/platforms/osx/installer-gencontents.py +++ /dev/null @@ -1,56 +0,0 @@ -import os -import stat -import sys -from xml.dom.minidom import Document - -def createFtags(doc, path, isrootpath=True): - """ - create f-tags for packagemaker's contents.xml files recursively replacing - owner with "root" and group with "wheel" in each entry - """ - - statinfo = os.lstat(path) - isdir = stat.S_ISDIR(statinfo[0]) - - ftag = doc.createElement("f") - ftag.setAttribute("n",os.path.split(path)[1]) - ftag.setAttribute("p","%d" % statinfo[0]) - ftag.setAttribute("o","root") - ftag.setAttribute("g","wheel") - - # we additionally have to create owner and group - # within each f-tag - ftag.appendChild(doc.createElement("mod").appendChild(doc.createTextNode("owner"))) - ftag.appendChild(doc.createElement("mod").appendChild(doc.createTextNode("group"))) - - if isrootpath: - # needs to be the full path - ftag.setAttribute("pt",os.path.abspath(path)) - # no idea what those attributes mean: - ftag.setAttribute("m","false") - ftag.setAttribute("t","file") - - if isdir: - for item in os.listdir(path): - ftag.appendChild(createFtags(doc, os.path.join(path,item), False)) - - return ftag - -def generateContentsDocument(path): - """ - create new minidom document and generate contents by recursively traver- - sing the given path. - """ - - doc = Document() - root = doc.createElement("pkg-contents") - root.setAttribute("spec","1.12") - root.appendChild(createFtags(doc, path)) - doc.appendChild(root) - - return doc - -if __name__ == "__main__": - # construct document - doc = generateContentsDocument(sys.argv[1]) - print doc.toprettyxml(indent=" "), diff --git a/core/platforms/osx/resources/ReadMe.html.in b/core/platforms/osx/resources/ReadMe.html.in deleted file mode 100644 index d413b073eaf..00000000000 --- a/core/platforms/osx/resources/ReadMe.html.in +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - Bareos File Daemon @BAREOS_VERSION@ - - - - - -

Bareos Client @BAREOS_VERSION@ under MacOS X

-

- Bareos is on Open Source, enterprise ready, network based backup program. - This installer package contains the Bareos File Daemon (and bconsole) for Mac OS X >= 10.5. -

- -

Requirements

-

- The Bareos File Daemon (bareos-fd) is only the client component of the backup system. - For proper operation the file daemon needs to have access to a Bareos - Director and Bareos Storage Daemon, typically installed on a (Linux) server machine in - the local network. -

- -

Installation

-

- - On your local Mac, you must be admin user. The main user is an admin user. - -Download bareos-client at  - -

-http://download.bareos.org/bareos/release/latest/MacOS/bareos-client-@BAREOS_VERSION@.pkg -

- -(or http://download.bareos.org/bareos/experimental/nightly/MacOS/bareos-client-@BAREOS_VERSION@.pkg). - -

-Find the .pkg you just downloaded. Install the .pkg by holding ‚ctrl’, left-clicking the installer and choosing ‚open’ (normal double-click won’t work due to Apple’s security restrictions). - -Follow the directions given to you and finish the installation. -

- -

Bareos File Daemon Configuration

-

- To make use of your Bareos File Daemon on your system, it is required to configure the Bareos Director and the local Bareos File Daemon. - - Configure the server-side by follow the instructions at Adding A Client. - - After configuring the server-side you can either configure the client locally or - transfer the necessary configuration file using following command, assuming your client has the DNS entry client2.example.com added the client as client2-fd: - -

Option 1: Copy the director resource from the Bareos Director to the Client

- -
scp /etc/bareos/bareos-dir-export/client/client2-fd/bareos-fd.d/director/bareos-dir.conf root@client2.example.com:/usr/local/etc/bareos/bareos-fd.d/director/
- -This differs in so far, as on Linux the configuration files are located under -
/etc/bareos/
-while on MacOS they are located at -
/usr/local/etc/bareos
- -

Option 2: Edit the director resource on the Client

- -Alternatively, you can edit the file
/usr/local/etc/bareos/bareos-fd.d/director/bareos-dir.conf
- -This can be done by right-clicking the finder icon in your task bar, select ‚Go to folder ...‘ and paste
/usr/local/etc/bareos/bareos-fd.d/director/
- -Select the -
bareos-dir.conf
-file and open it. - -You can also call -
open -t /usr/local/etc/bareos/bareos-fd.d/director/bareos-dir.conf
on the console. - -The file should look similar to this: - -
- Director {
-  Name = bareos-dir
-  Password = "SOME_RANDOM_PASSWORD"
-  Description = "Allow the configured Director to access this file daemon."
-}
-
- -Set this client-side password to the same value as given on the server-side. - - -

Restart bareos-fd after changing the configuration

- - -The bareos-fd must be restarted to reread its configuration: - -
-sudo launchctl stop org.bareos.bareos-fd
-sudo launchctl start org.bareos.bareos-fd
-
- - -Following command can be used to check its status: - -
-sudo launchctl list org.bareos.bareos-fd
-
- - -

Verify that the Bareos File Daemon is working

- -Open the bconsole on your Director and check the status of the client with - -
-*status client=client2-fd
-
- - -In case, bareos-fd does not react, following command are useful the verify the status: - -
-# check if bareos-fd is started by system:
-sudo launchctl list org.bareos.bareos-fd
-
-# get process id (PID) of bareos-fd
-pgrep bareos-fd
-
-# show files opened by bareos-fd
-sudo lsof -p `pgrep bareos-fd`
-
-# check what process is listening on the bareos-fd port
-sudo lsof -n -iTCP:9102 | grep LISTEN
-
- - -You can also manually start bareos-fd in debug mode by: - -
-sudo /usr/local/sbin/bareos-fd -f -d 100
-
- - - - - -

Resources

-

- Refer to the bareos website for more information: http://www.bareos.org -

- - - diff --git a/core/scripts/CMakeLists.txt b/core/scripts/CMakeLists.txt index 03c8d6bd1d8..1a6e164234c 100644 --- a/core/scripts/CMakeLists.txt +++ b/core/scripts/CMakeLists.txt @@ -25,8 +25,6 @@ INSTALL(FILES WORLD_READ WORLD_EXECUTE DESTINATION "${sbindir}") - # todo: bareos_config (contains output of configure command) - INSTALL(FILES bareos btraceback.gdb diff --git a/core/src/CMakeLists.txt b/core/src/CMakeLists.txt index 5866a28a853..7cc7fe08794 100644 --- a/core/src/CMakeLists.txt +++ b/core/src/CMakeLists.txt @@ -23,7 +23,7 @@ IF(NOT client-only) add_subdirectory(tests) ENDIF() add_subdirectory(cats) - IF(NOT HAVE_WIN32) + IF(NOT HAVE_WIN32 AND ndmp) add_subdirectory(ndmp) ENDIF() add_subdirectory(dird) diff --git a/core/src/console/CMakeLists.txt b/core/src/console/CMakeLists.txt index 934ccceaa06..9b86e1a1755 100644 --- a/core/src/console/CMakeLists.txt +++ b/core/src/console/CMakeLists.txt @@ -23,6 +23,8 @@ IF(HAVE_WIN32) LIST(APPEND BCONSSRCS ../win32/console/consoleres.rc) ENDIF() +include_directories(${Readline_INCLUDE_DIR}) + IF(HAVE_PAM) include_directories(${PAM_INCLUDE_DIRS}) LIST(APPEND BCONSSRCS auth_pam.cc) diff --git a/core/src/filed/CMakeLists.txt b/core/src/filed/CMakeLists.txt index f1c6824aa05..c58f972f955 100644 --- a/core/src/filed/CMakeLists.txt +++ b/core/src/filed/CMakeLists.txt @@ -73,6 +73,10 @@ target_link_libraries(bareos-fd ${BAREOS_FD_LIBRARIES} ) +IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set_target_properties(bareos-fd PROPERTIES INSTALL_RPATH "@loader_path/../${libdir}") +ENDIF() + INSTALL(TARGETS bareos-fd DESTINATION "${sbindir}") diff --git a/core/src/lib/CMakeLists.txt b/core/src/lib/CMakeLists.txt index c58fb309c7c..b602b911c70 100644 --- a/core/src/lib/CMakeLists.txt +++ b/core/src/lib/CMakeLists.txt @@ -17,6 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. +IF(NOT client-only) set(INCLUDE_FILES ../include/baconfig.h ../include/bareos.h ../include/bc_types.h ../include/config.h ../include/jcr.h ../include/version.h @@ -32,9 +33,10 @@ set(INCLUDE_FILES ../include/baconfig.h ../include/bareos.h var.h watchdog.h workq.h) INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${includedir}) +ENDIF() include_directories( - ${OPENSSL_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIRS} ${FASTLZ_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} diff --git a/core/src/ndmp/CMakeLists.txt b/core/src/ndmp/CMakeLists.txt index 7a995f5eb2c..fae5af6440d 100644 --- a/core/src/ndmp/CMakeLists.txt +++ b/core/src/ndmp/CMakeLists.txt @@ -75,8 +75,11 @@ set(NDMJOB_SRCS ndmjob_args.c ndmjob_fhdb.c ndmjob_job.c ndmjob_main.c set(LIBBAREOSNDMP_SRCS ${NDMP_PROTO_SRCS} ${NDMP_LIB_SRCS} ${NDMP_AGENT_SRCS} ${NDMP_HELPER_SRCS}) -set(RPCGEN_PARAMS "-CM") - +IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(RPCGEN_PARAMS "-C") +ELSE() + set(RPCGEN_PARAMS "-CM") +ENDIF() # create files with rpcgen diff --git a/core/src/plugins/filed/CMakeLists.txt b/core/src/plugins/filed/CMakeLists.txt index 676ef61b4c0..854280791d2 100644 --- a/core/src/plugins/filed/CMakeLists.txt +++ b/core/src/plugins/filed/CMakeLists.txt @@ -45,7 +45,7 @@ ENDIF() add_library(bpipe-fd MODULE bpipe-fd.cc) set_target_properties(bpipe-fd PROPERTIES PREFIX "") INSTALL(TARGETS bpipe-fd DESTINATION ${plugindir}) -IF(HAVE_WIN32) +IF(HAVE_WIN32 OR HAVE_DARWIN_OS) target_link_libraries(bpipe-fd bareos) ENDIF() diff --git a/core/src/plugins/stored/CMakeLists.txt b/core/src/plugins/stored/CMakeLists.txt index 34ebd59dd61..060bc4bfea7 100644 --- a/core/src/plugins/stored/CMakeLists.txt +++ b/core/src/plugins/stored/CMakeLists.txt @@ -34,15 +34,17 @@ set_target_properties(autoxflate-sd PROPERTIES PREFIX "") target_link_libraries(autoxflate-sd bareos) INSTALL(TARGETS autoxflate-sd DESTINATION ${plugindir}) -IF(NOT HAVE_WIN32) +IF(NOT HAVE_WIN32 AND NOT HAVE_DARWIN_OS) add_library(scsicrypto-sd MODULE scsicrypto-sd.cc) set_target_properties(scsicrypto-sd PROPERTIES PREFIX "") - #target_link_libraries(scsicrypto-sd bareos) INSTALL(TARGETS scsicrypto-sd DESTINATION ${plugindir}) add_library(scsitapealert-sd MODULE scsitapealert-sd.cc) set_target_properties(scsitapealert-sd PROPERTIES PREFIX "") INSTALL(TARGETS scsitapealert-sd DESTINATION ${plugindir}) + IF(HAVE_DARWIN_OS) + target_link_libraries(scsitapealert-sd bareossd) + ENDIF() ENDIF() IF(HAVE_PYTHON) diff --git a/core/src/stored/CMakeLists.txt b/core/src/stored/CMakeLists.txt index 13444ebfbc3..4794c1bad34 100644 --- a/core/src/stored/CMakeLists.txt +++ b/core/src/stored/CMakeLists.txt @@ -170,6 +170,10 @@ if(NOT ${HAVE_DYNAMIC_SD_BACKENDS}) target_link_libraries(bareossd ${LIBBAREOSSD_LIBRARIES}) endif() +IF(HAVE_DARWIN_OS) + target_link_libraries(bareossd bareos) +ENDIF() + add_library(stored_objects STATIC ${SDSRCS}) add_executable(bareos-sd stored.cc) diff --git a/core/src/stored/backends/CMakeLists.txt b/core/src/stored/backends/CMakeLists.txt index eb9153d0da7..cd58216cbbe 100644 --- a/core/src/stored/backends/CMakeLists.txt +++ b/core/src/stored/backends/CMakeLists.txt @@ -55,11 +55,17 @@ add_library(bareossd-elasto MODULE elasto_device.cc) add_library(bareossd-fifo MODULE unix_fifo_device.cc) INSTALL(TARGETS bareossd-fifo DESTINATION ${backenddir}) +IF(HAVE_DARWIN_OS) + target_link_libraries(bareossd-fifo bareos bareossd) +ENDIF() add_library(bareossd-gentape SHARED generic_tape_device.cc) INSTALL(TARGETS bareossd-gentape DESTINATION ${backenddir}) +IF(HAVE_DARWIN_OS) + target_link_libraries(bareossd-gentape bareos bareossd) +ENDIF() add_library(bareossd-tape MODULE unix_tape_device.cc) INSTALL(TARGETS bareossd-tape DESTINATION ${backenddir})