From a0ce545d52f231499bf9f3644493113d8af58ec9 Mon Sep 17 00:00:00 2001
From: V3n3RiX <venerix@koprulu.sector>
Date: Thu, 9 May 2024 00:01:03 +0100
Subject: gentoo auto-resync : 09:05:2024 - 00:01:03

---
 app-backup/Manifest.gz                             | Bin 7860 -> 7863 bytes
 app-backup/bacula/Manifest                         |   4 +
 app-backup/bacula/bacula-15.0.2.ebuild             | 449 +++++++++++++++++++++
 .../bacula/files/bacula-15.0.2-fix-static.patch    |  63 +++
 .../bacula/files/bacula-15.0.2-fix_slibtool.patch  |  67 +++
 app-backup/bareos/Manifest                         |   4 +
 app-backup/bareos/bareos-21.1.9.ebuild             | 414 +++++++++++++++++++
 app-backup/bareos/bareos-22.1.4.ebuild             | 434 ++++++++++++++++++++
 8 files changed, 1435 insertions(+)
 create mode 100644 app-backup/bacula/bacula-15.0.2.ebuild
 create mode 100644 app-backup/bacula/files/bacula-15.0.2-fix-static.patch
 create mode 100644 app-backup/bacula/files/bacula-15.0.2-fix_slibtool.patch
 create mode 100644 app-backup/bareos/bareos-21.1.9.ebuild
 create mode 100644 app-backup/bareos/bareos-22.1.4.ebuild

(limited to 'app-backup')

diff --git a/app-backup/Manifest.gz b/app-backup/Manifest.gz
index 909b40bfef92..7fc6d918e07e 100644
Binary files a/app-backup/Manifest.gz and b/app-backup/Manifest.gz differ
diff --git a/app-backup/bacula/Manifest b/app-backup/bacula/Manifest
index 58d2811cfbbb..b9ad70b4c88a 100644
--- a/app-backup/bacula/Manifest
+++ b/app-backup/bacula/Manifest
@@ -4,6 +4,8 @@ AUX 7.2.0/bacula-7.2.0-doc.patch 435 BLAKE2B 65d528b337f9a3e2eaf456b6dad37ddc59b
 AUX 9.0.2/bacula-9.0.2-lib-search-path.patch 1431 BLAKE2B f04bbf695a926424092dd974994967eefcd48407f2de43b9e94bff25403e66f4a49cde08d667e3b5fc4fb9f8d273a786c3422325db3f589278d16f136d4a9a0c SHA512 3863102d2f8db4158dede306b07297da6550bbad1c77aea49a75de412a7f4630216ef2ae28fc51ffa8d8f9c373510e58982f28e32fdbb142a3551eef7f112b7d
 AUX 9.0.6/bacula-9.0.6-bat-pro.patch 667 BLAKE2B b8987c244025f029a182d6b44f30e0e0a6835b9f6cadb6b43b2b55ea33113e20c20b6a367d965ea12358597e9807c79846e45571b31f9b66dc3ad83265fed4e7 SHA512 d521759cad65ef73fb674cd6b58f9540ef6e86842bcd45ece4730f71a408076b38faea2088bf6f2993fed9a88d727ff2ff8c3e3619e27fcaa1d5afe4506640cf
 AUX bacula-11.0.2-fix-static.patch 3752 BLAKE2B c910fa044c79f0f50abf5ac86b9f34489cd1bab599394449ec8cf27d2dbb65c36bed77fec80dfccc28c0b1b27bfaafee4127fdf90e77d044a2fed7351973f432 SHA512 63505e9c571b5fd034754da87052441f8438ca0efe4511406eaf142891bd09128c8e478c536f114c4823c53c9f09995bd734dc7efe3e10bdfda337d78c4667bd
+AUX bacula-15.0.2-fix-static.patch 3830 BLAKE2B 79328ae40d94f88f8769e93f72cbd9cf1c66c332f28126260d46ae76f9271ca2535cbb8839a2f6c8430209e30cf8176a96e691ff80a7683d2a6d845d24a497f0 SHA512 a667f5ea4a86d8f2b0d77f44e08a98dc6e25c0ef257a3aa314f9971174ad7b2fd2d5e2ccc4baea607667b6637ae903be60d3dbe0eeca5fd0afbbaa90e2603dcb
+AUX bacula-15.0.2-fix_slibtool.patch 3868 BLAKE2B 34186137dbeb183118b573ebd574ff6463e5280363df3ce2898d7e4a9570b196eddcbf85312ce7a7969ff75e86b6dacc526eddad92b010863af58683959151c5 SHA512 9c041e4841a7ff789a97c88135a646d41cc0e6bc658eebee866888fe6781ea0eedc39acff100e703ec047a8212f60d03b398a1e845f2937bb1b3906f372ea5cf
 AUX bacula-dir.confd 629 BLAKE2B 85eb7131fe1735ea3af0075b26c88408a11ce7653b92e27198d6bbfdbe2bf4d4e157eb6685f2cac79a8de1e4d24d9c4eb25f9d64b1b956162718fe09633018c4 SHA512 85ed5317313721a7b3776a257c204e0ac45a5221c6bd0b5886944cbd1e4829fe146e7af52cdc604cbf5e3d8722c955da40cbf989dc9ea7466653c98bf8c7cfdf
 AUX bacula-fd.confd 241 BLAKE2B fe41e6376e46e674ef1aa32f02e2dee9721189fb56c4d25c2f49bd6bb0b9c8bcc811cd58db62b9b8bffd80514a24e9d60385a395dfdb93627d473ba7bbf05131 SHA512 0e5a21d8ed3cd39135c8db5b8c59e615161848aaca582851d3599fe0e6ad4f47c04fede13cdc648a2cbdc032de6ca00aa954111bbb2930eb006e7e0984cb882f
 AUX bacula-fix-sonames-new.patch 2090 BLAKE2B 1d181464b599fbb40b5d463b17b6364dc144bb82071e1a3454f30d6f60c8679f738b59dccbc01a73cc14f882997ca5dae438ba2d3d7d1ea20ac148e1da3e2e9c SHA512 c9f6ec30c15f22fc57bed05ed387f99102bc234d50de4762785ec17c4ef3a68d8f560c3878e5843dc3bf1b2680b41f9990dcc89a3c238760deeb5fd95ed5d50a
@@ -16,6 +18,8 @@ AUX newscripts/bacula-sd.initd 324 BLAKE2B fe9c1c5893d9e8c80d906e4c31e2645414674
 AUX tray-monitor-pro.patch 651 BLAKE2B 87a75a10fe709ca780ddb721576808b0a5ffe6f489fbe2844e7150586e5a114b4771646ba1b6fd3f1fb0d2a606080e69eff1fadb3fc2eb4a90d3c8fe1d4de2a6 SHA512 0e68e9867307e5fb978f1a54b2efe20a07bebf9d9651cfbf0a0c789751336cf131fd0f07f313b73ed7d0b8f2a26c1fb6c737936a048ad3c0cf8a9e1dd094601b
 DIST bacula-13.0.3.tar.gz 6235649 BLAKE2B c1053e784f995aa45f2810a8b1370211a6e42f9512c11e0290f059d0e39489c24d4a7951fa055a00ecd2c4acb44581cc220271952c6d477d15c86e0a7e8680f7 SHA512 59ec616535959bde26b5b03a60355f3f8d80ae7a719a079d354f41c0f103b0e467177b6f813ef3eb4d30866f73c393d766e8337e20bb97f19ffd7eba5e5c59c5
 DIST bacula-13.0.4.tar.gz 6227040 BLAKE2B e54a754280178f74f97fdbb3c91a596b632d80739fedd5f847d183f0852ea9e82bba55ad9a745ee1ceb945bd527d33b117bc3c866783bd3073166bd20607a72a SHA512 5d33714d5575c351e28676cbd165fe7648ce15a1bc2a03f6d5635528083f3ec3bd6c7137a987690dcc8b232105e5768be91ba405a033ad60c4b82f3c88d73812
+DIST bacula-15.0.2.tar.gz 6524812 BLAKE2B 1dd0722ce2bb6363936ed9cc9df1b6d842945f17277c77f40884bafc4b0a254c5fdd2c21bd200c6ca8b77c8eb718a319552e50135c9925d2b4ad81a64ab819d2 SHA512 71bd206a2bb0cf3ca0f2cb6547b63946bc2a8a5f70c5506b9a589e5ed9871bb98b56205da7d12e54a41c9ab3539fe1114bc94d926f0f831ee9e15bba36f167f3
 EBUILD bacula-13.0.3-r2.ebuild 13179 BLAKE2B 3164969c3f2c5ba04a499c4282a15afaa6bf2afb82d309b5431b75dd1992fb500dd9fe859611e524d8271ba420091eef1468738c04d697ad6a40e2db0999f887 SHA512 e5e7f2671925994fb41e1ec430fc1ca76521ae6b8675f4ecb7383a5f191eaa3d42a7730d4e71daa41716eb07245530c5586108110b806e03e63772f5a04fc2a5
 EBUILD bacula-13.0.4.ebuild 13181 BLAKE2B 98d8ed281cf63236d00eb7524a03361b7aaa563ea6228ef2c5ad19a42b74d551f02c5323d09105759e336375a541e4583a3ae5b326a808bb9e68c8de8467fe36 SHA512 306744e6b7734564305100c4d0bf568a2043873e54f1b77b40a0e81977f9d88146fe0d3e68e0a78e4c93d279bc813f700698be77a087bd7165772ffe3e4b963c
