diff --git a/sysutils/bareos24-server/Makefile b/sysutils/bareos24-server/Makefile index 720e0b801bc3..04db614e4ece 100644 --- a/sysutils/bareos24-server/Makefile +++ b/sysutils/bareos24-server/Makefile @@ -1,235 +1,235 @@ PORTNAME= bareos DISTVERSIONPREFIX= Release/ DISTVERSION= 24.0.8 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES?= sysutils PKGNAMEPREFIX?= # PKGNAMESUFFIX?= 24-server MAINTAINER= acm@FreeBSD.org COMMENT?= Backup archiving recovery open sourced (server) WWW= https://www.bareos.org/ LICENSE= AGPLv3 LGPL3 LICENSE_COMB= multi -BROKEN= data type bugs, "core/src/stored/backends/chunked_device.cc:685:13: error: comparison of integers of different signs: 'ssize_t' (aka 'int') and 'uint32_t' (aka 'unsigned int')" - -CONFLICTS?= bareos22-server bareos23-server bareos-server +CONFLICTS?= bareos23-server bareos-server BUILD_DEPENDS+= utf8cpp>0:devel/utf8cpp \ microsoft-gsl>0:devel/microsoft-gsl \ xxhash>0:devel/xxhash \ tl-expected>0:devel/tl-expected \ cli11>0:devel/cli11 RUN_DEPENDS= bash:shells/bash LIB_DEPENDS+= liblzo2.so:archivers/lzo2 \ libjansson.so:devel/jansson \ libfmt.so:devel/libfmt \ libxxhash.so:devel/xxhash USES+= cmake compiler:c++11-lang cpe localbase:ldflags perl5 pkgconfig readline \ shebangfix USE_GITHUB= yes USE_PERL5= run USERS= bareos GROUPS= ${USERS} PLIST_SUB+= LIB_VERSION=${PORTVERSION} USE_LDCONFIG= yes SHEBANG_LANG= bash perl python SHEBANG_GLOB= *.sh *.py SHEBANG_FILES= ${WRKSRC}/contrib/misc/bsmc/bin/bsmc CPPFLAGS+= -I${LOCALBASE}/readline OPTIONS_DEFAULT= OPENSSL OPTIONS_SINGLE= CRYPTO OPTIONS_SINGLE_CRYPTO= OPENSSL GNUTLS OPTIONS_SUB= yes CRYPTO_DESC= Cryptographic library MTX_DESC= Install mtx for control of autochanger devices NDMP_DESC= Enable build of NDMP support SCSICRYPTO_DESC= Build LTO AME crypto plugin .if ${PKGNAMESUFFIX} == "24-server" +ONLY_FOR_ARCHS= aarch64 amd64 + OPTIONS_DEFINE= MTX PYTHON LMDB NDMP NLS SCSICRYPTO OPTIONS_DEFAULT+= LMDB PGSQL SCSICRYPTO OPTIONS_SINGLE_DATABASE= PGSQL OPTIONS_SINGLE+= DATABASE BACKENDS_DESC= Storage backends DATABASE_DESC= Database support LMDB_DESC= Enable faster accurate backup support NDMP_CMAKE_ON= -Dndmp=ON NDMP_CMAKE_OFF= -Dndmp=OFF .endif GNUTLS_CONFIGURE_WITH= gnutls=${LOCALBASE} GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls OPENSSL_USES= ssl OPENSSL_CMAKE_ON= -Dopenssl=ON OPENSSL_CMAKE_OFF= -Dopenssl=OFF SCSICRYPTO_CMAKE_ON= -Dscsi-crypto=ON SCSICRYPTO_CMAKE_OFF= -Dscsi-crypto=OFF .if ${PKGNAMESUFFIX} == "24-client" || ${PKGNAMESUFFIX} == "24-server" #Till end of the file PYTHON_USES= python PYTHON_CMAKE_ON= -DENABLE_PYTHON=ON PYTHON_CMAKE_OFF= -DENABLE_PYTHON=OFF PYTHON_PLUGIN= yes .if !defined(WITH_CLIENT_ONLY) LIB_DEPENDS+= libbareos.so:sysutils/bareos24-client USE_RC_SUBR?= bareos-dir bareos-sd .endif .if defined(WITH_CLIENT_ONLY) SUB_FILES+= pkg-install.client pkg-deinstall.client pkg-message.client .else SUB_FILES+= pkg-message.server .endif CMAKE_ARGS+= -Dtcp-wrappers=ON \ -Dsmartalloc=ON \ -Dsysconfdir=${PREFIX}/etc \ -Darchivedir=${BAREOS_DIR}/storage \ -Dworkingdir=${BAREOS_DIR} \ -Dconfdir=${PREFIX}/etc/bareos \ -Dlibdir=${PREFIX}/lib \ -Dlogdir=/var/log/bareos \ -Dincludedir=${PREFIX}/include/bareos \ -Dreadline=ON \ -Ddisable-conio=ON \ -Dbatch-insert=ON \ -Dhave_plugins=ON \ -Dplugindir=${PREFIX}/lib/bareos/plugins \ -Dscriptdir=${PREFIX}/lib/bareos/scripts \ -Dbackenddir=${PREFIX}/lib/bareos/backends \ -Ddump_email=root@localhost \ -Djob_email=root@localhost \ -Ddb_name=bareos \ -Dsbin-perm=755 \ -Ddb_user=bareos \ -Dbaseport=9101 \ -Dpiddir=/var/run/bareos .if defined(WITH_CLIENT_ONLY) CFLAGS+= -DMDB_DSYNC=O_SYNC -DMDB_USE_POSIX_SEM=1 CMAKE_ARGS+= -Dfd-user=root \ -Dfd-group=wheel \ -Dlmdb=ON .else LMDB_CMAKE_ON= -Dlmdb=ON LMDB_CMAKE_OFF= -Dlmdb=OFF LMDB_CFLAGS+= -DMDB_DSYNC=O_SYNC -DMDB_USE_POSIX_SEM=1 CMAKE_ARGS+= -Ddir-user=${BAREOS_USER} \ -Ddir-group=${BAREOS_GROUP} \ -Dsd-user=${BAREOS_USER} \ -Dsd-group=operator .endif # The user/group IDs below are registered, see # http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#DADS-UID # BAREOS_USER?= bareos BAREOS_GROUP?= ${BAREOS_USER} BAREOS_UID?= 997 BAREOS_GID?= ${BAREOS_UID} BAREOS_DIR?= /var/db/bareos PLIST_SUB+= BAREOS_DIR=${BAREOS_DIR} SUB_LIST= BAREOS_USER=${BAREOS_USER} \ BAREOS_GROUP=${BAREOS_GROUP} \ BAREOS_UID=${BAREOS_UID} \ BAREOS_GID=${BAREOS_GID} \ BAREOS_DIR=${BAREOS_DIR} NLS_USES= gettext NLS_CMAKE_ON= -Dnls=ON # Client only or full server version .if defined(WITH_CLIENT_ONLY) CONFFILES= fd CMAKE_ARGS+= -Dclient-only=ON \ -DENABLE_WEBUI=OFF PKGDEINSTALL= ${FILESDIR}/pkg-deinstall.client PKGINSTALL= ${FILESDIR}/pkg-install.client .else # Server only Options CONFFILES= sd dir CMAKE_ARGS+= -Dbuild-dird=ON \ -Dbuild-stored=ON \ -Dbuild_client_only=OFF \ -DENABLE_WEBUI=OFF # Server default database MTX_RUN_DEPENDS= ${LOCALBASE}/sbin/mtx:misc/mtx PGSQL_CMAKE_ON= -Dpostgresql=ON PGSQL_USES= pgsql PGSQL_SUB_LIST= REQ_PGSQL=postgresql PGSQL_SUB_LIST_OFF= REQ_PGSQL="" .endif .if defined(WITH_CLIENT_ONLY) MP1+= bconsole.1 MP8+= bareos-fd.8 .else MP8+= bareos.8 bareos-dir.8 bareos-sd.8 bcopy.8 bextract.8 bls.8 bscan.8 \ btape.8 btraceback.8 bareos-dbcheck.8 MP1+= bsmtp.1 bregex.1 bwild.1 bareos-tray-monitor.1 .endif MAKE_ENV+= MAN8="${MP8}" MAN1="${MP1}" post-patch: .if ${PKGNAMESUFFIX} == "24-server" @${REINPLACE_CMD} '51d' ${WRKSRC}/core/src/plugins/CMakeLists.txt .endif .if ${PKGNAMESUFFIX} == "24-client" @${REINPLACE_CMD} -e 's|-Werror -Wall|-Wall|g' ${PATCH_WRKSRC}/core/CMakeLists.txt @${REINPLACE_CMD} -e 's|enable_testing()||g' ${WRKSRC}/CMakeLists.txt .endif @${REINPLACE_CMD} -e 's/CMAKE_INSTALL_FULL_DATAROOTDIR/CMAKE_INSTALL_DATAROOTDIR/g' \ ${WRKSRC}/cmake/BareosSetVariableDefaults.cmake \ ${WRKSRC}/webui/CMakeLists.txt post-extract: .if defined(WITH_CLIENT_ONLY) . if defined(PYTHON_PLUGIN) @${MKDIR} ${STAGEDIR}${ETCDIR}/python-ldap-conf.d/bareos-dir.d/fileset @${MKDIR} ${STAGEDIR}${ETCDIR}/python-ldap-conf.d/bareos-dir.d/job . endif .endif @${MV} ${WRKSRC}/core/src/defaultconfigs/bareos-dir.d/fileset/'Windows All Drives.conf' \ ${WRKSRC}/core/src/defaultconfigs/bareos-dir.d/fileset/'WindowsAllDrives.conf' @${MV} ${WRKSRC}/contrib/misc/bsmc/etc/bareos/bsmc.conf \ ${WRKSRC}/contrib/misc/bsmc/etc/bareos/bsmc.conf.sample .if !target(post-install) post-install: .if defined(WITH_CLIENT_ONLY) ${MKDIR} ${STAGEDIR}${ETCDIR}/bconsole.d/ ${MV} ${STAGEDIR}${ETCDIR}/bconsole.conf.sample ${STAGEDIR}${ETCDIR}/bconsole.d/bconsole.conf.sample .else ${INSTALL_SCRIPT} ${FILESDIR}/chio-bareos ${STAGEDIR}${PREFIX}/sbin ${INSTALL_DATA} ${FILESDIR}/bareos-barcodes ${STAGEDIR}${ETCDIR}/bareos-barcodes.sample ${CHMOD} o+x ${STAGEDIR}${PREFIX}/bin/bsmtp ${MV} ${STAGEDIR}${ETCDIR}/mtx-changer.conf ${STAGEDIR}${ETCDIR}/mtx-changer.conf.sample .endif @${MKDIR} ${STAGEDIR}/var/run/bareos .endif .else .include "${MASTERDIR}/Makefile.common" .endif # 24-client and 24-server are defined .include diff --git a/sysutils/bareos24-server/files/patch-core-src-include_baconfig.h b/sysutils/bareos24-server/files/patch-core-src-include_baconfig.h new file mode 100644 index 000000000000..041f89a74229 --- /dev/null +++ b/sysutils/bareos24-server/files/patch-core-src-include_baconfig.h @@ -0,0 +1,18 @@ +--- core/src/include/baconfig.h 2026-02-02 17:47:37.319878000 -0800 ++++ core/src/include/baconfig.h 2026-02-02 17:47:52.554519000 -0800 +@@ -560,4 +560,15 @@ + # define Leave(lvl) + #endif + ++#if defined(HAVE_WIN32) ++// mingw/windows does not understand "%zu/%zi" by default ++# define PRIuz PRIu64 ++# define PRIiz PRIi64 ++# define PRItime "lld" ++#else ++# define PRIuz "zu" ++# define PRIiz "zi" ++# define PRItime "ld" ++#endif ++ + #endif // BAREOS_INCLUDE_BACONFIG_H_ diff --git a/sysutils/bareos24-server/files/patch-core-src-stored-backends_chunked_device.cc b/sysutils/bareos24-server/files/patch-core-src-stored-backends_chunked_device.cc new file mode 100644 index 000000000000..acb35c4253ea --- /dev/null +++ b/sysutils/bareos24-server/files/patch-core-src-stored-backends_chunked_device.cc @@ -0,0 +1,163 @@ +--- core/src/stored/backends/chunked_device.cc 2025-12-04 05:21:37.000000000 -0800 ++++ core/src/stored/backends/chunked_device.cc 2026-02-02 17:56:28.052130000 -0800 +@@ -103,7 +103,7 @@ + { + char* buffer = (char*)malloc(current_chunk_->chunk_size); + +- Dmsg2(100, "New allocated buffer of %d bytes at %p\n", ++ Dmsg2(100, "New allocated buffer of %" PRIuz " bytes at %p\n", + current_chunk_->chunk_size, buffer); + + return buffer; +@@ -112,7 +112,7 @@ + // Free a chunk buffer. + void ChunkedDevice::FreeChunkbuffer(char* buffer) + { +- Dmsg2(100, "Freeing buffer of %d bytes at %p\n", current_chunk_->chunk_size, ++ Dmsg2(100, "Freeing buffer of %" PRIuz " bytes at %p\n", current_chunk_->chunk_size, + buffer); + + free(buffer); +@@ -121,7 +121,7 @@ + // Free a chunk_io_request. + void ChunkedDevice::FreeChunkIoRequest(chunk_io_request* request) + { +- Dmsg2(100, "Freeing chunk io request of %d bytes at %p\n", ++ Dmsg2(100, "Freeing chunk io request of %" PRIuz " bytes at %p\n", + sizeof(chunk_io_request), request); + + if (request->release) { FreeChunkbuffer(request->buffer); } +@@ -358,7 +358,7 @@ + new_request->tries = 0; + new_request->release = request->release; + +- Dmsg2(100, "Allocated chunk io request of %d bytes at %p\n", ++ Dmsg2(100, "Allocated chunk io request of %" PRIuz " bytes at %p\n", + sizeof(chunk_io_request), new_request); + + /* Enqueue the item onto the ordered circular buffer. +@@ -433,7 +433,7 @@ + "%d tries, setting device %s readonly\n"), + new_request->chunk, new_request->volname, new_request->tries, + print_name()); +- Emsg0(M_ERROR, 0, errmsg); ++ Emsg0(M_ERROR, 0, "%s", errmsg); + readonly_ = true; + goto bail_out; + } +@@ -682,8 +682,8 @@ + wanted_offset = (offset_ % current_chunk_->chunk_size); + + bytes_left +- = MIN((ssize_t)count, (current_chunk_->buflen - wanted_offset)); +- Dmsg2(200, "Reading complete %d byte read-request from chunk offset %d\n", ++ = MIN((ssize_t)count, ((ssize_t)current_chunk_->buflen - wanted_offset)); ++ Dmsg2(200, "Reading complete %" PRIuz " byte read-request from chunk offset %" PRIuz "\n", + bytes_left, wanted_offset); + + if (bytes_left < 0) { +@@ -709,13 +709,13 @@ + // See how much is left in this chunk. + if (offset_ <= current_chunk_->end_offset) { + wanted_offset = (offset_ % current_chunk_->chunk_size); +- bytes_left = MIN((ssize_t)(count - offset), +- (ssize_t)(current_chunk_->buflen - wanted_offset)); ++ bytes_left = MIN(((ssize_t)count - offset), ++ ((ssize_t)current_chunk_->buflen - wanted_offset)); + + if (bytes_left > 0) { + Dmsg2(200, +- "Reading %d bytes of %d byte read-request from end of chunk " +- "at offset %d\n", ++ "Reading %" PRIuz " bytes of %" PRIuz " byte read-request from end of chunk " ++ "at offset %" PRIuz "\n", + bytes_left, count, wanted_offset); + + memcpy(((char*)buffer + offset), +@@ -743,12 +743,12 @@ + } else { + /* Calculate how much data we can read from the just freshly read + * chunk. */ +- bytes_left = MIN((ssize_t)(count - offset), +- (ssize_t)(current_chunk_->buflen)); ++ bytes_left = MIN(((ssize_t)count - offset), ++ (ssize_t)current_chunk_->buflen); + + if (bytes_left > 0) { + Dmsg2(200, +- "Reading %d bytes of %d byte read-request from next chunk\n", ++ "Reading %" PRIuz " bytes of %" PRIuz " byte read-request from next chunk\n", + bytes_left, count); + + memcpy(((char*)buffer + offset), current_chunk_->buffer, +@@ -805,7 +805,7 @@ + && current_chunk_->end_offset >= (boffset_t)((offset_ + count) - 1)) { + wanted_offset = (offset_ % current_chunk_->chunk_size); + +- Dmsg2(200, "Writing complete %d byte write-request to chunk offset %d\n", ++ Dmsg2(200, "Writing complete %" PRIuz " byte write-request to chunk offset %" PRIuz "\n", + count, wanted_offset); + + memcpy(current_chunk_->buffer + wanted_offset, buffer, count); +@@ -836,14 +836,14 @@ + + if (bytes_left > 0) { + Dmsg2(200, +- "Writing %d bytes of %d byte write-request to end of chunk " +- "at offset %d\n", ++ "Writing %" PRIuz " bytes of %" PRIuz " byte write-request to end of chunk " ++ "at offset %" PRIuz "\n", + bytes_left, count, wanted_offset); + + memcpy(current_chunk_->buffer + wanted_offset, + ((char*)buffer + offset), bytes_left); + offset_ += bytes_left; +- if ((wanted_offset + bytes_left) > current_chunk_->buflen) { ++ if ((wanted_offset + bytes_left) > (ssize_t)current_chunk_->buflen) { + current_chunk_->buflen = wanted_offset + bytes_left; + } + current_chunk_->need_flushing = true; +@@ -860,13 +860,13 @@ + + /* Calculate how much data we can fit into the just freshly created + * chunk. */ +- bytes_left = MIN((ssize_t)(count - offset), ++ bytes_left = MIN(((ssize_t)count - offset), + (ssize_t)((current_chunk_->end_offset + - current_chunk_->start_offset) + + 1)); + if (bytes_left > 0) { + Dmsg2(200, +- "Writing %d bytes of %d byte write-request to next chunk\n", ++ "Writing %" PRIuz " bytes of %" PRIuz " byte write-request to next chunk\n", + bytes_left, count); + + memcpy(current_chunk_->buffer, ((char*)buffer + offset), bytes_left); +@@ -1089,14 +1089,14 @@ + /* compare expected to written volume size */ + size_t remote_volume_size = RemoteVolumeSize(); + Dmsg3(100, +- "volume: %s, RemoteVolumeSize = %lld, VolCatInfo.VolCatBytes " +- "= %lld\n", ++ "volume: %s, RemoteVolumeSize = %" PRIuz ", VolCatInfo.VolCatBytes " ++ "= %" PRIuz "\n", + current_volname_, remote_volume_size, VolCatInfo.VolCatBytes); + + if (remote_volume_size < VolCatInfo.VolCatBytes) { + Dmsg3(100, +- "volume %s is pending, as 'remote volume size' = %lld < 'catalog " +- "volume size' = %lld\n", ++ "volume %s is pending, as 'remote volume size' = %" PRIuz " < 'catalog " ++ "volume size' = %" PRIuz "\n", + current_volname_, remote_volume_size, VolCatInfo.VolCatBytes); + return false; + } +@@ -1248,7 +1248,7 @@ + DeviceStatusInformation* dst = (DeviceStatusInformation*)data; + PoolMem status(PM_MESSAGE); + +- status.bsprintf(" /%s/%04d - %ld (try=%d)\n", io_request->volname, ++ status.bsprintf(" /%s/%04d - %" PRIuz " (try=%d)\n", io_request->volname, + io_request->chunk, io_request->wbuflen, io_request->tries); + dst->status_length = PmStrcat(dst->status, status.c_str()); +