summaryrefslogtreecommitdiff
path: root/app-backup/bareos
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
commitfcc5224904648a8e6eb528d7603154160a20022f (patch)
tree3bfce096b38a9cea8eed13fc70c1526c456e9abd /app-backup/bareos
parent2fd57282f0262ca084e05b0f2c63fbada395d02b (diff)
gentoo resync : 02.02.2022
Diffstat (limited to 'app-backup/bareos')
-rw-r--r--app-backup/bareos/Manifest10
-rw-r--r--app-backup/bareos/bareos-20.0.5.ebuild (renamed from app-backup/bareos/bareos-20.0.3-r2.ebuild)4
-rw-r--r--app-backup/bareos/bareos-21.0.0.ebuild359
-rw-r--r--app-backup/bareos/files/bareos-21-cmake-gentoo.patch12
-rw-r--r--app-backup/bareos/files/bareos-dir-21.confd10
-rw-r--r--app-backup/bareos/files/bareos-dir-21.initd31
-rw-r--r--app-backup/bareos/files/bareos-dir-21.service32
7 files changed, 454 insertions, 4 deletions
diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
index 8214c78bbbae..121a792257be 100644
--- a/app-backup/bareos/Manifest
+++ b/app-backup/bareos/Manifest
@@ -1,7 +1,11 @@
AUX bareos-20.0.2-cmake-gentoo.patch 1332 BLAKE2B b84158913e0bf051013681f8583546add34d48ea56647beb057525a0da1fff57dcd06c20dd125f300e34a42adb450c3a00456077de914dedf50b5a68748ef1ae SHA512 61e2b119d12daa60bf1fa0bc1de81d4322df421c6c5d2de4e823686f8a8657f521d53256533b52b17a105a25ef8070058144620d71aa295b491d2a39bc7de2f4
+AUX bareos-21-cmake-gentoo.patch 694 BLAKE2B a01f469c1f61a5887dd75779c96fdebf666989c9ec203d478291bb58d8ae974e624c6d83977247f47fdc9cdcae0761552a2864e31ec26cbd64317610bc87613f SHA512 225afe4c2d9ee7774d34776071b8b8430c0a4c28e8a2b301fb5f3963ae4b02ea6f6020082d4bcc0ba937728cd57f77ba19fbc176f8f14c0dc28fa98135fb3c80
AUX bareos-cmake-gentoo.patch 516 BLAKE2B 685734517fc166413250782ed35445761b19efd9b7ffedb8436a71f5aea84e38633c61318c914169d3ea40daf0c45e3fe229136cdb1a98dc087cd56b91a4b1d2 SHA512 c0d89844a66f851f556e00faf42e85157c744f1547b37d95f5dd0c58a0ab62fb60a8aead87546ea37f5f9d0eb247a3e1a715d042aafe9b422a3eefe37518b743
AUX bareos-cmake-rados.patch 718 BLAKE2B be3c5822a122fb9d6a5bdd6cb388e3edbb59c6e2aafb9e16991bf0c62ab2dbdf0757de88382318bbd9f6b0fb7d48de11c9d0cd6ab276b6fb6c4f61f8b756237a SHA512 46b6ced3bcdf7e6a72029803a60775cfc06b2313004214dfe7d7ffa64f954fb80cb93f7374b967b33b4035aac8fce4412f13833aa57a83e4ce98c503f147918e
AUX bareos-cmake-symlink-default-db-backend.patch 779 BLAKE2B edb161632215ed8bdc75cae27d54f603787d5f3cbfcf19e180cb7234f661c35527c24dfef38b7c455fd28a46539eae94d157c4777549381c0db64c5fe531d35d SHA512 f5c07d611b7e9f5dc85e0e1440b5bcf43f80a6a6a3b7aead0b88a7a924c9cc8c42bad016d81a0ad55baecc5888e850a516bc86b52a65ddf460c3059fe7f299ee
+AUX bareos-dir-21.confd 357 BLAKE2B d2cd8da7fea60011752d043b307d0df08c655201a384dbe9406ba491a1463412e1353239c6933b6cd44258f452393f92d80760c657c44cd92c613d6b5422e777 SHA512 4a4b3a2aac3d13f3ce9192652cbc2bbd6c5723e13cf4f602e4094c1df8ce646b3ccf2e56ef8125e2cc410ce885fe1a7b483f2aa167ddadcb25e7c781075b8356
+AUX bareos-dir-21.initd 886 BLAKE2B 6ea7ee1717c5ab5241cbd4427b5eef1c96eee8c2e297b8d1cf0cd77ee8564bcb69add8b29daa6676a31640b33c40df332a30a41e28abe559f531b30053a8de47 SHA512 c1a61e7c5c2c9cbafb3e599e357c598cc4e3c80d9cc79dc8c6d93c21188c1a7820d1f3c86b5b897cd5e3509a63dbbfaab50c0dc2965a21f13aaa8d7ede374561
+AUX bareos-dir-21.service 884 BLAKE2B c0a4fb957588136cd043be2670a03e05bd5ffad4ae87275636642961e0e105ff07fb0614490a71771bb7eecfb551e6f860d8d41104e56ea8c5d434c84c5602a8 SHA512 187e331f8495d27d14434bd71baace7051d254e2886c3814493600973cd830cb01f27153321821e0a3bd2356d55f39cf0878488297079ed80bcfb2693cc77809
AUX bareos-dir.confd 640 BLAKE2B 0c80793f66ef9f3b46995a2dcf150b3d7a8a9f53ff97896887314ab31d6082949ac3db2c260b2fc7551c035183c31558cc853f768eca5b0bebdfa483280780b5 SHA512 af71699773ade63c98e2016f48b4d108f29a419a7533444245df4507a7ad7b807948986f9f850ce1f9af58fb445ecd44a5d880f68732b371a7a87dbc5a25ec7c
AUX bareos-dir.initd 869 BLAKE2B 80fec7cbe9b4f80f2f5b6152243ad7aa79760dc5198473515e5642ca29255f869d59b83465f87543e42ffc80ba0b3b277e437ff3446c005c5338350e1d04175f SHA512 ea54b7e569cfa69e6b2d996352dedd52487d1eb6f7776d970c3a9efa7e13f40d12b3b8d7388f035d5d84c2096c7644f5834495cc5b4084203e71b2bd0d833e8f
AUX bareos-dir.service 841 BLAKE2B e8c9508984f2823b334c3ef3c412f51e50666cd45aea1c5491a3ce6b1fadf09e7e0cb836d0658f5398209aa0a478c5a6b4fa1b67476e0fc317d6e25bc0fc54a8 SHA512 8f886d3c60959f009cf5f626f64071eb5d768ebf6c5ac0dd0c0c34d866d29563a2f0c68519363170ac35595cc743b432f46a54ce10bbfa530971f56b9914b0a9
@@ -14,8 +18,10 @@ AUX bareos-sd.service 812 BLAKE2B 7ac9754d98ea177614450045fbbaf7406592b30a280646
AUX tmpfiles.d-bareos.conf 33 BLAKE2B 68feed7629dde0dad019470851cea33140be3b17186fbbee7ad6c6a591978236ec09252d890117030d8706d22ea02f9971063aa80a393d3726510128527401d0 SHA512 65d3f72e57eb3afc557ab6b56a8ec1895a679b904114fefd1c9d0ceeb6b9fa8413575591ed81e1ce6963bdaf34dad227e781865b39bb237afc6bb5652306d2ef
DIST bareos-18.2.12.tar.gz 10566403 BLAKE2B 765a5430c495b21edc0c22d6903e23d312b1dc2b94e0d2a4227c10a38be8fe638636cf32a58e8aaf83b389581bf1348b4d27be6886f61180c20496acbd0eb015 SHA512 1d308d3021e8277832ce933fbafdf514bc194a1a2a2d761e66fb26ec2af419d19ae38894a7cb56e036c5af003bf640117b5a11954d478b35e13a02007f99f4de
DIST bareos-19.2.11.tar.gz 12890679 BLAKE2B 2872e4eed8186f024211faeefcb5b38448f38d90a2c7c73ef8fa1e51d3a917344a7acbe09a01d0205ad312ec136161eb1b0aa28dcceabbf71d78206a724602b0 SHA512 46769f6e26068669c2656ed8afc73dbd6f07a88d65cf557193684c130bdb93567f3ab06374484be499e5edb7bdd32013edecb05ff19843d3d806a38ca1892749
-DIST bareos-20.0.3.tar.gz 13335390 BLAKE2B c35ab9fd290377fc56ae8ff87f54b1cde5d1b7caa89b9c97e259da48da4e07fa85cba38c5a4d461b7ce170f9b14a69f78ad217584abb77ee15d3e85080cbe49b SHA512 3f9bf020e0d519da75221ebd200634713c791e2fdc90a13482ffb3294912d5e2ee28f8338dbef06ba6c98727bae447f6f8bb8d4a06520001f7cefa3614769082
+DIST bareos-20.0.5.tar.gz 13343612 BLAKE2B 78fc178b021165377cb912593f56c248fed68b44deab3626087c9fc10d2eeb866730b734e0ba5982424b4bbb875d734e62351c8114c947057478d4929df2ca2c SHA512 a61141944c24042f2b9f977672564923d4912756c821abe516f94a2c21f5b990236f22187c8567956edef09029f740552c3bc6c30f8c6d65c3f0b06b84ef00e7
+DIST bareos-21.0.0.tar.gz 11306618 BLAKE2B 0363465c40a8053bb5ec772c18ac0dc852f379979e3afc45dd29c79f8187238363c1f07e2f39d25613404b1b6e253700b33b274389ca2dc4655d201bc4888166 SHA512 0a57bccca0589f3ce8a5664afbeb1eb1b17ec7142722e2d0bb2a0bbd9007688725b39c6db59646c180ce096e55451c09934e6479a2b4deeb4d3ee738ab2c32cd
EBUILD bareos-18.2.12-r1.ebuild 11168 BLAKE2B 952379f3531292e6b20e0e81d9be6d8384b8a76b1747a340310032c1ed0cf5b38415e6b6fc4edafb46b4e836cebce2dc73532fcc7b5737b1464deecec3c1e3ca SHA512 f8878820c0eeb8fc178b65579fe55230b8534b9e37b69ccacb1818635066a8fca016dbd818394b9b1e5916b49c31cee24abb9591dcbc7ed2a094146bb18adb41
EBUILD bareos-19.2.11-r1.ebuild 10915 BLAKE2B c0101e1fd5a33994bb42b9a460fca12ed422eb4a99a23d6e7333c29b94bf117c39efb1cde61f82b9fda9a00ccc0452187ab8a74ccf6d4e3fdcd813fc9d219908 SHA512 0880c16abaad7ad94bdb75d77e4069994872bfb74b03f496127a936c46d21bb5bf2bbc5b8c078d9a0ecdd3aca40845d72b67bd475b006edabfd57657401979b4
-EBUILD bareos-20.0.3-r2.ebuild 11407 BLAKE2B 3892f00374c4da0f3447ae12308f8147cbadfa6d5f5a3c8995eeeb2d69312317d80233ce25ad4a47bad021917b9a4aab0a29d2ea842470d9bb3737f991297243 SHA512 72441b8e5d54836691209c8e4e9de9b9371c59a8e698095e47c82341d5885ee9070e1556bbce26674da0560362790248c496c70a58d7a80a752f2b4724e86d88
+EBUILD bareos-20.0.5.ebuild 11407 BLAKE2B 00a225c47f39abb02990a088a7b763c73f95aca2b98d3fd49015b7ab852b50c9a0b7455aa881f63071b4fd31676806e13ade6001d8465e41e8b88bbb83524167 SHA512 0924dd4387fcce3821dd039729e6395e142b5de067bee06219de5362fa1068238928c3e9dc243f8648e76717428d80b304acf5ad2719548dafe18b705800497d
+EBUILD bareos-21.0.0.ebuild 10262 BLAKE2B 59c69eea0e81ef4f9d0482a6c29a50806afe561ae4d01ba9b078c1f7d9e299435763b789ed4585701c01ac0ff12d23cf6e39e1e1f2a06b5b8d974aae31da7961 SHA512 5c10b93da2a95081d3a7a7304507c92c954e87b79be5b8ac86d3fddeb44c616cfe21e58f7833db8ca8448a84041897cb30e2db20ba5e1208fbaf98b4ead22f14
MISC metadata.xml 1552 BLAKE2B 27a6ee8fad25a63be91e5bc712ffb293174c6bfca8df772be3821932baafe510b1fa271b2e36a22a11296c7a7bd23049b86dc9cbcbe2f7f30409a1e7c7b55042 SHA512 40b549c30e36a495a434c607467efa914aec228d886ee8560e77b39e4d6d6396ebae5e4a5cbdfd01b6828011ee9922112ab0041d9a9aa944d68417114b14ef53
diff --git a/app-backup/bareos/bareos-20.0.3-r2.ebuild b/app-backup/bareos/bareos-20.0.5.ebuild
index 98191f5002a8..a678aef69a5f 100644
--- a/app-backup/bareos/bareos-20.0.3-r2.ebuild
+++ b/app-backup/bareos/bareos-20.0.5.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python3_{7..10} )
+PYTHON_COMPAT=( python3_{8..10} )
CMAKE_WARN_UNUSED_CLI=no
#CMAKE_REMOVE_MODULES=yes
diff --git a/app-backup/bareos/bareos-21.0.0.ebuild b/app-backup/bareos/bareos-21.0.0.ebuild
new file mode 100644
index 000000000000..ef360cdc5a34
--- /dev/null
+++ b/app-backup/bareos/bareos-21.0.0.ebuild
@@ -0,0 +1,359 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+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"
+RESTRICT="mirror"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X acl ceph clientonly +director glusterfs ipv6 lmdb
+ logwatch ndmp readline scsi-crypto
+ static +storage-daemon systemd tcpd 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}"
+
+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_prepare() {
+ # fix gentoo platform support
+ eapply -p1 "${FILESDIR}/${PN}-21-cmake-gentoo.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
+
+ # 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-21"
+ fi
+ if use storage-daemon; then
+ myscripts+=" bareos-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}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
+
+ # install init script and config
+ newinitd "${T}/${script}".initd "${script/-21/}"
+ newconfd "${T}/${script}".confd "${script/-21/}"
+ done
+
+ # install systemd unit files
+ if use systemd; then
+ if ! use clientonly; then
+ use director && systemd_dounit "${FILESDIR}"/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
+
+ diropts -m0755
+ 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 postgresql'"
+ einfo " su postgres -c '/usr/libexec/bareos/make_bareos_tables postgresql'"
+ einfo " su postgres -c '/usr/libexec/bareos/grant_bareos_privileges postgresql'"
+ einfo
+ fi
+}
diff --git a/app-backup/bareos/files/bareos-21-cmake-gentoo.patch b/app-backup/bareos/files/bareos-21-cmake-gentoo.patch
new file mode 100644
index 000000000000..e42bf91a91fd
--- /dev/null
+++ b/app-backup/bareos/files/bareos-21-cmake-gentoo.patch
@@ -0,0 +1,12 @@
+diff -ur bareos-Release-21.0.0.orig/core/platforms/CMakeLists.txt bareos-Release-21.0.0/core/platforms/CMakeLists.txt
+--- bareos-Release-21.0.0.orig/core/platforms/CMakeLists.txt 2021-12-21 01:00:49.000000000 -1000
++++ bareos-Release-21.0.0/core/platforms/CMakeLists.txt 2022-01-30 15:09:41.949529813 -1000
+@@ -30,6 +30,8 @@
+ message(STATUS "adding subdirectories debian and univention")
+ add_subdirectory(debian)
+ add_subdirectory(univention)
++ elseif(${PLATFORM} STREQUAL gentoo)
++ message(STATUS "PLATFORM: " ${PLATFORM})
+ elseif(${BAREOS_PLATFORM} STREQUAL hpux)
+ message(STATUS "BAREOS_PLATFORM: " ${BAREOS_PLATFORM})
+ elseif(${BAREOS_PLATFORM} STREQUAL archlinux)
diff --git a/app-backup/bareos/files/bareos-dir-21.confd b/app-backup/bareos/files/bareos-dir-21.confd
new file mode 100644
index 000000000000..3ad4b7482f93
--- /dev/null
+++ b/app-backup/bareos/files/bareos-dir-21.confd
@@ -0,0 +1,10 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Config file for /etc/init.d/bareos-dir
+
+# Options for the director daemon.
+# The director can be run as a non-root user, however
+# please ensure that this user has proper permissions to
+# access your backup devices.
+DIR_OPTIONS="-u bareos -g bareos"
diff --git a/app-backup/bareos/files/bareos-dir-21.initd b/app-backup/bareos/files/bareos-dir-21.initd
new file mode 100644
index 000000000000..7100b615105c
--- /dev/null
+++ b/app-backup/bareos/files/bareos-dir-21.initd
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need postgresql
+ use dns bareos-fd bareos-sd
+}
+
+start() {
+ ebegin "Starting bareos director"
+ # g+w until #631598 is resolved
+ checkpath -d -m 0770 -o root:bareos /run/bareos
+ start-stop-daemon --start --quiet --exec /usr/sbin/bareos-dir \
+ -- ${DIR_OPTIONS}
+ # harden pid file until #631598 is resolved
+ ewaitfile 10 /run/bareos/bareos-dir.9101.pid
+ chown root:bareos /run/bareos/bareos-dir.9101.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping bareos director"
+ # check pid file until #631598 is resolved
+ if [[ $(stat -c %U /run/bareos/bareos-dir.9101.pid) != "root" ]]; then
+ eerror "SECURITY ALERT: pid file is not root owned anymore?! (see #631598)"
+ else
+ start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-dir.9101.pid
+ fi
+ eend $?
+}
diff --git a/app-backup/bareos/files/bareos-dir-21.service b/app-backup/bareos/files/bareos-dir-21.service
new file mode 100644
index 000000000000..2f156cf8aecc
--- /dev/null
+++ b/app-backup/bareos/files/bareos-dir-21.service
@@ -0,0 +1,32 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+#
+# Bareos Director Daemon
+#
+[Unit]
+Description=Bareos Director Daemon
+Documentation=man:bareos-dir(8)
+Requires=nss-lookup.target network.target remote-fs.target time-sync.target
+After=nss-lookup.target network.target remote-fs.target time-sync.target postgresql.service
+ConditionPathIsDirectory=/var/lib/bareos
+
+[Service]
+# see bug #631598
+#Type=forking
+Type=simple
+User=bareos
+Group=bareos
+WorkingDirectory=/var/lib/bareos
+#PIDFile=/run/bareos/bareos-dir.9101.pid
+StandardError=journal
+ExecStartPre=/usr/sbin/bareos-dir -t -f
+#ExecStart=/usr/sbin/bareos-dir
+ExecStart=/usr/sbin/bareos-dir -f
+SuccessExitStatus=0 1 15
+ExecReload=/usr/sbin/bareos-dir -t -f
+ExecReload=/bin/kill -HUP $MAINPID
+#Restart=on-failure
+
+[Install]
+Alias=bareos-director.service
+WantedBy=multi-user.target