+EBUILD bacula-15.0.2.ebuild 13194 BLAKE2B ffdd60fac23fcab88d2e223e031b3c1ea0f92a30bdea754e291a873eac949429c9f6bf7bb708ef1a7e2fc60b0dfa8a6b35da146c8de35cb161779b7aaa652846 SHA512 a279beeeb67d80058cb86fb0cd6edc6278ab55b9eb85f4e89f595d3690e639e5ebf5ac6504ed92c22506a6b710fe56ff36f98c97e327a235040c45650aad0154
 MISC metadata.xml 747 BLAKE2B bae193fb0ae5e5e92b0b6e935691f19235a230b0a7e69083aeb344db0e451ca55f16c9f3c163eab390621ab266e0f7f7ee1e75eff69589b2de0c730d2cf0d965 SHA512 df7c2a1296cb7da96928de07347df04f741b8b91de72d39c002dda3e5c9564341a5bc73b60f68752a806175fd5709b35f1eb4ecf00e85e1237c4672c0b948557
diff --git a/app-backup/bacula/bacula-15.0.2.ebuild b/app-backup/bacula/bacula-15.0.2.ebuild
new file mode 100644
index 000000000000..d5c84855a449
--- /dev/null
+++ b/app-backup/bacula/bacula-15.0.2.ebuild
@@ -0,0 +1,449 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop libtool qmake-utils systemd
+
+MY_PV=${PV/_beta/-b}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Featureful client/server network backup suite"
+HOMEPAGE="https://www.bacula.org/"
+SRC_URI="https://downloads.sourceforge.net/bacula/${MY_P}.tar.gz"
+
+S=${WORKDIR}/${MY_P}
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="acl bacula-clientonly bacula-nodir bacula-nosd +batch-insert examples ipv6 logwatch mysql postgres qt5 readline selinux +sqlite ssl static tcpd vim-syntax X"
+
+DEPEND="
+	!bacula-clientonly? (
+		!bacula-nodir? ( virtual/mta )
+		postgres? ( dev-db/postgresql:=[threads(+)] )
+		mysql? ( || ( dev-db/mysql-connector-c dev-db/mariadb-connector-c ) )
+		sqlite? ( dev-db/sqlite:3 )
+	)
+	dev-libs/gmp:0
+	qt5? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+		dev-qt/qtsvg:5
+		x11-libs/qwt:6
+	)
+	logwatch? ( sys-apps/logwatch )
+	readline? ( sys-libs/readline:0 )
+	static? (
+		dev-libs/lzo[static-libs]
+		sys-libs/ncurses:=[static-libs]
+		sys-libs/zlib[static-libs]
+		acl? ( virtual/acl[static-libs(+)] )
+		ssl? (
+			dev-libs/openssl:0=[static-libs]
+		)
+	)
+	!static? (
+		dev-libs/lzo
+		sys-libs/ncurses:=
+		sys-libs/zlib
+		acl? ( virtual/acl )
+		ssl? (
+			dev-libs/openssl:0=
+		)
+	)
+	tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+	dev-util/patchelf
+"
+RDEPEND="${DEPEND}
+	acct-user/bacula
+	acct-group/bacula
+	!bacula-clientonly? (
+		!bacula-nosd? (
+			app-arch/mt-st
+			sys-block/mtx
+		)
+	)
+	selinux? ( sec-policy/selinux-bacula )
+	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+"
+
+REQUIRED_USE="
+	!bacula-clientonly? ( ^^ ( mysql postgres sqlite ) )
+	static? ( bacula-clientonly )
+"
+
+# suppress warning wrt 'implicit function declaration' in config logs
+# bug 900663
+QA_CONFIG_IMPL_DECL_SKIP=(
+	makedev		# designed to check availability in
+				# used header file
+)
+
+pkg_setup() {
+	#XOR and !bacula-clientonly controlled by REQUIRED_USE
+	use mysql && export mydbtype="mysql"
+	use postgres && export mydbtype="postgresql"
+	use sqlite && export mydbtype="sqlite3"
+
+	if use bacula-clientonly && use static && use qt5; then
+		ewarn
+		ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt5' useflag."
+		ewarn
+	fi
+}
+
+src_prepare() {
+	# adjusts default configuration files for several binaries
+	# to /etc/bacula/<config> instead of ./<config>
+	pushd src >&/dev/null || die
+	for f in console/console.c dird/dird.c filed/filed.c \
+		stored/bcopy.c stored/bextract.c stored/bls.c \
+		stored/bscan.c stored/btape.c stored/stored.c \
+		qt-console/main.cpp; do
+		sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
+			|| die "sed on ${f} failed"
+	done
+	popd >&/dev/null || die
+
+	# bug 466688 drop deprecated categories from Desktop file
+	sed -i -e 's/Application;//' scripts/bat.desktop.in || die
+
+	# bug 466690 Use CXXFLAGS instead of CFLAGS
+	sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
+
+	# drop automatic install of unneeded documentation (for bug 356499)
+	eapply -p0 "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch
+
+	# bug #310087
+	eapply "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
+
+	# bug #311161
+	eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch
+
+	# bat needs to respect LDFLAGS and CFLAGS
+	eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-bat-pro.patch
+
+	# tray-monitor needs to respect LDFLAGS and CFLAGS
+	eapply -p0 "${FILESDIR}"/tray-monitor-pro.patch
+
+	# bug #328701
+	eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
+
+	eapply -p0 "${FILESDIR}"/${PN}-15.0.2-fix-static.patch
+
+	# fix soname in libbaccat.so, see bugs #602952, #790140 and #845126
+	eapply "${FILESDIR}/bacula-fix-sonames-new.patch"
+
+	# correct library search path for slibtool usage (bug #914389)
+	eapply -p0 "${FILESDIR}/${PN}-15.0.2-fix_slibtool.patch"
+
+	# do not strip binaries
+	sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
+	sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
+	sed -i -e "s/+= qt$/+= qt nostrip/" \
+			src/qt-console/tray-monitor/tray-monitor.pro.in || die
+
+	eapply_user
+
+	# Fix systemd unit files:
+	# bug 497748
+	sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
+	sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
+	# bug 504370
+	sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
+	# bug 584442 and 504368
+	sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die
+
+	# build 'bat' for Qt5
+	export QMAKE="$(qt5_get_bindir)"/qmake
+
+	# adapt to >=Qt-5.9 (see bug #644566)
+	# qmake needs an existing target file to generate install instructions
+	sed -i -e 's#bins.files = bat#bins.files = .libs/bat#g' \
+		src/qt-console/bat.pro.in || die
+	mkdir src/qt-console/.libs || die
+	touch src/qt-console/.libs/bat || die
+	chmod 755 src/qt-console/.libs/bat || die
+
+	# same for tray-monitor (bug #915605)
+	sed -i -e 's#bins.files = bac#bins.files = .libs/bac#g' \
+		src/qt-console/tray-monitor/tray-monitor.pro.in || die
+	mkdir src/qt-console/tray-monitor/.libs || die
+	touch src/qt-console/tray-monitor/.libs/bacula-tray-monitor || die
+	chmod 755 src/qt-console/tray-monitor/.libs/bacula-tray-monitor || die
+
+	eapply -p0 "${FILESDIR}/fix_tray_monitor.patch" || die
+
+	# Don't let program install man pages directly
+	sed -i -e 's/ manpages//' Makefile.in || die
+
+	# correct installation for plugins to mode 0755 (bug #725946)
+	sed -i -e "s/(INSTALL_PROGRAM) /(INSTALL_LIB) /" src/plugins/fd/Makefile ||die
+	sed -i -e "s/(INSTALL_PROGRAM) /(INSTALL_LIB) /" src/plugins/fd/docker/Makefile ||die
+
+	# fix bundled libtool (bug 466696)
+	# But first move directory with M4 macros out of the way.
+	# It is only needed by autoconf and gives errors during elibtoolize.
+	mv autoconf/libtool autoconf/libtool1 || die
+	elibtoolize
+}
+
+src_configure() {
+	local myconf=''
+
+	if use bacula-clientonly; then
+		myconf="${myconf} \
+			$(use_enable bacula-clientonly client-only) \
+			$(use_enable !static libtool) \
+			$(use_enable static static-cons) \
+			$(use_enable static static-fd)"
+	else
+		myconf="${myconf} \
+			$(use_enable !bacula-nodir build-dird) \
+			$(use_enable !bacula-nosd build-stored)"
+		# bug #311099
+		# database support needed by dir-only *and* sd-only
+		# build as well (for building bscan, btape, etc.)
+		myconf="${myconf}
+			--with-${mydbtype}"
+	fi
+
+	# do not build bat if 'static' clientonly
+	if ! use bacula-clientonly || ! use static; then
+		myconf="${myconf} \
+			$(use_enable qt5 bat)"
+	fi
+
+	myconf="${myconf} \
+		$(use_with X x) \
+		$(use_enable batch-insert) \
+		$(use_enable !readline conio) \
+		$(use_enable readline) \
+		$(use_with ssl openssl) \
+		$(use_enable ipv6) \
+		$(use_enable acl) \
+		$(use_with tcpd tcp-wrappers)"
+
+	econf \
+		--with-pid-dir=/var/run \
+		--sysconfdir=/etc/bacula \
+		--with-archivedir=/var/lib/bacula/tmp \
+		--with-subsys-dir=/var/lock/subsys \
+		--with-working-dir=/var/lib/bacula \
+		--with-logdir=/var/lib/bacula \
+		--with-scriptdir=/usr/libexec/bacula \
+		--with-systemd=$(systemd_get_systemunitdir) \
+		--with-dir-user=bacula \
+		--with-dir-group=bacula \
+		--with-sd-user=root \
+		--with-sd-group=bacula \
+		--with-fd-user=root \
+		--with-fd-group=bacula \
+		--enable-smartalloc \
+		--disable-afs \
+		--without-s3 \
+		--host=${CHOST} \
+		${myconf}
+}
+
+src_compile() {
+	# Make build log verbose (bug #447806)
+	emake NO_ECHO=""
+}
+
+src_install() {
+	emake DESTDIR="${D}" install
+	doicon scripts/bacula.png
+	keepdir /var/lib/bacula/tmp
+
+	# remove not needed .la files #840957
+	find "${ED}" -name '*.la' -delete || die
+
+	# install bat icon and desktop file when enabled
+	# (for some reason ./configure doesn't pick this up)
+	if use qt5 && ! use static ; then
+		doicon src/qt-console/images/bat_icon.png
+		domenu scripts/bat.desktop
+	fi
+
+	# remove some scripts we don't need at all
+	rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
+
+	# rename statically linked apps
+	if use bacula-clientonly && use static ; then
+		pushd "${D}"/usr/sbin || die
+		mv static-bacula-fd bacula-fd || die
+		mv static-bconsole bconsole || die
+		popd || die
+	fi
+
+	# extra files which 'make install' doesn't cover
+	if ! use bacula-clientonly; then
+	    # the database update scripts
+		diropts -m0750
+		insinto /usr/libexec/bacula/updatedb
+		insopts -m0754
+		doins "${S}"/updatedb/*
+		fperms 0640 /usr/libexec/bacula/updatedb/README
+
+		# the logrotate configuration
+		# (now unconditional wrt bug #258187)
+		diropts -m0755
+		insinto /etc/logrotate.d
+		insopts -m0644
+		newins "${S}"/scripts/logrotate bacula
+
+		# the logwatch scripts
+		if use logwatch; then
+			diropts -m0750
+			dodir /usr/share/logwatch/scripts/services
+			dodir /usr/share/logwatch/scripts/shared
+			dodir /etc/logwatch/conf/logfiles
+			dodir /etc/logwatch/conf/services
+			pushd "${S}"/scripts/logwatch >&/dev/null || die
+			emake DESTDIR="${D}" install
+			popd >&/dev/null || die
+		fi
+	fi
+
+	# Install all man pages
+	doman "${S}"/manpages/*.[18]
+
+	if ! use qt5; then
+		rm -vf "${D}"/usr/share/man/man1/bat.1*
+		rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
+	fi
+
+	if use bacula-clientonly || use bacula-nodir ; then
+		rm -vf "${D}"/usr/libexec/bacula/create_*_database
+		rm -vf "${D}"/usr/libexec/bacula/drop_*_database
+		rm -vf "${D}"/usr/libexec/bacula/make_*_tables
+		rm -vf "${D}"/usr/libexec/bacula/update_*_tables
+		rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
+		rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
+		rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
+	fi
+	if use bacula-clientonly || use bacula-nosd; then
+		rm -vf "${D}"/usr/libexec/bacula/disk-changer
+		rm -vf "${D}"/usr/libexec/bacula/mtx-changer
+		rm -vf "${D}"/usr/libexec/bacula/dvd-handler
+	fi
+
+	# documentation
+	dodoc ChangeLog ReleaseNotes SUPPORT
+
+	# install examples (bug #457504)
+	if use examples; then
+		docinto examples/
+		dodoc -r examples/*
+	fi
+
+	# vim-files
+	if use vim-syntax; then
+		insinto /usr/share/vim/vimfiles/syntax
+		doins scripts/bacula.vim
+		insinto /usr/share/vim/vimfiles/ftdetect
+		newins scripts/filetype.vim bacula_ft.vim
+	fi
+
+	# setup init scripts
+	myscripts="bacula-fd"
+	if ! use bacula-clientonly; then
+		if ! use bacula-nodir; then
+			myscripts="${myscripts} bacula-dir"
+		fi
+		if ! use bacula-nosd; then
+			myscripts="${myscripts} bacula-sd"
+		fi
+	fi
+	for script in ${myscripts}; do
+		# copy over init script and config to a temporary location
+		# so we can modify them as needed
+		cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
+		cp "${FILESDIR}/newscripts/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
+
+		# now set the database dependency for the director init script
+		case "${script}" in
+			bacula-dir)
+				case "${mydbtype}" in
+					sqlite3)
+						# sqlite databases don't have a daemon
+						sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
+						;;
+					*)
+						# all other databases have daemons
+						sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
+						;;
+				esac
+				;;
+			*)
+				;;
+		esac
+
+		# install init script and config
+		newinitd "${T}/${script}".initd "${script}"
+		newconfd "${T}/${script}".confd "${script}"
+	done
+
+	systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
+
+	# make sure the working directory exists
+	diropts -m0750
+	keepdir /var/lib/bacula
+
+	# make sure bacula group can execute bacula libexec scripts
+	fowners -R root:bacula /usr/libexec/bacula
+}
+
+pkg_postinst() {
+	if use bacula-clientonly; then
+		fowners root:bacula /var/lib/bacula
+	else
+		fowners bacula:bacula /var/lib/bacula
+	fi
+
+	einfo
+	einfo "A group 'bacula' has been created. Any users you add to this"
+	einfo "group have access to files created by the daemons."
+	einfo
+	einfo "A user 'bacula' has been created.  Please see the bacula manual"
+	einfo "for information about running bacula as a non-root user."
+	einfo
+
+	if ! use bacula-clientonly && ! use bacula-nodir; then
+		einfo
+		einfo "If this is a new install, you must create the ${mydbtype} databases with:"
+		einfo "  /usr/libexec/bacula/create_${mydbtype}_database"
+		einfo "  /usr/libexec/bacula/make_${mydbtype}_tables"
+		einfo "  /usr/libexec/bacula/grant_${mydbtype}_privileges"
+		einfo
+
+		ewarn "ATTENTION!"
+		ewarn "The format of the database may have changed."
+		ewarn "If you just upgraded from a version below 9.0.0 you must run"
+		ewarn "'update_bacula_tables' now."
+		ewarn "Make sure to have a backup of your catalog before."
+		ewarn
+	fi
+
+	if use sqlite; then
+		einfo
+		einfo "Be aware that Bacula does not officially support SQLite database anymore."
+		einfo "Best use it only for a client-only installation. See Bug #445540."
+		einfo
+	fi
+
+	einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
+	einfo "you have to enable 'USE=qt5'."
+	einfo
+	einfo "/var/lib/bacula/tmp was configured for archivedir. This dir will be used during"
+	einfo "restores, so be sure to set it to an appropriate in dir in the bacula config."
+
+	einfo
+	einfo "If you adapt the port numbers for baculas components in the config files"
+	einfo "make sure to adapt the file names for the pidfile accordingly"
+	einfo "(see init.d scripts)."
+}
diff --git a/app-backup/bacula/files/bacula-15.0.2-fix-static.patch b/app-backup/bacula/files/bacula-15.0.2-fix-static.patch
new file mode 100644
index 000000000000..57963a271bba
--- /dev/null
+++ b/app-backup/bacula/files/bacula-15.0.2-fix-static.patch
@@ -0,0 +1,63 @@
+--- src/console/Makefile.in.orig	2017-07-25 19:03:05.664760298 +0200
++++ src/console/Makefile.in	2017-07-25 19:05:43.576706091 +0200
+@@ -24,6 +24,7 @@
+ CONSSRCS = console.c console_conf.c authenticate.c @CONS_SRC@
+ CONSOBJS = console.o console_conf.o authenticate.o @CONS_OBJ@
+ JSONOBJS = bbconsjson.o console_conf.o
++ZLIBS=@ZLIBS@
+ 
+ # these are the objects that are changed by the .configure process
+ EXTRAOBJS = @OBJLIST@
+@@ -50,18 +51,18 @@
+ 
+ bconsole: Makefile $(CONSOBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) -L../lib -L../cats $(LDFLAGS) $(CONS_LDFLAGS) -o $@ $(CONSOBJS) \
+-	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) \
+-	      $(OPENSSL_LIBS)
++	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(ZLIBS) $(GETTEXT_LIBS) \
++	      $(OPENSSL_LIBS) $(LIBS)
+ 
+ bbconsjson: Makefile $(JSONOBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) -L../lib -L../cats $(LDFLAGS) $(CONS_LDFLAGS) -o $@ $(JSONOBJS) \
+-	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) \
+-	      $(OPENSSL_LIBS)
++	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(ZLIBS) $(GETTEXT_LIBS) \
++	      $(OPENSSL_LIBS) $(LIBS)
+ 
+ static-bconsole: Makefile $(CONSOBJS) ../lib/libbac.a ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) -static -L../lib -L../cats $(LDFLAGS) $(CONS_LDFLAGS) -o $@ $(CONSOBJS) \
+-	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) \
+-	      $(OPENSSL_LIBS)
++	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(ZLIBS) $(GETTEXT_LIBS) \
++	      $(OPENSSL_LIBS) $(LIBS)
+ 	strip $@
+ 
+ 
+--- src/filed/Makefile.in.orig	2017-07-25 19:09:19.655852979 +0200
++++ src/filed/Makefile.in	2017-07-25 19:11:39.519558592 +0200
+@@ -69,19 +69,19 @@
+ bacula-fd:  Makefile $(SVROBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
+ 	@echo "Linking $@ ..."
+ 	$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
+-	  $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) \
+-	  $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(IOKITLIBS)
++	  $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm \
++	  $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(IOKITLIBS)
+ 
+ bfdjson:  Makefile $(JSONOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
+ 	@echo "Linking $@ ..."
+ 	$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(JSONOBJS) \
+-	  $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) \
+-	  $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZO_LIBS) $(ZSTD_LIBS)
++	  $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm \
++	  $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZO_LIBS) $(ZSTD_LIBS)
+ 
+ static-bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
+ 	$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
+-	   $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) \
+-	   $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZO_LIBS) $(ZSTD_LIBS)
++	   $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm \
++	   $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZO_LIBS) $(ZSTD_LIBS)
+ 	strip $@
+ 
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
diff --git a/app-backup/bacula/files/bacula-15.0.2-fix_slibtool.patch b/app-backup/bacula/files/bacula-15.0.2-fix_slibtool.patch
new file mode 100644
index 000000000000..96eddbc5fb46
--- /dev/null
+++ b/app-backup/bacula/files/bacula-15.0.2-fix_slibtool.patch
@@ -0,0 +1,67 @@
+# slibtool creates library in .libs directory but need -L. to find them
+# Bug #914389
+--- src/stored/Makefile.in.orig	2023-11-15 14:20:23.135630968 +0100
++++ src/stored/Makefile.in	2023-11-15 14:22:35.771246680 +0100
+@@ -267,7 +267,7 @@
+ 	   -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+ 
+ btape: Makefile  $(TAPEOBJS) libbacsd.la drivers ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(TAPEOBJS) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(TAPEOBJS) \
+ 	  $(SD_LIBS) $(DLIB) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ 
+@@ -277,7 +277,7 @@
+            -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+ 
+ cloud_test: Makefile cloud_test.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)  $(BLSOBJS)  libbacsd.la drivers
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(CLOUDTESTOBJS) $(DLIB) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(CLOUDTESTOBJS) $(DLIB) \
+            $(SD_LIBS) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bcloud.o: bcloud.c
+@@ -286,7 +286,7 @@
+            -I$(basedir) $(DINCLUDE) $(S3_INC) $(CFLAGS) $<
+ 
+ bcloud: Makefile bcloud.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)  $(BLSOBJS)  libbacsd.la drivers
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(CLOUDCLIOBJS) $(DLIB) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(CLOUDCLIOBJS) $(DLIB) \
+            $(SD_LIBS) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(S3_LIBS)
+ 
+ bls.o:	bls.c
+@@ -296,7 +296,7 @@
+ 
+ bls:	Makefile $(BLSOBJS) libbacsd.la drivers  ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	@echo "Compiling $<"
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) \
+ 	   $(SD_LIBS) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bextract.o: bextract.c
+@@ -306,7 +306,7 @@
+ 
+ bextract: Makefile $(BEXTOBJS) libbacsd.la drivers ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	@echo "Compiling $<"
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) $(ZLIBS) $(LZO_LIBS) $(ZSTD_LIBS) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) $(ZLIBS) $(LZO_LIBS) $(ZSTD_LIBS) \
+ 	   $(SD_LIBS) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bscan.o: bscan.c
+@@ -316,7 +316,7 @@
+ 
+ bscan:	Makefile $(SCNOBJS) libbacsd.la drivers ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ 	../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE)
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) \
+ 	   $(SD_LIBS) -lbacsql -lbaccats $(DB_LIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bcopy.o: bcopy.c
+@@ -325,7 +325,7 @@
+ 	   -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+ 
+ bcopy:	Makefile $(COPYOBJS) libbacsd.la drivers ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+-	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(COPYOBJS) \
++	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(COPYOBJS) \
+ 	   $(SD_LIBS) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ cloud_parts_test: Makefile cloud_parts.c
diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
index 349d3872b705..0267a1ba7a5b 100644
--- a/app-backup/bareos/Manifest
+++ b/app-backup/bareos/Manifest
@@ -14,11 +14,15 @@ AUX bareos-sd-21.confd 360 BLAKE2B 36a73a27a635ec1a4c3d1592e896ba85c3c7d6e91c3c0
 AUX bareos-sd.service 812 BLAKE2B 7ac9754d98ea177614450045fbbaf7406592b30a280646eacdf31271a0cafd63e88ac463b1d94143ccac96c289de3f88a177edab665f073e7c7692037ffedb68 SHA512 6a0fdb3af03e9f94e0d755a3286aff36b41ab1f00a82e9864f6d3de6931691f6aba79aeb7fc952cec039e4174b545f53c23e96fcfbaed71192877d201b3086ad
 AUX tmpfiles.d-bareos.conf 33 BLAKE2B 68feed7629dde0dad019470851cea33140be3b17186fbbee7ad6c6a591978236ec09252d890117030d8706d22ea02f9971063aa80a393d3726510128527401d0 SHA512 65d3f72e57eb3afc557ab6b56a8ec1895a679b904114fefd1c9d0ceeb6b9fa8413575591ed81e1ce6963bdaf34dad227e781865b39bb237afc6bb5652306d2ef
 DIST bareos-21.1.8.tar.gz 11663322 BLAKE2B 5f8c66d44c702b187f56434925417f3eff5f9f515f52d5707d5dce2edfcf566474bae52518adab1d6f87d479fd05cc906f48350eec4f21b858720a607f9b4311 SHA512 643561d4bd92989e0b9356dab500083073daa2717159b5b061f5680ab96e8532c13753e94480419239bcad9938818c203d43dc72b690404ae5a143fdd3cd0738
+DIST bareos-21.1.9.tar.gz 11670286 BLAKE2B 22486fdf2b80296fed4265afa8ea4f5c0708f7836172da6a0f081c3328eea84c2eaf7de62884c82aeb61ead38f5a872edc6718fce730c16d6e4e96ef520eff0e SHA512 337702bf5b38bdf6f96720748ec0ab154f698389d6ff535b59f0a9432783f021287b98ac446467a1da51614c6fd740b45b8a5363f56cb5bd855bfe333fc6cfac
 DIST bareos-22.1.2.tar.gz 14746158 BLAKE2B 5d8c9c098f61bd35b11f907a3e215a7c08b504c3e529c67a4c8c5cbbf24775158966800e63efca260b4cc513417332cdf43a158d21684f09be3d89dd93258880 SHA512 76d53425b2a28f4f7887b323a70bf9b37df44302e0e25aff7156c1b3ee26ffa60bbfb45ed29a0f2fe763d5c38b8f7135ac2a3e405d8e2b10717f4893baf9c327
+DIST bareos-22.1.4.tar.gz 14747141 BLAKE2B 1b155c35f22120b07151a54ef314c6f8f42ea14c3f194d787a58ece41f8de148f0b34d0cc6a54f578b1bb5c4d3ae2a7736829f6d2cd642d8e001f1797a18052a SHA512 4285f0f524c6f30ae8f7dd67e2a732cf983663f56b053968a7f10d753e38bc2ee1e2673d1fb6a9b516994b51b45215fac153e301b893c9cb31a164ebff0d4c85
 DIST bareos-23.0.1.tar.gz 14728566 BLAKE2B e5fe93f0e412fcc4b4cb31f3e7d7dbcd44b3c0f76c387f17685d97880af88949998faae502531e937201c1622350d226c2cc9f432b0dfda7893a3fb03e905b5f SHA512 5e3902c33c08dedbdd8dc7c74c5a1258da22288a728ada283b541316a7bff2f7773d1875b11f8fe12368afda3fd1bb2780242ff57441ef8fd596f71ea1af1e75
 DIST bareos-23.0.2.tar.gz 14724410 BLAKE2B 0fe86c10d62ad322dfbcd5ac972aec27d6f0ad31e156d359398739b2bfd784a02ce89b26b6bdfcf279265114a4e6e13efe21edab8b87cff15f1f9f3ad055c64b SHA512 a8d8270c8060480fe87da9252de86a75eea1cc427db63536f848d19a2c23c499ca294a9656d9a6aac73a756f84c96a2d72f13d1cede7948e18bf93efc2ecfc29
 EBUILD bareos-21.1.8-r1.ebuild 11632 BLAKE2B f6061c7c734436520be5214cc1be9503f68fa1676eab2de762d25dc1c3adb12742c7f8d93fcec7580f223d3c56f9358e84e442f72502eb43b9362e69c6a264cf SHA512 1f3b6f93d27dff5caf7d6a09a0401269c889a85ecdf31f8c29fb9547985fd72d228855697f72b41718e82afb9ed6ea6d4bbc5092108b6ca065b5e9547c6f3ab6
+EBUILD bareos-21.1.9.ebuild 11633 BLAKE2B d0394fc3ccd10ee5074b2de6066529b58f55c0c8260790c7aecbcf0b558ddd6918e96c768bca851a5d20009d36df25ebd8fbf6fdf383a9b3a70c7c6a8187fcb2 SHA512 4eb5a628e0be7f1e815599b2b8223569f881e161e58511d8b990adaae286b45682e5c0453dbd8db5b9b00c8322b6f616fa989ef1da9ee9d72776112179c34e7c
 EBUILD bareos-22.1.2-r1.ebuild 12056 BLAKE2B febdc307ada813942bb9c22ee3552a95109e5e160e31e4466da5c6d6269e14116ab5b6c74020aa88ac19051de50bb81e12d44eb4123129cfe81e9400e913776f SHA512 3d874295dd34017853de37f8418c81dfbb5fcffa9df3be6f374edfa345ee2d670b551eef94562871845904663bfe4259da8c020b384d644f85c3fcbb2c521ffa
+EBUILD bareos-22.1.4.ebuild 12005 BLAKE2B 8a0491f51510f95b3038c5a316450c8e0f4d75cf73dede5c798659ca3da6efc772f4a58f66dc92205079e8d37aec6d209ff86d77bda019532b4f014a02449b0a SHA512 c6778b59413fa882b7dd25cdd7e46d2ecd4cbc15a9fe94a054659c7f25d74a44ee8a23cd25862be5fe5cb54d517a9396f85fd98ff48e01bec92f8b84d524522d
 EBUILD bareos-23.0.1.ebuild 12127 BLAKE2B 52dc21837cd79151c362cdc40fd778b3e3bdda578c2c87eb562ec2c30edd7da7a6cfc4a17f907db95845248aef19eeb63e078c319ae26e59ebcdaa10af7f8410 SHA512 314156a3cafdae3051cf02372e39c8016e647fefa895052edcf4b4692cc27d1d127200d1c22e156ed1b91497233f4f90c02a82e0c774f2bb8e0833326c710062
 EBUILD bareos-23.0.2.ebuild 12076 BLAKE2B 8f88d7515e3886cc17c40abef4b780ff741e5f3adf289724d5a9c8c7daa70db6dabb1697c1601da52f47fc207e77ad3d7b95d450842b793e0e516583b74cc6c1 SHA512 eea73586fe70baffb17520384302937f2fca94cefb3c84bf8a63f30cf66be3aec2694690497580a3be2d9dcb12f914c936a44675b273ec6b59d767de04834a80
 EBUILD bareos-9999.ebuild 12127 BLAKE2B 52dc21837cd79151c362cdc40fd778b3e3bdda578c2c87eb562ec2c30edd7da7a6cfc4a17f907db95845248aef19eeb63e078c319ae26e59ebcdaa10af7f8410 SHA512 314156a3cafdae3051cf02372e39c8016e647fefa895052edcf4b4692cc27d1d127200d1c22e156ed1b91497233f4f90c02a82e0c774f2bb8e0833326c710062
diff --git a/app-backup/bareos/bareos-21.1.9.ebuild b/app-backup/bareos/bareos-21.1.9.ebuild
new file mode 100644
index 000000000000..ae6b1efd9be1
--- /dev/null
+++ b/app-backup/bareos/bareos-21.1.9.ebuild
@@ -0,0 +1,414 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+CMAKE_WARN_UNUSED_CLI=no
+#CMAKE_REMOVE_MODULES=yes
+
+inherit python-any-r1 systemd cmake tmpfiles
+
+DESCRIPTION="Featureful client/server network backup suite"
+HOMEPAGE="https://www.bareos.org/"
+SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
+
+# some tests still fail propably due to missing bits in src_test -> TODO
+RESTRICT="mirror test"
+#RESTRICT="
+#	mirror
+#	!test? ( test )
+#"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X acl ceph clientonly +director glusterfs ipv6 lmdb
+	logwatch ndmp readline scsi-crypto split-usr
+	static +storage-daemon systemd tcpd test vim-syntax vmware xattr"
+
+# get cmake variables from core/cmake/BareosSetVariableDefaults.cmake
+DEPEND="
+	!app-backup/bacula
+	acct-group/${PN}
+	!x86? (
+		ceph? ( sys-cluster/ceph )
+	)
+	glusterfs? ( sys-cluster/glusterfs )
+	lmdb? ( dev-db/lmdb )
+	dev-libs/gmp:0
+	!clientonly? (
+		acct-user/${PN}
+		dev-db/postgresql:*[threads(+)]
+		director? (
+			virtual/mta
+		)
+	)
+	logwatch? ( sys-apps/logwatch )
+	ndmp? ( net-libs/rpcsvc-proto )
+	tcpd? ( sys-apps/tcp-wrappers )
+	readline? ( sys-libs/readline:0 )
+	static? (
+		acl? ( virtual/acl[static-libs] )
+		dev-libs/jansson:=[static-libs]
+		dev-libs/lzo[static-libs]
+		dev-libs/openssl:0=[static-libs]
+		sys-libs/ncurses:=[static-libs]
+		sys-libs/zlib[static-libs]
+	)
+	!static? (
+		acl? ( virtual/acl )
+		dev-libs/jansson:=
+		dev-libs/lzo
+		dev-libs/openssl:0=
+		sys-libs/ncurses:=
+		sys-libs/zlib
+	)
+	"
+RDEPEND="${DEPEND}
+	!clientonly? (
+		storage-daemon? (
+			sys-block/mtx
+			app-arch/mt-st
+		)
+	)
+	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+	"
+
+BDEPEND="
+	${PYTHON_DEPS}
+	test? (
+		dev-cpp/gtest
+		dev-db/postgresql:*[server,threads(+)]
+		dev-db/mariadb:*[server]
+	)
+"
+
+REQUIRED_USE="
+	static? ( clientonly )
+	x86? ( !ceph )
+"
+
+S=${WORKDIR}/${PN}-Release-${PV}
+
+pkg_pretend() {
+	local active_removed_backend=""
+	if has_version "<app-backup/bareos-21[director,mysql]"; then
+		if grep -qhriE "dbdriver.*=.*mysql" /etc/bareos/; then
+			active_removed_backend=MySQL
+		fi
+	elif has_version "<app-backup/bareos-21[director,sqlite]"; then
+		if grep -qhriE "dbdriver.*=.*sqlite" /etc/bareos/; then
+			active_removed_backend=SQLite
+		fi
+	fi
+	if [[ -n $active_removed_backend ]]; then
+		ewarn
+		ewarn "You are currently using bareos with the $active_removed_backend"
+		ewarn "catalog backend."
+		ewarn
+		ewarn "THIS IS NOT SUPPORTED ANYMORE"
+		ewarn
+		ewarn "Beginning with version 21.0.0 bareos has dropped support for"
+		ewarn "MySQL and SQLite catalog backends."
+		ewarn
+		ewarn "To upgrade to bareos >=21.0.0 you need to migrate to PostgreSQL"
+		ewarn "catalog backend using the 'bareos-dbcopy' tool of your current"
+		ewarn "installation first."
+		ewarn
+		die "current catalog backend not supported anymore"
+	fi
+}
+
+src_test() {
+	# initialze catalog test database
+	initdb -D "${T}"/pgsql || die
+	pg_ctl -w -D "${T}"/pgsql start \
+		-o "-h '' -k '${T}'" || die
+	createuser -h "${T}" bareos || die
+	createdb -h "${T}" --owner bareos bareos || die
+	export PGHOST="${T}"
+
+	# initiale mariadb database for backup tests
+	# $USER must be set and != root
+	export USER=portage
+
+	default
+	cmake_src_test
+
+	pg_ctl -w -D "${T}"/pgsql stop || die
+	rm -rvf "${T}"/pgsql
+}
+
+src_prepare() {
+	# fix gentoo platform support
+	eapply -p1 "${FILESDIR}/${PN}-21-cmake-gentoo.patch"
+	eapply "${FILESDIR}/${PN}-21.1.2-werror.patch"
+	eapply "${FILESDIR}/${PN}-21.1.2-no-automagic-ccache.patch"
+	eapply "${FILESDIR}/${PN}-21.1.8-gcc14-fixes.patch"
+
+	# fix missing DESTDIR in symlink creation
+	sed -i '/bareos-symlink-default-db-backend.cmake/d' "${S}/core/src/cats/CMakeLists.txt"
+
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=()
+
+	cmake_comment_add_subdirectory webui
+
+	if use clientonly; then
+		mycmakeargs+=(
+			-Dclient-only=ON
+			-Dstatic-cons=$(usex static)
+			-Dstatic-fd=$(usex static)
+		)
+	fi
+
+	for useflag in acl ipv6 ndmp scsi-crypto \
+		systemd lmdb; do
+		mycmakeargs+=( -D$useflag=$(usex $useflag) )
+	done
+
+	mycmakeargs+=(
+		-DHAVE_PYTHON=0
+		-Darchivedir=/var/lib/bareos/storage
+		-Dbackenddir=/usr/$(get_libdir)/${PN}/backend
+		-Dbasename="`hostname -s`"
+		-Dbatch-insert=yes
+		-Dbsrdir=/var/lib/bareos/bsr
+		-Dconfdir=/etc/bareos
+		-Dcoverage=no
+		-Ddb_password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
+		-Ddir-group=bareos
+		-Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Ddir-user=bareos
+		-Ddocdir=/usr/share/doc/${PF}
+		-Ddynamic-cats-backends=yes
+		-Ddynamic-storage-backends=yes
+		-Dfd-group=bareos
+		-Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dfd-user=root
+		-Dhost=${CHOST}
+		-Dhostname="`hostname -s`"
+		-Dhtmldir=/usr/share/doc/${PF}/html
+		-Dlibdir=/usr/$(get_libdir)
+		-Dlogdir=/var/log/bareos
+		-Dmandir=/usr/share/man
+		-Dmon-dir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dmon-fd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dmon-sd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dopenssl=yes
+		-Dpiddir=/run/bareos
+		-Dplugindir=/usr/$(get_libdir)/${PN}/plugin
+		-Dsbin-perm=0755
+		-Dsbindir=/usr/sbin
+		-Dscriptdir=/usr/libexec/bareos
+		-Dsd-group=bareos
+		-Dsd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dsd-user=root
+		-Dsubsysdir=/run/lock/subsys
+		-Dsysconfdir=/etc
+		-Dworkingdir=/var/lib/bareos
+		-Dx=$(usex X)
+		)
+
+		# disable droplet support for now as it does not build with gcc 10
+		# ... and this is a bundled lib, which should have its own package
+		cd core && cmake_comment_add_subdirectory "src/droplet"
+
+		cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+
+	# remove some scripts we don't need at all
+	rm -f "${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd}
+	rm -f "${D}"/usr/sbin/bareos
+
+	# remove upstream init scripts and systemd units
+	rm -f "${D}"/etc/init.d/bareos-* "${D}"/lib/systemd/system/bareos-*.service
+
+	# remove misc stuff we do not need in production
+	rm -f "${D}"/etc/bareos/bareos-regress.conf
+	rm -f "${D}"/etc/logrotate.d/bareos-dir
+
+	# remove duplicate binaries being installed in /usr/sbin and replace
+	# them by symlinks to not break systems that still use split-usr
+	if use split-usr; then
+		for f in bwild bregex bsmtp bconsole; do
+			rm -f "${D}/usr/sbin/$f" || die
+			ln -s "../bin/$f" "${D}/usr/sbin/$f" || die
+		done
+	fi
+
+	# get rid of py2 stuff
+	rm -rf "$D"/usr/lib64/python2.7 || die
+	rm -f "$D"/usr/lib64/bareos/plugin/python-fd.so || die
+	if ! use vmware; then
+		rm -f "$D"/usr/lib64/bareos/plugin/{BareosFdPluginVMware.py,bareos-fd-vmware.py}
+	fi
+
+	# rename statically linked apps
+	if use clientonly && use static ; then
+		pushd "${D}"/usr/sbin || die
+		mv static-bareos-fd bareos-fd || die
+		mv static-bconsole bconsole || die
+		popd || die
+	fi
+
+	# extra files which 'make install' doesn't cover
+	if ! use clientonly; then
+		# the logrotate configuration
+		# (now unconditional wrt bug #258187)
+		diropts -m0755
+		insinto /etc/logrotate.d
+		insopts -m0644
+		newins "${S}"/core/scripts/logrotate bareos
+
+		# the logwatch scripts
+		if use logwatch; then
+			diropts -m0750
+			dodir /etc/log.d/scripts/services
+			dodir /etc/log.d/scripts/shared
+			dodir /etc/log.d/conf/logfiles
+			dodir /etc/log.d/conf/services
+			pushd "${S}"/core/scripts/logwatch >&/dev/null || die
+
+			into /etc/log.d/scripts/services
+			dobin bareos
+
+			into /etc/log.d/scripts/shared
+			dobin applybareosdate
+
+			insinto /etc/log.d/conf/logfiles
+			newins logfile.bareos.conf bareos.conf
+
+			insinto /etc/log.d/conf/services
+			newins services.bareos.conf bareos.conf
+
+			popd >&/dev/null || die
+		fi
+	fi
+
+	rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
+	if use clientonly || ! use director; then
+		rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
+		rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
+		rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
+		rm -vf "${D}"/usr/share/man/man8/bwild.8*
+		rm -vf "${D}"/usr/share/man/man8/bregex.8*
+		rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
+		rm -vf "${D}"/usr/libexec/bareos/create_*_database
+		rm -vf "${D}"/usr/libexec/bareos/drop_*_database
+		rm -vf "${D}"/usr/libexec/bareos/make_*_tables
+		rm -vf "${D}"/usr/libexec/bareos/update_*_tables
+		rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
+		rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
+		rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
+	fi
+	if use clientonly || ! use storage-daemon; then
+		rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
+		rm -vf "${D}"/usr/share/man/man8/bcopy.8*
+		rm -vf "${D}"/usr/share/man/man8/bextract.8*
+		rm -vf "${D}"/usr/share/man/man8/bls.8*
+		rm -vf "${D}"/usr/share/man/man8/bscan.8*
+		rm -vf "${D}"/usr/share/man/man8/btape.8*
+		rm -vf "${D}"/usr/libexec/bareos/disk-changer
+		rm -vf "${D}"/usr/libexec/bareos/mtx-changer
+		rm -vf "${D}"/usr/libexec/bareos/dvd-handler
+		rm -vf "${D}"/etc/bareos/mtx-changer.conf
+	fi
+	if ! use scsi-crypto; then
+		rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
+	fi
+
+	# documentation
+	dodoc README.md
+	dodoc core/README.configsubdirectories
+	use glusterfs dodoc core/README.glusterfs
+	use ndmp && dodoc core/README.NDMP
+	use scsi-crypto && dodoc core/README.scsicrypto
+
+	# vim-files
+	if use vim-syntax; then
+		insinto /usr/share/vim/vimfiles/syntax
+		doins core/scripts/bareos.vim
+		insinto /usr/share/vim/vimfiles/ftdetect
+		newins core/scripts/filetype.vim bareos_ft.vim
+	fi
+
+	# setup init scripts
+	myscripts="bareos-fd"
+	if ! use clientonly; then
+		if use director; then
+			myscripts+=" bareos-dir"
+		fi
+		if use storage-daemon; then
+			myscripts+=" bareos-sd"
+		fi
+	fi
+	for script in ${myscripts}; do
+		# install init script and config
+		newinitd "${FILESDIR}/${script}-21-r1".initd "${script}"
+		newconfd "${FILESDIR}/${script}-21".confd "${script}"
+	done
+
+	# install systemd unit files
+	if use systemd; then
+		if ! use clientonly; then
+			use director && systemd_newunit "${FILESDIR}"/bareos-dir-21.service bareos-dir.service
+			use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
+		fi
+		systemd_dounit "${FILESDIR}"/bareos-fd.service
+	fi
+
+	# make sure the working directory exists
+	diropts -m0750
+	keepdir /var/lib/bareos
+	keepdir /var/lib/bareos/storage
+
+	# set log directory ownership
+	if ! use clientonly; then
+		diropts -m0755 -o bareos -g bareos
+	fi
+	keepdir /var/log/bareos
+
+	newtmpfiles "${FILESDIR}"/tmpfiles.d-bareos.conf bareos.conf
+
+	# make sure bareos group can execute bareos libexec scripts
+	fowners -R root:bareos /usr/libexec/bareos
+}
+
+pkg_postinst() {
+	tmpfiles_process bareos.conf
+
+	if use clientonly; then
+		fowners root:bareos /var/lib/bareos
+	else
+		fowners bareos:bareos /var/lib/bareos
+	fi
+
+	if ! use clientonly && use director; then
+		einfo
+		einfo "If this is a new install, you must create the database:"
+		einfo
+		einfo "  su postgres -c '/usr/libexec/bareos/create_bareos_database'"
+		einfo "  su postgres -c '/usr/libexec/bareos/make_bareos_tables'"
+		einfo "  su postgres -c '/usr/libexec/bareos/grant_bareos_privileges'"
+		einfo
+		einfo "or run"
+		einfo
+		einfo " emerge --config app-backup/bareos"
+		einfo
+		einfo "to do this"
+	fi
+}
+
+pkg_config() {
+	su postgres -c '/usr/libexec/bareos/create_bareos_database' || die "could not create bareos database"
+	su postgres -c '/usr/libexec/bareos/make_bareos_tables' || die "could not create bareos database tables"
+	su postgres -c '/usr/libexec/bareos/grant_bareos_privileges' || die "could not grant bareos database privileges"
+}
diff --git a/app-backup/bareos/bareos-22.1.4.ebuild b/app-backup/bareos/bareos-22.1.4.ebuild
new file mode 100644
index 000000000000..d0de880031c4
--- /dev/null
+++ b/app-backup/bareos/bareos-22.1.4.ebuild
@@ -0,0 +1,434 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+CMAKE_WARN_UNUSED_CLI=no
+
+inherit python-any-r1 systemd cmake tmpfiles
+
+if [[ ${PV} == *9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
+else
+	SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
+
+	KEYWORDS="~amd64 ~x86"
+	S=${WORKDIR}/${PN}-Release-${PV}
+fi
+
+DESCRIPTION="Featureful client/server network backup suite"
+HOMEPAGE="https://www.bareos.org/"
+
+# some tests still fail propably due to missing bits in src_test -> TODO
+RESTRICT="mirror test"
+#RESTRICT="
+#	mirror
+#	!test? ( test )
+#"
+
+LICENSE="AGPL-3"
+SLOT="0"
+IUSE="X acl ceph clientonly +director glusterfs ipv6 lmdb
+	logwatch ndmp readline scsi-crypto split-usr
+	static +storage-daemon systemd tcpd test vim-syntax vmware xattr"
+
+# get cmake variables from core/cmake/BareosSetVariableDefaults.cmake
+DEPEND="
+	!app-backup/bacula
+	acct-group/${PN}
+	!x86? (
+		ceph? ( sys-cluster/ceph )
+	)
+	glusterfs? ( sys-cluster/glusterfs )
+	lmdb? ( dev-db/lmdb )
+	dev-libs/gmp:0
+	!clientonly? (
+		acct-user/${PN}
+		dev-db/postgresql:*[threads(+)]
+		director? (
+			virtual/mta
+		)
+	)
+	logwatch? ( sys-apps/logwatch )
+	ndmp? ( net-libs/rpcsvc-proto )
+	tcpd? ( sys-apps/tcp-wrappers )
+	readline? ( sys-libs/readline:0 )
+	static? (
+		acl? ( virtual/acl[static-libs] )
+		dev-libs/jansson:=[static-libs]
+		dev-libs/lzo[static-libs]
+		dev-libs/openssl:0=[static-libs]
+		sys-libs/ncurses:=[static-libs]
+		sys-libs/zlib[static-libs]
+	)
+	!static? (
+		acl? ( virtual/acl )
+		dev-libs/jansson:=
+		dev-libs/lzo
+		dev-libs/openssl:0=
+		sys-libs/ncurses:=
+		sys-libs/zlib
+	)
+	X? (
+		dev-qt/qtwidgets:5=
+	)
+	"
+RDEPEND="${DEPEND}
+	!clientonly? (
+		storage-daemon? (
+			sys-block/mtx
+			app-arch/mt-st
+		)
+	)
+	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+	"
+
+BDEPEND="
+	${PYTHON_DEPS}
+	test? (
+		dev-cpp/gtest
+		dev-db/postgresql:*[server,threads(+)]
+		dev-db/mariadb:*[server]
+	)
+"
+
+REQUIRED_USE="
+	static? ( clientonly )
+	x86? ( !ceph )
+"
+
+PATCHES=(
+	# fix gentoo platform support
+	"${FILESDIR}/${PN}-21-cmake-gentoo.patch"
+	"${FILESDIR}/${PN}-22.0.2-werror.patch"
+	"${FILESDIR}/${PN}-21.1.2-no-automagic-ccache.patch"
+)
+
+pkg_pretend() {
+	local active_removed_backend=""
+	if has_version "<app-backup/bareos-21[director,mysql]"; then
+		if grep -qhriE "dbdriver.*=.*mysql" /etc/bareos/; then
+			active_removed_backend=MySQL
+		fi
+	elif has_version "<app-backup/bareos-21[director,sqlite]"; then
+		if grep -qhriE "dbdriver.*=.*sqlite" /etc/bareos/; then
+			active_removed_backend=SQLite
+		fi
+	fi
+	if [[ -n $active_removed_backend ]]; then
+		ewarn
+		ewarn "You are currently using bareos with the $active_removed_backend"
+		ewarn "catalog backend."
+		ewarn
+		ewarn "THIS IS NOT SUPPORTED ANYMORE"
+		ewarn
+		ewarn "Beginning with version 21.0.0 bareos has dropped support for"
+		ewarn "MySQL and SQLite catalog backends."
+		ewarn
+		ewarn "To upgrade to bareos >=21.0.0 you need to migrate to PostgreSQL"
+		ewarn "catalog backend using the 'bareos-dbcopy' tool of your current"
+		ewarn "installation first."
+		ewarn
+		die "current catalog backend not supported anymore"
+	fi
+}
+
+src_test() {
+	# initialze catalog test database
+	initdb -D "${T}"/pgsql || die
+	pg_ctl -w -D "${T}"/pgsql start \
+		-o "-h '' -k '${T}'" || die
+	createuser -h "${T}" bareos || die
+	createdb -h "${T}" --owner bareos bareos || die
+	export PGHOST="${T}"
+
+	# initiale mariadb database for backup tests
+	# $USER must be set and != root
+	export USER=portage
+
+	default
+	cmake_src_test
+
+	pg_ctl -w -D "${T}"/pgsql stop || die
+	rm -rvf "${T}"/pgsql
+}
+
+src_prepare() {
+	# fix missing DESTDIR in symlink creation
+	sed -i '/bareos-symlink-default-db-backend.cmake/d' "${S}/core/src/cats/CMakeLists.txt"
+
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=()
+
+	cmake_comment_add_subdirectory webui
+
+	if use clientonly; then
+		mycmakeargs+=(
+			-Dclient-only=ON
+			-Dstatic-cons=$(usex static)
+			-Dstatic-fd=$(usex static)
+		)
+	fi
+
+	for useflag in acl ipv6 ndmp scsi-crypto \
+		systemd lmdb; do
+		mycmakeargs+=( -D$useflag=$(usex $useflag) )
+	done
+	if use X; then
+		mycmakeargs+=( -Dtraymonitor=yes )
+	fi
+
+	mycmakeargs+=(
+		-DHAVE_PYTHON=0
+		-Darchivedir=/var/lib/bareos/storage
+		-Dbackenddir=/usr/$(get_libdir)/${PN}/backend
+		-Dbasename="`hostname -s`"
+		-Dbatch-insert=yes
+		-Dbsrdir=/var/lib/bareos/bsr
+		-Dconfdir=/etc/bareos
+		-Dcoverage=no
+		-Ddb_password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
+		-Ddir-group=bareos
+		-Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Ddir-user=bareos
+		-Ddocdir=/usr/share/doc/${PF}
+		-Ddynamic-cats-backends=yes
+		-Ddynamic-storage-backends=yes
+		-Dfd-group=bareos
+		-Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dfd-user=root
+		-Dhost=${CHOST}
+		-Dhostname="`hostname -s`"
+		-Dhtmldir=/usr/share/doc/${PF}/html
+		-Dlibdir=/usr/$(get_libdir)
+		-Dlogdir=/var/log/bareos
+		-Dmandir=/usr/share/man
+		-Dmon-dir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dmon-fd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dmon-sd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dopenssl=yes
+		-Dpiddir=/run/bareos
+		-Dplugindir=/usr/$(get_libdir)/${PN}/plugin
+		-Dsbin-perm=0755
+		-Dsbindir=/usr/sbin
+		-Dscriptdir=/usr/libexec/bareos
+		-Dsd-group=bareos
+		-Dsd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+		-Dsd-user=root
+		-Dsubsysdir=/run/lock/subsys
+		-Dsysconfdir=/etc
+		-Dworkingdir=/var/lib/bareos
+		-Dx=$(usex X)
+		)
+
+		# disable droplet support for now as it does not build with gcc 10
+		# ... and this is a bundled lib, which should have its own package
+		cd core && cmake_comment_add_subdirectory "src/droplet"
+
+		cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+
+	# remove some scripts we don't need at all
+	rm -f "${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd}
+	rm -f "${D}"/usr/sbin/bareos
+
+	# remove upstream init scripts and systemd units
+	rm -f "${D}"/etc/init.d/bareos-* "${D}"/lib/systemd/system/bareos-*.service
+
+	# remove misc stuff we do not need in production
+	rm -f "${D}"/etc/bareos/bareos-regress.conf
+	rm -f "${D}"/etc/logrotate.d/bareos-dir
+
+	# remove duplicate binaries being installed in /usr/sbin and replace
+	# them by symlinks to not break systems that still use split-usr
+	if use split-usr; then
+		for f in bwild bregex bsmtp bconsole; do
+			rm -f "${D}/usr/sbin/$f" || die
+			ln -s "../bin/$f" "${D}/usr/sbin/$f" || die
+		done
+	fi
+
+	# get rid of py2 stuff
+	rm -rf "$D"/usr/lib64/python2.7 || die
+	rm -f "$D"/usr/lib64/bareos/plugin/python-fd.so || die
+	if ! use vmware; then
+		rm -f "$D"/usr/lib64/bareos/plugin/{BareosFdPluginVMware.py,bareos-fd-vmware.py}
+	fi
+
+	# rename statically linked apps
+	if use clientonly && use static ; then
+		pushd "${D}"/usr/sbin || die
+		mv static-bareos-fd bareos-fd || die
+		mv static-bconsole bconsole || die
+		popd || die
+	fi
+
+	# extra files which 'make install' doesn't cover
+	if ! use clientonly; then
+		# the logrotate configuration
+		# (now unconditional wrt bug #258187)
+		diropts -m0755
+		insinto /etc/logrotate.d
+		insopts -m0644
+		newins "${S}"/core/scripts/logrotate bareos
+
+		# the logwatch scripts
+		if use logwatch; then
+			diropts -m0750
+			dodir /etc/log.d/scripts/services
+			dodir /etc/log.d/scripts/shared
+			dodir /etc/log.d/conf/logfiles
+			dodir /etc/log.d/conf/services
+			pushd "${S}"/core/scripts/logwatch >&/dev/null || die
+
+			into /etc/log.d/scripts/services
+			dobin bareos
+
+			into /etc/log.d/scripts/shared
+			dobin applybareosdate
+
+			insinto /etc/log.d/conf/logfiles
+			newins logfile.bareos.conf bareos.conf
+
+			insinto /etc/log.d/conf/services
+			newins services.bareos.conf bareos.conf
+
+			popd >&/dev/null || die
+		fi
+	fi
+
+	rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
+	if use clientonly || ! use director; then
+		rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
+		rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
+		rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
+		rm -vf "${D}"/usr/share/man/man8/bwild.8*
+		rm -vf "${D}"/usr/share/man/man8/bregex.8*
+		rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
+		rm -vf "${D}"/usr/libexec/bareos/create_*_database
+		rm -vf "${D}"/usr/libexec/bareos/drop_*_database
+		rm -vf "${D}"/usr/libexec/bareos/make_*_tables
+		rm -vf "${D}"/usr/libexec/bareos/update_*_tables
+		rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
+		rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
+		rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
+	fi
+	if use clientonly || ! use storage-daemon; then
+		rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
+		rm -vf "${D}"/usr/share/man/man8/bcopy.8*
+		rm -vf "${D}"/usr/share/man/man8/bextract.8*
+		rm -vf "${D}"/usr/share/man/man8/bls.8*
+		rm -vf "${D}"/usr/share/man/man8/bscan.8*
+		rm -vf "${D}"/usr/share/man/man8/btape.8*
+		rm -vf "${D}"/usr/libexec/bareos/disk-changer
+		rm -vf "${D}"/usr/libexec/bareos/mtx-changer
+		rm -vf "${D}"/usr/libexec/bareos/dvd-handler
+		rm -vf "${D}"/etc/bareos/mtx-changer.conf
+	fi
+	if ! use scsi-crypto; then
+		rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
+	fi
+
+	# documentation
+	dodoc README.md
+	dodoc core/README.configsubdirectories
+	use glusterfs dodoc core/README.glusterfs
+	use ndmp && dodoc core/README.NDMP
+	use scsi-crypto && dodoc core/README.scsicrypto
+
+	# vim-files
+	if use vim-syntax; then
+		insinto /usr/share/vim/vimfiles/syntax
+		doins core/scripts/bareos.vim
+		insinto /usr/share/vim/vimfiles/ftdetect
+		newins core/scripts/filetype.vim bareos_ft.vim
+	fi
+
+	# setup init scripts
+	myscripts="bareos-fd"
+	if ! use clientonly; then
+		if use director; then
+			myscripts+=" bareos-dir"
+		fi
+		if use storage-daemon; then
+			myscripts+=" bareos-sd"
+		fi
+	fi
+	for script in ${myscripts}; do
+		# install init script and config
+		newinitd "${FILESDIR}/${script}-21-r1".initd "${script}"
+		newconfd "${FILESDIR}/${script}-21".confd "${script}"
+	done
+
+	# install systemd unit files
+	if use systemd; then
+		if ! use clientonly; then
+			use director && systemd_newunit "${FILESDIR}"/bareos-dir-21.service bareos-dir.service
+			use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
+		fi
+		systemd_dounit "${FILESDIR}"/bareos-fd.service
+	fi
+
+	# make sure the working directory exists
+	diropts -m0750
+	keepdir /var/lib/bareos
+	keepdir /var/lib/bareos/storage
+
+	# set log directory ownership
+	if ! use clientonly; then
+		diropts -m0755 -o bareos -g bareos
+	fi
+	keepdir /var/log/bareos
+
+	newtmpfiles "${FILESDIR}"/tmpfiles.d-bareos.conf bareos.conf
+
+	# make sure bareos group can execute bareos libexec scripts
+	fowners -R root:bareos /usr/libexec/bareos
+}
+
+pkg_postinst() {
+	tmpfiles_process bareos.conf
+
+	if use clientonly; then
+		fowners root:bareos /var/lib/bareos
+	else
+		fowners bareos:bareos /var/lib/bareos
+	fi
+
+	if ! use clientonly && use director; then
+		einfo
+		einfo "If this is a new install, you must create the database:"
+		einfo
+		einfo "  su postgres -c '/usr/libexec/bareos/create_bareos_database'"
+		einfo "  su postgres -c '/usr/libexec/bareos/make_bareos_tables'"
+		einfo "  su postgres -c '/usr/libexec/bareos/grant_bareos_privileges'"
+		einfo
+		einfo "or run"
+		einfo
+		einfo " emerge --config app-backup/bareos"
+		einfo
+		einfo "to do this"
+		einfo
+		einfo "For major upgrades you may need to run:"
+		einfo
+		einfo "  su postgres -c '/usr/libexec/bareos/update_bareos_tables'"
+		einfo
+		einfo "Please see release notes for details."
+		einfo "( https://docs.bareos.org/Appendix/ReleaseNotes.html )"
+		einfo
+	fi
+}
+
+pkg_config() {
+	su postgres -c '/usr/libexec/bareos/create_bareos_database' || die "could not create bareos database"
+	su postgres -c '/usr/libexec/bareos/make_bareos_tables' || die "could not create bareos database tables"
+	su postgres -c '/usr/libexec/bareos/grant_bareos_privileges' || die "could not grant bareos database privileges"
+}
-- 
cgit v1.2.3