Skip to content

Commit

Permalink
Merge pull request #1538
Browse files Browse the repository at this point in the history
Improve FreeBSD build
  • Loading branch information
BareosBot committed Jan 10, 2024
2 parents 115b3eb + 92c86ff commit fbf4961
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 89 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- backup report: show negative compression [PR #1598]
- core: add build patch for `sprintf` in macos builds [PR #1636]
- python-bareos: use socket.create_connection() to allow AF_INET6 [PR #1646]
- Improve FreeBSD build [PR #1538]

### Removed
- plugins: remove old deprecated postgres plugin [PR #1606]
Expand All @@ -33,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix continuation on colons in plugin baseclass [PR #1637]
- plugins: fix cancel handling crash [PR #1595]

[PR #1538]: https://github.com/bareos/bareos/pull/1538
[PR #1581]: https://github.com/bareos/bareos/pull/1581
[PR #1587]: https://github.com/bareos/bareos/pull/1587
[PR #1589]: https://github.com/bareos/bareos/pull/1589
Expand Down
21 changes: 15 additions & 6 deletions cmake/BareosExtractVersionInfo.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2021 Bareos GmbH & Co. KG
# Copyright (C) 2017-2023 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
Expand Down Expand Up @@ -69,11 +69,20 @@ message("BAREOS_NUMERIC_VERSION is ${BAREOS_NUMERIC_VERSION}")
message("BAREOS_FULL_VERSION is ${BAREOS_FULL_VERSION}")

if(VERSION_TIMESTAMP GREATER 0)
include(BareosTimeFunctions)
timestamp_at("${VERSION_TIMESTAMP}" DATE "%d %B %Y")
timestamp_at("${VERSION_TIMESTAMP}" BAREOS_SHORT_DATE "%d%b%y")
timestamp_at("${VERSION_TIMESTAMP}" BAREOS_YEAR "%Y")
timestamp_at("${VERSION_TIMESTAMP}" BAREOS_PROG_DATE_TIME "%Y-%m-%d %H:%M:%S")
if(DEFINED ENV{SOURCE_DATE_EPOCH})
set(_old_source_date_epoch "$ENV{SOURCE_DATE_EPOCH}")
endif()
set(ENV{SOURCE_DATE_EPOCH} "${VERSION_TIMESTAMP}")
string(TIMESTAMP DATE "%d %B %Y" UTC)
string(TIMESTAMP BAREOS_SHORT_DATE "%d%b%y" UTC)
string(TIMESTAMP BAREOS_YEAR "%Y" UTC)
string(TIMESTAMP BAREOS_PROG_DATE_TIME "%Y-%m-%d %H:%M:%S" UTC)
if(DEFINED _old_source_date_epoch)
set(ENV{SOURCE_DATE_EPOCH} "${_old_source_date_epoch}")
unset(_old_source_date_epoch)
else()
unset(ENV{SOURCE_DATE_EPOCH})
endif()
else()
message(FATAL_ERROR "VERSION_TIMESTAMP is not set")
endif()
Expand Down
49 changes: 0 additions & 49 deletions core/cmake/BareosTimeFunctions.cmake

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,17 @@ USES+=gettext-runtime
USES+=readline

USES+= libtool:keepla pkgconfig readline:port
#USES+=cmake:outsource
#USES+=cmake
USES+=cmake:noninja
USES+=shebangfix
USES+=python:env

USE_LDCONFIG= yes

LDFLAGS+= -L${LOCALBASE}/lib
LDFLAGS+= -lz
LDFLAGS+= -ljansson
LDFLAGS+= -lcrypto

CPPFLAGS+= -I/usr/include/readline
CPPFLAGS+= -I${LOCALBASE}/include

LIB_DEPENDS+= liblzo2.so:archivers/lzo2 \
libjansson.so:devel/jansson
LIB_DEPENDS+= libpython3.7m.so:lang/python37
libjansson.so:devel/jansson \
libpython${_PYVERSION}.so:lang/python${PYTHON_SUFFIX}

_PYVERSION= ${PYTHON_VER}${PYTHON_ABIVER}

# optional overrides, used by build system.
.-include "BareosCommonMakefile-overrides.mk"
Expand All @@ -83,6 +76,7 @@ CMAKE_SOURCE_PATH= ${WRKSRC}
CMAKE_ARGS+= -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DCMAKE_INSTALL_LIBDIR:PATH=/usr/local/lib \
-DCMAKE_INSTALL_MANDIR:PATH=/usr/local/man \
-DINCLUDE_INSTALL_DIR:PATH=/usr/include \
-DLIB_INSTALL_DIR:PATH=/usr/local/lib \
-DSYSCONF_INSTALL_DIR:PATH=/etc \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ lib/bareos/scripts/ddl/updates/postgresql.2003_2004.sql
lib/bareos/scripts/ddl/updates/postgresql.2004_2171.sql
lib/bareos/scripts/ddl/updates/postgresql.2171_2192.sql
lib/bareos/scripts/ddl/updates/postgresql.2192_2210.sql
lib/bareos/scripts/ddl/updates/postgresql.2210_2230.sql
lib/bareos/scripts/ddl/updates/postgresql.bee.1017_2004.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ lib/bareos/plugins/python-dir.so
lib/bareos/plugins/BareosDirPluginBaseclass.py
lib/bareos/plugins/bareos-dir-class-plugin.py
lib/bareos/plugins/BareosDirWrapper.py
%%PYTHON_SITELIBDIR%%/bareosdir%%PYTHON_EXT_SUFFIX%%.so
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

lib/bareos/plugins/python3-fd.so
lib/python3.7/site-packages/bareosfd.so
%%PYTHON_SITELIBDIR%%/bareosfd%%PYTHON_EXT_SUFFIX%%.so
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ lib/bareos/plugins/python-sd.so
lib/bareos/plugins/BareosSdPluginBaseclass.py
lib/bareos/plugins/BareosSdWrapper.py
lib/bareos/plugins/bareos-sd-class-plugin.py
%%PYTHON_SITELIBDIR%%/bareossd%%PYTHON_EXT_SUFFIX%%.so
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MASTERDIR= ${.CURDIR}/../bareos.com-common

LIB_DEPENDS+= libbareos.so:sysutils/bareos.com-common

USES+=python:3.7
USES+=python

# optional overrides, used by build system.
.-include "overrides.mk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MASTERDIR= ${.CURDIR}/../bareos.com-common

LIB_DEPENDS+= libbareos.so:sysutils/bareos.com-common

USES+=python:3.7
USES+=python

# optional overrides, used by build system.
.-include "overrides.mk"
Expand Down
19 changes: 10 additions & 9 deletions core/src/lib/jcr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,15 +499,16 @@ static std::shared_ptr<JobControlRecord> GetJcr(
[](std::weak_ptr<JobControlRecord>& p) { return p.expired(); }),
job_control_record_cache.end());

find_if(job_control_record_cache.begin(), job_control_record_cache.end(),
[&compare, &result](std::weak_ptr<JobControlRecord>& p) {
auto jcr = p.lock();
if (compare(jcr.get())) {
result = jcr;
return true;
}
return false;
});
std::ignore = find_if(
job_control_record_cache.begin(), job_control_record_cache.end(),
[&compare, &result](std::weak_ptr<JobControlRecord>& p) {
auto jcr = p.lock();
if (compare(jcr.get())) {
result = jcr;
return true;
}
return false;
});

UnlockJcrChain();

Expand Down
22 changes: 12 additions & 10 deletions systemtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,19 @@ else()
set(TEST_INFO_TEXT "running system tests on the sourcetree")
endif()

execute_process(
COMMAND "${CMAKE_BINARY_DIR}/systemtests/scripts/generate_minio_certs.sh"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/systemtests/tls/minio/"
RESULT_VARIABLE RESULT_GENERATE_MINIO_CERTS
OUTPUT_QUIET ERROR_QUIET
)
if(NOT "${RESULT_GENERATE_MINIO_CERTS}" STREQUAL "0")
message(
FATAL_ERROR
"Creation of certificates failed: ${RESULT_GENERATE_MINIO_CERTS} ${CMAKE_BINARY_DIR}"
if(MINIO)
execute_process(
COMMAND "${CMAKE_BINARY_DIR}/systemtests/scripts/generate_minio_certs.sh"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/systemtests/tls/minio/"
RESULT_VARIABLE RESULT_GENERATE_MINIO_CERTS
OUTPUT_QUIET ERROR_QUIET
)
if(NOT "${RESULT_GENERATE_MINIO_CERTS}" STREQUAL "0")
message(
FATAL_ERROR
"Creation of certificates failed: ${RESULT_GENERATE_MINIO_CERTS} ${CMAKE_BINARY_DIR}"
)
endif()
endif()

configure_file(
Expand Down

0 comments on commit fbf4961

Please sign in to comment.