summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-backup/bareos')
-rw-r--r--app-backup/bareos/Manifest10
-rw-r--r--app-backup/bareos/bareos-16.2.7-r1.ebuild398
-rw-r--r--app-backup/bareos/bareos-17.2.6.ebuild388
-rw-r--r--app-backup/bareos/bareos-17.2.7-r1.ebuild388
-rw-r--r--app-backup/bareos/bareos-21.1.8-r1.ebuild (renamed from app-backup/bareos/bareos-18.2.6.ebuild)364
-rw-r--r--app-backup/bareos/bareos-21.1.9.ebuild414
-rw-r--r--app-backup/bareos/bareos-22.1.2-r1.ebuild435
-rw-r--r--app-backup/bareos/bareos-22.1.4.ebuild434
-rw-r--r--app-backup/bareos/bareos-23.0.1.ebuild436
-rw-r--r--app-backup/bareos/bareos-23.0.2.ebuild435
-rw-r--r--app-backup/bareos/bareos-9999.ebuild436
-rw-r--r--app-backup/bareos/files/bareos-12.4.5-Makefile.patch27
-rw-r--r--app-backup/bareos/files/bareos-12.4.5-bat-ldflags.patch11
-rw-r--r--app-backup/bareos/files/bareos-21-cmake-gentoo.patch12
-rw-r--r--app-backup/bareos/files/bareos-21.1.2-no-automagic-ccache.patch25
-rw-r--r--app-backup/bareos/files/bareos-21.1.2-werror.patch23
-rw-r--r--app-backup/bareos/files/bareos-22.0.2-werror.patch23
-rw-r--r--app-backup/bareos/files/bareos-22.1.2-include-algorithm.patch41
-rw-r--r--app-backup/bareos/files/bareos-cmake-gentoo.patch11
-rw-r--r--app-backup/bareos/files/bareos-cmake-rados.patch21
-rw-r--r--app-backup/bareos/files/bareos-cmake-symlink-default-db-backend.patch9
-rw-r--r--app-backup/bareos/files/bareos-dir-21-r1.initd16
-rw-r--r--app-backup/bareos/files/bareos-dir-21.confd (renamed from app-backup/bareos/files/bareos-dir.confd)9
-rw-r--r--app-backup/bareos/files/bareos-dir-21.service32
-rw-r--r--app-backup/bareos/files/bareos-dir.confd-1617
-rw-r--r--app-backup/bareos/files/bareos-dir.initd21
-rw-r--r--app-backup/bareos/files/bareos-dir.service13
-rw-r--r--app-backup/bareos/files/bareos-fd-21-r1.initd12
-rw-r--r--app-backup/bareos/files/bareos-fd-21.confd (renamed from app-backup/bareos/files/bareos-fd.confd)2
-rw-r--r--app-backup/bareos/files/bareos-fd.confd-167
-rw-r--r--app-backup/bareos/files/bareos-fd.initd21
-rw-r--r--app-backup/bareos/files/bareos-fd.service32
-rw-r--r--app-backup/bareos/files/bareos-sd-21-r1.initd16
-rw-r--r--app-backup/bareos/files/bareos-sd-21.confd (renamed from app-backup/bareos/files/bareos-sd.confd)2
-rw-r--r--app-backup/bareos/files/bareos-sd.confd-1610
-rw-r--r--app-backup/bareos/files/bareos-sd.initd21
-rw-r--r--app-backup/bareos/files/bareos-sd.service37
-rw-r--r--app-backup/bareos/files/tmpfiles.d-bareos.conf1
-rw-r--r--app-backup/bareos/metadata.xml17
39 files changed, 3039 insertions, 1588 deletions
diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
index c57ee6ad7ecd..084b9c1489f4 100644
--- a/app-backup/bareos/Manifest
+++ b/app-backup/bareos/Manifest
@@ -1,4 +1,6 @@
-DIST bareos-16.2.7.tar.gz 4282998 BLAKE2B 9101a49d1178e0bcc4843cc4472a2082827a7bd7595389c0fa3699d36651ca70fce674509eeaddc8f806a5df1dba6afc89c05be183e7561e013d23bd157ef294 SHA512 028f38dd77fed5e3af6ee50aa44cb2f82349bd38e40eadebc552a95100166291ae0c68073daa2513919da330c66bb54a3050f1d99cbf3b5354f2450a789f6c00
-DIST bareos-17.2.6.tar.gz 4181984 BLAKE2B a1666b38626228ebf00f6a42f1a5b74c78c26a7178fa5333c9c8fb24ccfda146d20c35d35cbe43b6f53ba1b0ce1dd9b8ad30309997689c39493b51a0db9f5c9b SHA512 5f5ac8cfe028c97fa3120e149f1eb029406b74530517bf6e21574bd726e26c6b78740977635b45cbc2232fda0ee28f1b4338d91a8fa0a86ba05209cce82cd0b2
-DIST bareos-17.2.7.tar.gz 4184028 BLAKE2B dc817ca3b21ea13d9dbd1e3c5691e09bc3adff535e0032e1fbcfff8d07b96b2bf21976f020d778dd16137e51283c2a3dcab78dbe28f7fb6f3a60d43938f6b770 SHA512 254eddacb067ef7e82b7a54bdfcbffd5cfa033fa045f697c7e5b5c28dd064b5e1ce9f6aa946282c60f59972beae0b1b7901882b77c3f71cf16efdd73934135cc
-DIST bareos-18.2.6.tar.gz 9991951 BLAKE2B 9fdaf852e748f0c01d06e2fd72351e7b9bf18e8fea92307fb85437441b4ce504f9c6ddbd42cd2185b6dc08158502a7db581bef662c2bd84c86c885d6b89eebba SHA512 b6618173a803db4cfc3fe7edfe8c9e4e4128195f44383cd7df5b9866da4290686ed7cb42499edec957a5d9ab8bbd92d26258ce58f13fba84fb569167956768c3
+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
diff --git a/app-backup/bareos/bareos-16.2.7-r1.ebuild b/app-backup/bareos/bareos-16.2.7-r1.ebuild
deleted file mode 100644
index efeb4ae84798..000000000000
--- a/app-backup/bareos/bareos-16.2.7-r1.ebuild
+++ /dev/null
@@ -1,398 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python2_7 )
-PYTHON_REQ_USE="threads"
-
-inherit eutils multilib python-single-r1 user
-
-DESCRIPTION="Featureful client/server network backup suite"
-HOMEPAGE="http://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 cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
- logwatch mysql ndmp postgres python rados rados-striper readline scsi-crypto
- sql-pooling +sqlite ssl static +storage-daemon tcpd vim-syntax"
-REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
-
-DEPEND="
- !app-backup/bacula
- cephfs? ( sys-cluster/ceph )
- rados? ( sys-cluster/ceph )
- rados-striper? ( >=sys-cluster/ceph-0.94.2 )
- glusterfs? ( sys-cluster/glusterfs )
- lmdb? ( dev-db/lmdb )
- dev-libs/gmp:0
- !clientonly? (
- postgres? ( dev-db/postgresql:*[threads] )
- mysql? ( virtual/mysql )
- sqlite? ( dev-db/sqlite:3 )
- director? (
- virtual/mta
- jansson? ( dev-libs/jansson )
- )
- )
- fastlz? ( dev-libs/bareos-fastlzlib )
- logwatch? ( sys-apps/logwatch )
- tcpd? ( sys-apps/tcp-wrappers )
- readline? ( sys-libs/readline:0 )
- static? (
- acl? ( virtual/acl[static-libs] )
- sys-libs/zlib[static-libs]
- dev-libs/lzo[static-libs]
- sys-libs/ncurses:=[static-libs]
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0=[static-libs] )
- libressl? ( dev-libs/libressl:0=[static-libs] )
- )
- gnutls? ( net-libs/gnutls[static-libs] )
- )
- )
- !static? (
- acl? ( virtual/acl )
- dev-libs/lzo
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:0= )
- )
- gnutls? ( net-libs/gnutls )
- )
- sys-libs/ncurses:=
- sys-libs/zlib
- )
- python? ( ${PYTHON_DEPS} )
- "
-RDEPEND="${DEPEND}
- !clientonly? (
- storage-daemon? (
- sys-block/mtx
- app-arch/mt-st
- )
- )
- vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
-
-REQUIRED_USE="static? ( clientonly )
- python? ( ${PYTHON_REQUIRED_USE} )"
-
-S=${WORKDIR}/${PN}-Release-${PV}
-
-pkg_setup() {
- use mysql && export mydbtypes+="mysql"
- use postgres && export mydbtypes+=" postgresql"
- use sqlite && export mydbtypes+=" sqlite"
-
- # create the daemon group and user
- if [ -z "$(egetent group bareos 2>/dev/null)" ]; then
- enewgroup bareos
- einfo
- einfo "The group 'bareos' has been created. Any users you add to this"
- einfo "group have access to files created by the daemons."
- einfo
- fi
-
- if ! use clientonly; then
- if [ -z "$(egetent passwd bareos 2>/dev/null)" ]; then
- enewuser bareos -1 -1 /var/lib/bareos bareos,disk,tape,cdrom,cdrw
- einfo
- einfo "The user 'bareos' has been created. Please see the bareos manual"
- einfo "for information about running bareos as a non-root user."
- einfo
- fi
- fi
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # adjusts default configuration files for several binaries
- # to /etc/bareos/<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/bareos/|g' "${f}" \
- || die "sed on ${f} failed"
- done
- popd >&/dev/null || die
-
- # bug 466690 Use CXXFLAGS instead of CFLAGS
- sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
-
- # stop build for errors in subdirs
- epatch "${FILESDIR}"/${PN}-12.4.5-Makefile.patch
-
- # bat needs to respect LDFLAGS
- epatch "${FILESDIR}"/${PN}-12.4.5-bat-ldflags.patch
-
- # do not strip binaries
- for d in filed console dird stored; do
- sed -i -e "s/strip /# strip /" src/$d/Makefile.in || die
- done
-}
-
-src_configure() {
- local myconf=''
-
- addpredict /var/lib/logrotate.status
-
- if use clientonly; then
- myconf="${myconf} \
- $(use_enable clientonly client-only) \
- $(use_enable !static libtool) \
- $(use_enable static static-cons) \
- $(use_enable static static-fd)"
- fi
-
- # do not build bat and traymonitor if 'static' clientonly
- if ! use clientonly || ! use static; then
- myconf="${myconf} \
- --disable-bat \
- --disable-traymonitor"
- fi
-
- myconf="${myconf} \
- $(use_with X x) \
- $(use_enable acl) \
- $(use_enable ipv6) \
- $(use_enable ndmp) \
- $(use_enable readline) \
- $(use_enable !readline conio) \
- $(use_enable scsi-crypto) \
- $(use_enable sql-pooling) \
- $(use_with fastlz) \
- $(use_with mysql) \
- $(use_with postgres postgresql) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with sqlite sqlite3) \
- $(use sqlite || echo "--without-sqlite3") \
- $(use_with ssl openssl) \
- $(use_with tcpd tcp-wrappers) \
- $(use_enable lmdb) \
- $(use_with glusterfs) \
- $(use_with rados) \
- $(use_with rados-striper) \
- $(use_with cephfs) \
- $(use_with jansson) \
- "
-
- econf \
- --libdir=/usr/$(get_libdir) \
- --docdir=/usr/share/doc/${PF} \
- --htmldir=/usr/share/doc/${PF}/html \
- --with-pid-dir=/run/bareos \
- --sysconfdir=/etc \
- --with-subsys-dir=/run/lock/subsys \
- --with-working-dir=/var/lib/bareos \
- --with-logdir=/var/log/bareos \
- --with-scriptdir=/usr/libexec/bareos \
- --with-plugindir=/usr/$(get_libdir)/${PN}/plugin \
- --with-backenddir=/usr/$(get_libdir)/${PN}/backend \
- --with-dir-user=bareos \
- --with-dir-group=bareos \
- --with-sd-user=root \
- --with-sd-group=bareos \
- --with-fd-user=root \
- --with-fd-group=bareos \
- --with-sbin-perm=0755 \
- --with-systemd \
- --enable-dynamic-cats-backends \
- --enable-dynamic-storage-backends \
- --enable-batch-insert \
- --disable-afs \
- --host=${CHOST} \
- ${myconf}
-}
-
-src_compile() {
- # workaround for build failing with high -j values
- # if ndmp is enabled
- use ndmp && MAKEOPTS="$MAKEOPTS -j1"
-
- # Make build log verbose (bug #447806)
- emake NO_ECHO=""
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- newicon src/images/bareos_logo_shadow.png bareos.png
-
- # 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,startmysql,stopmysql}
- rm -f "${D}"/usr/sbin/bareos
-
- # remove upstream init scripts
- rm -f "${D}"/etc/init.d/bareos-*
-
- # 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}"/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}"/scripts/logwatch >&/dev/null || die
- emake DESTDIR="${D}" install
- popd >&/dev/null || die
- fi
- fi
-
- rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
- rm -vf "${D}"/usr/share/man/man1/bat.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
- rm -vf "${D}"/usr/share/man/man1/bareos-tray-monitor.1*
-
- # documentation
- dodoc README.md
- use ndmp && dodoc README.NDMP
- use scsi-crypto && dodoc README.scsicrypto
-
- # vim-files
- if use vim-syntax; then
- insinto /usr/share/vim/vimfiles/syntax
- doins scripts/bareos.vim
- insinto /usr/share/vim/vimfiles/ftdetect
- newins scripts/filetype.vim bareos_ft.vim
- fi
-
- # setup init scripts
- myscripts="bareos-fd"
- if ! use clientonly; then
- if use director; then
- myscripts="${myscripts} bareos-dir"
- fi
- if use storage-daemon; then
- myscripts="${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-16 "${T}/${script}".confd || die "failed to copy ${script}.confd"
- cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
-
- # now set the database dependency for the director init script
- case "${script}" in
- bareos-dir)
- sed -i -e "s:%databasetypes%:${mydbtypes}:" "${T}/${script}".confd || die
- ;;
- *)
- ;;
- esac
-
- # install init script and config
- newinitd "${T}/${script}".initd "${script}"
- newconfd "${T}/${script}".confd "${script}"
- done
-
- # make sure the working directory exists
- diropts -m0750
- keepdir /var/lib/bareos
-
- # make sure bareos group can execute bareos libexec scripts
- fowners -R root:bareos /usr/libexec/bareos
-}
-
-pkg_postinst() {
- 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 databases with:"
- if use postgres; then
- einfo
- einfo "For postgresql:"
- 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'"
- fi
- if use mysql; then
- einfo
- einfo "For mysql:"
- einfo
- einfo " Make sure root has direct access to your mysql server. You may want to"
- einfo " create a /root/.my.cnf file with"
- einfo " [client]"
- einfo " user=root"
- einfo " password=YourPasswordForAccessingMysqlAsRoot"
- einfo " before running:"
- einfo " /usr/libexec/bareos/create_bareos_database mysql"
- einfo " /usr/libexec/bareos/make_bareos_tables mysql"
- einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
- fi
- einfo
- fi
-
- if use sqlite; then
- einfo
- einfo "Be aware that Bareos does not officially support SQLite database."
- einfo "Best use it only for a client-only installation. See Bug #445540."
- einfo
- einfo "It is strongly recommended to use either postgresql or mysql as"
- einfo "catalog database backend."
- einfo
- fi
-
- einfo "Please note that 'bconsole' will always be installed."
- einfo
-}
diff --git a/app-backup/bareos/bareos-17.2.6.ebuild b/app-backup/bareos/bareos-17.2.6.ebuild
deleted file mode 100644
index 25469bc0f107..000000000000
--- a/app-backup/bareos/bareos-17.2.6.ebuild
+++ /dev/null
@@ -1,388 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-PYTHON_COMPAT=( python2_7 )
-PYTHON_REQ_USE="threads"
-
-inherit eutils multilib python-single-r1 systemd user
-
-DESCRIPTION="Featureful client/server network backup suite"
-HOMEPAGE="http://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 cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
- logwatch mysql ndmp +postgres python rados rados-striper readline scsi-crypto
- sql-pooling sqlite ssl static +storage-daemon tcpd vim-syntax"
-REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
-
-DEPEND="
- !app-backup/bacula
- cephfs? ( sys-cluster/ceph )
- rados? ( sys-cluster/ceph )
- rados-striper? ( >=sys-cluster/ceph-0.94.2 )
- glusterfs? ( sys-cluster/glusterfs )
- lmdb? ( dev-db/lmdb )
- dev-libs/gmp:0
- !clientonly? (
- postgres? ( dev-db/postgresql:*[threads] )
- mysql? ( virtual/mysql )
- sqlite? ( dev-db/sqlite:3 )
- director? (
- virtual/mta
- jansson? ( dev-libs/jansson )
- )
- )
- fastlz? ( dev-libs/bareos-fastlzlib )
- logwatch? ( sys-apps/logwatch )
- tcpd? ( sys-apps/tcp-wrappers )
- readline? ( sys-libs/readline:0 )
- static? (
- acl? ( virtual/acl[static-libs] )
- sys-libs/zlib[static-libs]
- dev-libs/lzo[static-libs]
- sys-libs/ncurses:=[static-libs]
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0=[static-libs] )
- libressl? ( dev-libs/libressl:0=[static-libs] )
- )
- gnutls? ( net-libs/gnutls[static-libs] )
- )
- )
- !static? (
- acl? ( virtual/acl )
- dev-libs/lzo
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:0= )
- )
- gnutls? ( net-libs/gnutls )
- )
- sys-libs/ncurses:=
- sys-libs/zlib
- )
- python? ( ${PYTHON_DEPS} )
- "
-RDEPEND="${DEPEND}
- !clientonly? (
- storage-daemon? (
- sys-block/mtx
- app-arch/mt-st
- )
- )
- vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
-
-REQUIRED_USE="static? ( clientonly )
- python? ( ${PYTHON_REQUIRED_USE} )"
-
-S=${WORKDIR}/${PN}-Release-${PV}
-
-pkg_setup() {
- use mysql && export mydbtypes+="mysql"
- use postgres && export mydbtypes+=" postgresql"
- use sqlite && export mydbtypes+=" sqlite"
-
- # create the daemon group and user
- if [ -z "$(egetent group bareos 2>/dev/null)" ]; then
- enewgroup bareos
- einfo
- einfo "The group 'bareos' has been created. Any users you add to this"
- einfo "group have access to files created by the daemons."
- einfo
- fi
-
- if ! use clientonly; then
- if [ -z "$(egetent passwd bareos 2>/dev/null)" ]; then
- enewuser bareos -1 -1 /var/lib/bareos bareos,disk,tape,cdrom,cdrw
- einfo
- einfo "The user 'bareos' has been created. Please see the bareos manual"
- einfo "for information about running bareos as a non-root user."
- einfo
- fi
- fi
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # adjusts default configuration files for several binaries
- # to /etc/bareos/<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; do
- sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bareos/|g' "${f}" \
- || die "sed on ${f} failed"
- done
- popd >&/dev/null || die
-
- # enables default database driver in catalog
- pushd src/defaultconfigs/bareos-dir.d/catalog >&/dev/null || die
- sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE/d' MyCatalog.conf.in \
- || die "sed on MyCatalog.conf.in failed"
- popd >&/dev/null || die
-
- # bug 466690 Use CXXFLAGS instead of CFLAGS
- sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
-
- # do not strip binaries
- for d in filed console dird stored; do
- sed -i -e "s/strip /# strip /" src/$d/Makefile.in || die
- done
-
- eapply_user
-}
-
-src_configure() {
- local myconf=''
-
- addpredict /var/lib/logrotate.status
-
- if use clientonly; then
- myconf="${myconf} \
- $(use_enable clientonly client-only) \
- $(use_enable !static libtool) \
- $(use_enable static static-cons) \
- $(use_enable static static-fd)"
- fi
-
- myconf="${myconf} \
- $(use_with X x) \
- $(use_enable acl) \
- $(use_enable ipv6) \
- $(use_enable ndmp) \
- $(use_enable readline) \
- $(use_enable !readline conio) \
- $(use_enable scsi-crypto) \
- $(use_enable sql-pooling) \
- $(use_with fastlz) \
- $(use_with mysql) \
- $(use_with postgres postgresql) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with sqlite sqlite3) \
- $(use sqlite || echo "--without-sqlite3") \
- $(use_with ssl openssl) \
- $(use_with tcpd tcp-wrappers) \
- $(use_enable lmdb) \
- $(use_with glusterfs) \
- $(use_with rados) \
- $(use_with rados-striper) \
- $(use_with cephfs) \
- $(use_with jansson) \
- "
-
- econf \
- --libdir=/usr/$(get_libdir) \
- --docdir=/usr/share/doc/${PF} \
- --htmldir=/usr/share/doc/${PF}/html \
- --with-pid-dir=/run/bareos \
- --sysconfdir=/etc \
- --with-subsys-dir=/run/lock/subsys \
- --with-working-dir=/var/lib/bareos \
- --with-logdir=/var/log/bareos \
- --with-scriptdir=/usr/libexec/bareos \
- --with-plugindir=/usr/$(get_libdir)/${PN}/plugin \
- --with-backenddir=/usr/$(get_libdir)/${PN}/backend \
- --with-dir-user=bareos \
- --with-dir-group=bareos \
- --with-sd-user=root \
- --with-sd-group=bareos \
- --with-fd-user=root \
- --with-fd-group=bareos \
- --with-sbin-perm=0755 \
- --with-systemd \
- --with-db-password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1` \
- --enable-dynamic-cats-backends \
- --enable-dynamic-storage-backends \
- --enable-batch-insert \
- --disable-afs \
- --host=${CHOST} \
- ${myconf}
-}
-
-src_compile() {
- # Make build log verbose (bug #447806)
- emake NO_ECHO=""
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- newicon src/images/bareos_logo_shadow.png bareos.png
-
- # 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,startmysql,stopmysql}
- rm -f "${D}"/usr/sbin/bareos
-
- # remove upstream init scripts
- rm -f "${D}"/etc/init.d/bareos-*
-
- # 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}"/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}"/scripts/logwatch >&/dev/null || die
- emake DESTDIR="${D}" install
- 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
- use ndmp && dodoc README.NDMP
- use scsi-crypto && dodoc README.scsicrypto
-
- # vim-files
- if use vim-syntax; then
- insinto /usr/share/vim/vimfiles/syntax
- doins scripts/bareos.vim
- insinto /usr/share/vim/vimfiles/ftdetect
- newins scripts/filetype.vim bareos_ft.vim
- fi
-
- # setup init scripts
- myscripts="bareos-fd"
- if ! use clientonly; then
- if use director; then
- myscripts="${myscripts} bareos-dir"
- fi
- if use storage-daemon; then
- myscripts="${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-16 "${T}/${script}".confd || die "failed to copy ${script}.confd"
- cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
-
- # now set the database dependency for the director init script
- case "${script}" in
- bareos-dir)
- sed -i -e "s:%databasetypes%:${mydbtypes}:" "${T}/${script}".confd || die
- ;;
- *)
- ;;
- esac
-
- # install init script and config
- newinitd "${T}/${script}".initd "${script}"
- newconfd "${T}/${script}".confd "${script}"
- done
-
- # install systemd unit files
- use director && systemd_dounit "${FILESDIR}"/bareos-dir.service
- use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
- systemd_dounit "${FILESDIR}"/bareos-fd.service
-
- # make sure the working directory exists
- diropts -m0750
- keepdir /var/lib/bareos
-
- # make sure bareos group can execute bareos libexec scripts
- fowners -R root:bareos /usr/libexec/bareos
-}
-
-pkg_postinst() {
- 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:"
- if use postgres; then
- einfo
- einfo "For postgresql:"
- 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'"
- fi
- if use mysql; then
- einfo
- einfo "For mysql:"
- einfo
- einfo " Make sure root has direct access to your mysql server. You may want to"
- einfo " create a /root/.my.cnf file with"
- einfo " [client]"
- einfo " user=root"
- einfo " password=YourPasswordForAccessingMysqlAsRoot"
- einfo " before running:"
- einfo " /usr/libexec/bareos/create_bareos_database mysql"
- einfo " /usr/libexec/bareos/make_bareos_tables mysql"
- einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
- fi
- einfo
- fi
-
- if use sqlite; then
- einfo
- einfo "Be aware that Bareos does not officially support SQLite database."
- einfo "Best use it only for a client-only installation. See Bug #445540."
- einfo
- einfo "It is strongly recommended to use either postgresql or mysql as"
- einfo "catalog database backend."
- einfo
- fi
-}
diff --git a/app-backup/bareos/bareos-17.2.7-r1.ebuild b/app-backup/bareos/bareos-17.2.7-r1.ebuild
deleted file mode 100644
index 482b98f1f333..000000000000
--- a/app-backup/bareos/bareos-17.2.7-r1.ebuild
+++ /dev/null
@@ -1,388 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-PYTHON_COMPAT=( python2_7 )
-PYTHON_REQ_USE="threads"
-
-inherit eutils multilib python-single-r1 systemd user
-
-DESCRIPTION="Featureful client/server network backup suite"
-HOMEPAGE="http://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 cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
- logwatch mysql ndmp +postgres python rados rados-striper readline scsi-crypto
- sql-pooling sqlite ssl static +storage-daemon tcpd vim-syntax"
-REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
-
-DEPEND="
- !app-backup/bacula
- cephfs? ( sys-cluster/ceph )
- rados? ( sys-cluster/ceph )
- rados-striper? ( >=sys-cluster/ceph-0.94.2 )
- glusterfs? ( sys-cluster/glusterfs )
- lmdb? ( dev-db/lmdb )
- dev-libs/gmp:0
- !clientonly? (
- postgres? ( dev-db/postgresql:*[threads] )
- mysql? ( dev-db/mysql-connector-c:0= )
- sqlite? ( dev-db/sqlite:3 )
- director? (
- virtual/mta
- jansson? ( dev-libs/jansson )
- )
- )
- fastlz? ( dev-libs/bareos-fastlzlib )
- logwatch? ( sys-apps/logwatch )
- tcpd? ( sys-apps/tcp-wrappers )
- readline? ( sys-libs/readline:0 )
- static? (
- acl? ( virtual/acl[static-libs] )
- sys-libs/zlib[static-libs]
- dev-libs/lzo[static-libs]
- sys-libs/ncurses:=[static-libs]
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0=[static-libs] )
- libressl? ( dev-libs/libressl:0=[static-libs] )
- )
- gnutls? ( net-libs/gnutls[static-libs] )
- )
- )
- !static? (
- acl? ( virtual/acl )
- dev-libs/lzo
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:0= )
- )
- gnutls? ( net-libs/gnutls )
- )
- sys-libs/ncurses:=
- sys-libs/zlib
- )
- python? ( ${PYTHON_DEPS} )
- "
-RDEPEND="${DEPEND}
- !clientonly? (
- storage-daemon? (
- sys-block/mtx
- app-arch/mt-st
- )
- )
- vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
-
-REQUIRED_USE="static? ( clientonly )
- python? ( ${PYTHON_REQUIRED_USE} )"
-
-S=${WORKDIR}/${PN}-Release-${PV}
-
-pkg_setup() {
- use mysql && export mydbtypes+="mysql"
- use postgres && export mydbtypes+=" postgresql"
- use sqlite && export mydbtypes+=" sqlite"
-
- # create the daemon group and user
- if [ -z "$(egetent group bareos 2>/dev/null)" ]; then
- enewgroup bareos
- einfo
- einfo "The group 'bareos' has been created. Any users you add to this"
- einfo "group have access to files created by the daemons."
- einfo
- fi
-
- if ! use clientonly; then
- if [ -z "$(egetent passwd bareos 2>/dev/null)" ]; then
- enewuser bareos -1 -1 /var/lib/bareos bareos,disk,tape,cdrom,cdrw
- einfo
- einfo "The user 'bareos' has been created. Please see the bareos manual"
- einfo "for information about running bareos as a non-root user."
- einfo
- fi
- fi
-
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- # adjusts default configuration files for several binaries
- # to /etc/bareos/<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; do
- sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bareos/|g' "${f}" \
- || die "sed on ${f} failed"
- done
- popd >&/dev/null || die
-
- # enables default database driver in catalog
- pushd src/defaultconfigs/bareos-dir.d/catalog >&/dev/null || die
- sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE/d' MyCatalog.conf.in \
- || die "sed on MyCatalog.conf.in failed"
- popd >&/dev/null || die
-
- # bug 466690 Use CXXFLAGS instead of CFLAGS
- sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
-
- # do not strip binaries
- for d in filed console dird stored; do
- sed -i -e "s/strip /# strip /" src/$d/Makefile.in || die
- done
-
- eapply_user
-}
-
-src_configure() {
- local myconf=''
-
- addpredict /var/lib/logrotate.status
-
- if use clientonly; then
- myconf="${myconf} \
- $(use_enable clientonly client-only) \
- $(use_enable !static libtool) \
- $(use_enable static static-cons) \
- $(use_enable static static-fd)"
- fi
-
- myconf="${myconf} \
- $(use_with X x) \
- $(use_enable acl) \
- $(use_enable ipv6) \
- $(use_enable ndmp) \
- $(use_enable readline) \
- $(use_enable !readline conio) \
- $(use_enable scsi-crypto) \
- $(use_enable sql-pooling) \
- $(use_with fastlz) \
- $(use_with mysql) \
- $(use_with postgres postgresql) \
- $(use_with python) \
- $(use_with readline) \
- $(use_with sqlite sqlite3) \
- $(use sqlite || echo "--without-sqlite3") \
- $(use_with ssl openssl) \
- $(use_with tcpd tcp-wrappers) \
- $(use_enable lmdb) \
- $(use_with glusterfs) \
- $(use_with rados) \
- $(use_with rados-striper) \
- $(use_with cephfs) \
- $(use_with jansson) \
- "
-
- econf \
- --libdir=/usr/$(get_libdir) \
- --docdir=/usr/share/doc/${PF} \
- --htmldir=/usr/share/doc/${PF}/html \
- --with-pid-dir=/run/bareos \
- --sysconfdir=/etc \
- --with-subsys-dir=/run/lock/subsys \
- --with-working-dir=/var/lib/bareos \
- --with-logdir=/var/log/bareos \
- --with-scriptdir=/usr/libexec/bareos \
- --with-plugindir=/usr/$(get_libdir)/${PN}/plugin \
- --with-backenddir=/usr/$(get_libdir)/${PN}/backend \
- --with-dir-user=bareos \
- --with-dir-group=bareos \
- --with-sd-user=root \
- --with-sd-group=bareos \
- --with-fd-user=root \
- --with-fd-group=bareos \
- --with-sbin-perm=0755 \
- --with-systemd \
- --with-db-password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1` \
- --enable-dynamic-cats-backends \
- --enable-dynamic-storage-backends \
- --enable-batch-insert \
- --disable-afs \
- --host=${CHOST} \
- ${myconf}
-}
-
-src_compile() {
- # Make build log verbose (bug #447806)
- emake NO_ECHO=""
-}
-
-src_install() {
- emake DESTDIR="${D}" install
- newicon src/images/bareos_logo_shadow.png bareos.png
-
- # 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,startmysql,stopmysql}
- rm -f "${D}"/usr/sbin/bareos
-
- # remove upstream init scripts
- rm -f "${D}"/etc/init.d/bareos-*
-
- # 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}"/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}"/scripts/logwatch >&/dev/null || die
- emake DESTDIR="${D}" install
- 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
- use ndmp && dodoc README.NDMP
- use scsi-crypto && dodoc README.scsicrypto
-
- # vim-files
- if use vim-syntax; then
- insinto /usr/share/vim/vimfiles/syntax
- doins scripts/bareos.vim
- insinto /usr/share/vim/vimfiles/ftdetect
- newins scripts/filetype.vim bareos_ft.vim
- fi
-
- # setup init scripts
- myscripts="bareos-fd"
- if ! use clientonly; then
- if use director; then
- myscripts="${myscripts} bareos-dir"
- fi
- if use storage-daemon; then
- myscripts="${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-16 "${T}/${script}".confd || die "failed to copy ${script}.confd"
- cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
-
- # now set the database dependency for the director init script
- case "${script}" in
- bareos-dir)
- sed -i -e "s:%databasetypes%:${mydbtypes}:" "${T}/${script}".confd || die
- ;;
- *)
- ;;
- esac
-
- # install init script and config
- newinitd "${T}/${script}".initd "${script}"
- newconfd "${T}/${script}".confd "${script}"
- done
-
- # install systemd unit files
- use director && systemd_dounit "${FILESDIR}"/bareos-dir.service
- use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
- systemd_dounit "${FILESDIR}"/bareos-fd.service
-
- # make sure the working directory exists
- diropts -m0750
- keepdir /var/lib/bareos
-
- # make sure bareos group can execute bareos libexec scripts
- fowners -R root:bareos /usr/libexec/bareos
-}
-
-pkg_postinst() {
- 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:"
- if use postgres; then
- einfo
- einfo "For postgresql:"
- 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'"
- fi
- if use mysql; then
- einfo
- einfo "For mysql:"
- einfo
- einfo " Make sure root has direct access to your mysql server. You may want to"
- einfo " create a /root/.my.cnf file with"
- einfo " [client]"
- einfo " user=root"
- einfo " password=YourPasswordForAccessingMysqlAsRoot"
- einfo " before running:"
- einfo " /usr/libexec/bareos/create_bareos_database mysql"
- einfo " /usr/libexec/bareos/make_bareos_tables mysql"
- einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
- fi
- einfo
- fi
-
- if use sqlite; then
- einfo
- einfo "Be aware that Bareos does not officially support SQLite database."
- einfo "Best use it only for a client-only installation. See Bug #445540."
- einfo
- einfo "It is strongly recommended to use either postgresql or mysql as"
- einfo "catalog database backend."
- einfo
- fi
-}
diff --git a/app-backup/bareos/bareos-18.2.6.ebuild b/app-backup/bareos/bareos-21.1.8-r1.ebuild
index 62f70274ab04..c1553eece5eb 100644
--- a/app-backup/bareos/bareos-18.2.6.ebuild
+++ b/app-backup/bareos/bareos-21.1.8-r1.ebuild
@@ -1,76 +1,69 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="6"
+EAPI=8
-PYTHON_COMPAT=( python2_7 )
-PYTHON_REQ_USE="threads"
-CMAKE_WARN_UNUSED_CLI=yes
+PYTHON_COMPAT=( python3_{9..12} )
+CMAKE_WARN_UNUSED_CLI=no
#CMAKE_REMOVE_MODULES=yes
-inherit eutils multilib python-single-r1 systemd user cmake-utils
+inherit python-any-r1 systemd cmake tmpfiles
DESCRIPTION="Featureful client/server network backup suite"
-HOMEPAGE="http://www.bareos.org/"
+HOMEPAGE="https://www.bareos.org/"
SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
-RESTRICT="mirror"
+
+# 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 cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
- logwatch mysql ndmp +postgres python rados rados-striper readline scsi-crypto
- sql-pooling sqlite ssl static +storage-daemon systemd tcpd vim-syntax"
-REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
+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
- cephfs? ( sys-cluster/ceph )
- rados? ( sys-cluster/ceph )
- rados-striper? ( >=sys-cluster/ceph-0.94.2 )
+ acct-group/${PN}
+ !x86? (
+ ceph? ( sys-cluster/ceph )
+ )
glusterfs? ( sys-cluster/glusterfs )
lmdb? ( dev-db/lmdb )
dev-libs/gmp:0
!clientonly? (
- postgres? ( dev-db/postgresql:*[threads] )
- mysql? ( virtual/mysql )
- sqlite? ( dev-db/sqlite:3 )
+ acct-user/${PN}
+ dev-db/postgresql:*[threads(+)]
director? (
virtual/mta
- jansson? ( dev-libs/jansson )
)
)
- fastlz? ( dev-libs/bareos-fastlzlib )
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] )
- sys-libs/zlib[static-libs]
+ dev-libs/jansson:=[static-libs]
dev-libs/lzo[static-libs]
+ dev-libs/openssl:0=[static-libs]
sys-libs/ncurses:=[static-libs]
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0=[static-libs] )
- libressl? ( dev-libs/libressl:0=[static-libs] )
- )
- gnutls? ( net-libs/gnutls[static-libs] )
- )
+ sys-libs/zlib[static-libs]
)
!static? (
acl? ( virtual/acl )
+ dev-libs/jansson:=
dev-libs/lzo
- ssl? (
- !gnutls? (
- !libressl? ( dev-libs/openssl:0= )
- libressl? ( dev-libs/libressl:0= )
- )
- gnutls? ( net-libs/gnutls )
- )
+ dev-libs/openssl:0=
sys-libs/ncurses:=
sys-libs/zlib
)
- python? ( ${PYTHON_DEPS} )
"
RDEPEND="${DEPEND}
!clientonly? (
@@ -79,148 +72,184 @@ RDEPEND="${DEPEND}
app-arch/mt-st
)
)
- vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+ "
-REQUIRED_USE="static? ( clientonly )
- python? ( ${PYTHON_REQUIRED_USE} )"
+BDEPEND="
+ ${PYTHON_DEPS}
+ test? (
+ dev-cpp/gtest
+ dev-db/postgresql:*[server,threads(+)]
+ dev-db/mariadb:*[server]
+ )
+"
-S=${WORKDIR}/${PN}-Release-${PV}
+REQUIRED_USE="
+ static? ( clientonly )
+ x86? ( !ceph )
+"
-pkg_setup() {
- # create the daemon group and user
- if [ -z "$(egetent group bareos 2>/dev/null)" ]; then
- enewgroup bareos
- einfo
- einfo "The group 'bareos' has been created. Any users you add to this"
- einfo "group have access to files created by the daemons."
- einfo
- fi
+S=${WORKDIR}/${PN}-Release-${PV}
- if ! use clientonly; then
- if [ -z "$(egetent passwd bareos 2>/dev/null)" ]; then
- enewuser bareos -1 -1 /var/lib/bareos bareos,tape,cdrom,cdrw
- einfo
- einfo "The user 'bareos' has been created. Please see the bareos manual"
- einfo "for information about running bareos as a non-root user."
- einfo
+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
-
- use python && python-single-r1_pkg_setup
+ 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() {
- use mysql && export mydbtypes+=( mysql )
- use postgres && export mydbtypes+=( postgresql )
- use sqlite && export mydbtypes+=( sqlite )
+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}"
- # enables default database driver in catalog
- pushd core/src/defaultconfigs >&/dev/null || die
- sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE_WITH_DATABASE_DRIVER_XXX/d' $(grep -rl XXX_REPLACE_WITH_DATABASE_DRIVER_XXX) \
- || die "sed on MyCatalog.conf.in failed"
- popd >&/dev/null || die
+ # initiale mariadb database for backup tests
+ # $USER must be set and != root
+ export USER=portage
- epatch "${FILESDIR}/bareos-cmake-rados.patch"
+ default
+ cmake_src_test
- # fix gentoo version detection
- epatch "${FILESDIR}/bareos-cmake-gentoo.patch"
+ pg_ctl -w -D "${T}"/pgsql stop || die
+ rm -rvf "${T}"/pgsql
+}
- # fix missing DESTDIR in symlink creation
- epatch "${FILESDIR}/bareos-cmake-symlink-default-db-backend.patch"
+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"
- eapply_user
+ # fix missing DESTDIR in symlink creation
+ sed -i '/bareos-symlink-default-db-backend.cmake/d' "${S}/core/src/cats/CMakeLists.txt"
- CMAKE_USE_DIR="$S/core"
- cmake-utils_src_prepare
+ cmake_src_prepare
}
src_configure() {
local mycmakeargs=()
- CMAKE_USE_DIR="$S/core"
-
- pushd core/platforms >&/dev/null || die
- cmake_comment_add_subdirectory '${DISTNAME}'
- popd >&/dev/null || die
+ cmake_comment_add_subdirectory webui
if use clientonly; then
mycmakeargs+=(
- -Dclient-only=YES
+ -Dclient-only=ON
-Dstatic-cons=$(usex static)
-Dstatic-fd=$(usex static)
)
fi
- for useflag in acl ipv6 ndmp readline scsi-crypto sql-pooling \
- systemd fastlz mysql python lmdb glusterfs rados \
- rados-striper cephfs jansson; do
-
+ for useflag in acl ipv6 ndmp scsi-crypto \
+ systemd lmdb; do
mycmakeargs+=( -D$useflag=$(usex $useflag) )
done
mycmakeargs+=(
- -DDEFAULT_DB_TYPE=${mydbtypes[0]}
- -Dx=$(usex X)
- -Dpostgresql=$(usex postgres)
- -Dmysql=$(usex mysql)
- -Dsqlite3=$(usex sqlite)
- -Dopenssl=$(usex ssl)
- -Dtcp-wrapper=$(usex tcpd)
- -Dlibdir=/usr/$(get_libdir)
- -Dsbindir=/usr/sbin
- -Dmandir=/usr/share/man
- -Ddocdir=/usr/share/doc/${PF}
- -Dhtmldir=/usr/share/doc/${PF}/html
+ -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
- -Dpiddir=/run/bareos
- -Dsysconfdir=/etc
-Dconfdir=/etc/bareos
- -Dsubsys-dir=/run/lock/subsys
- -Dworkingdir=/var/lib/bareos
- -Dlogdir=/var/log/bareos
- -Dscriptdir=/usr/libexec/bareos
- -Dplugindir=/usr/$(get_libdir)/${PN}/plugin
- -Dbackenddir=/usr/$(get_libdir)/${PN}/backend
- -Ddir-user=bareos
- -Ddir-group=bareos
- -Dsd-user=root
- -Dsd-group=bareos
- -Dfd-user=root
- -Dfd-group=bareos
- -Dsbin-perm=0755
+ -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
- -Dbatch-insert=yes
- -Dhost=${CHOST}
- -Dcoverage=yes
- -Dpython=yes
- -Dsmartalloc=yes
- -Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
+ -Dfd-group=bareos
-Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
- -Dsd-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`"
- -Dbasename="`hostname -s`"
- -Dhostname="`hostname -s`"
+ -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)
)
- cmake-utils_src_configure
+ # 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() {
- #emake DESTDIR="${D}" install
- cmake-utils_src_install
- newicon core/src/images/bareos_logo_shadow.png bareos.png
+ 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,startmysql,stopmysql}
+ 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
- rm -f "${D}"/etc/init.d/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
@@ -266,9 +295,6 @@ src_install() {
rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
if use clientonly || ! use director; then
- if use systemd; then
- rm -vf "${D}"/lib/systemd/system/bareos-dir.service
- fi
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*
@@ -284,9 +310,6 @@ src_install() {
rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
fi
if use clientonly || ! use storage-daemon; then
- if use systemd; then
- rm -vf "${D}"/lib/systemd/system/bareos-sd.service
- fi
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*
@@ -328,32 +351,18 @@ src_install() {
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"
-
- # now set the database dependency for the director init script
- case "${script}" in
- bareos-dir)
- sed -i -e "s:%databasetypes%:${mydbtypes[*]}:" "${T}/${script}".confd || die
- ;;
- *)
- ;;
- esac
-
# install init script and config
- newinitd "${T}/${script}".initd "${script}"
- newconfd "${T}/${script}".confd "${script}"
+ 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_dounit core/platforms/systemd/bareos-dir.service
- use storage-daemon && systemd_dounit core/platforms/systemd/bareos-sd.service
+ use director && systemd_newunit "${FILESDIR}"/bareos-dir-21.service bareos-dir.service
+ use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
fi
- systemd_dounit core/platforms/systemd/bareos-fd.service
+ systemd_dounit "${FILESDIR}"/bareos-fd.service
fi
# make sure the working directory exists
@@ -361,14 +370,21 @@ src_install() {
keepdir /var/lib/bareos
keepdir /var/lib/bareos/storage
- diropts -m0755
+ # 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
@@ -378,37 +394,21 @@ pkg_postinst() {
if ! use clientonly && use director; then
einfo
einfo "If this is a new install, you must create the database:"
- if use postgres; then
- einfo
- einfo "For postgresql:"
- 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'"
- fi
- if use mysql; then
- einfo
- einfo "For mysql:"
- einfo
- einfo " Make sure root has direct access to your mysql server. You may want to"
- einfo " create a /root/.my.cnf file with"
- einfo " [client]"
- einfo " user=root"
- einfo " password=YourPasswordForAccessingMysqlAsRoot"
- einfo " before running:"
- einfo " /usr/libexec/bareos/create_bareos_database mysql"
- einfo " /usr/libexec/bareos/make_bareos_tables mysql"
- einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
- fi
einfo
- fi
-
- if use sqlite; then
+ 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 "Be aware that Bareos does not officially support SQLite database."
- einfo "Best use it only for a client-only installation. See Bug #445540."
+ einfo "or run"
einfo
- einfo "It is strongly recommended to use either postgresql or mysql as"
- einfo "catalog database backend."
+ 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-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.2-r1.ebuild b/app-backup/bareos/bareos-22.1.2-r1.ebuild
new file mode 100644
index 000000000000..d61de65c0fc7
--- /dev/null
+++ b/app-backup/bareos/bareos-22.1.2-r1.ebuild
@@ -0,0 +1,435 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..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"
+ "${FILESDIR}/${PN}-22.1.2-include-algorithm.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"
+}
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"
+}
diff --git a/app-backup/bareos/bareos-23.0.1.ebuild b/app-backup/bareos/bareos-23.0.1.ebuild
new file mode 100644
index 000000000000..24b7a4409e94
--- /dev/null
+++ b/app-backup/bareos/bareos-23.0.1.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+CMAKE_WARN_UNUSED_CLI=no
+
+inherit python-any-r1 systemd cmake tmpfiles flag-o-matic
+
+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 cpu_flags_x86_avx +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=(
+ "${FILESDIR}/${PN}-21-cmake-gentoo.patch"
+ "${FILESDIR}/${PN}-22.0.2-werror.patch"
+ "${FILESDIR}/${PN}-21.1.2-no-automagic-ccache.patch"
+ "${FILESDIR}/${PN}-22.1.2-include-algorithm.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)
+ )
+
+ use cpu_flags_x86_avx && append-flags "-DXXH_X86DISPATCH_ALLOW_AVX"
+
+ # 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"
+}
diff --git a/app-backup/bareos/bareos-23.0.2.ebuild b/app-backup/bareos/bareos-23.0.2.ebuild
new file mode 100644
index 000000000000..f88f46187fe6
--- /dev/null
+++ b/app-backup/bareos/bareos-23.0.2.ebuild
@@ -0,0 +1,435 @@
+# 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 flag-o-matic
+
+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 cpu_flags_x86_avx +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=(
+ "${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)
+ )
+
+ use cpu_flags_x86_avx && append-flags "-DXXH_X86DISPATCH_ALLOW_AVX"
+
+ # 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"
+}
diff --git a/app-backup/bareos/bareos-9999.ebuild b/app-backup/bareos/bareos-9999.ebuild
new file mode 100644
index 000000000000..24b7a4409e94
--- /dev/null
+++ b/app-backup/bareos/bareos-9999.ebuild
@@ -0,0 +1,436 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+CMAKE_WARN_UNUSED_CLI=no
+
+inherit python-any-r1 systemd cmake tmpfiles flag-o-matic
+
+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 cpu_flags_x86_avx +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=(
+ "${FILESDIR}/${PN}-21-cmake-gentoo.patch"
+ "${FILESDIR}/${PN}-22.0.2-werror.patch"
+ "${FILESDIR}/${PN}-21.1.2-no-automagic-ccache.patch"
+ "${FILESDIR}/${PN}-22.1.2-include-algorithm.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)
+ )
+
+ use cpu_flags_x86_avx && append-flags "-DXXH_X86DISPATCH_ALLOW_AVX"
+
+ # 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"
+}
diff --git a/app-backup/bareos/files/bareos-12.4.5-Makefile.patch b/app-backup/bareos/files/bareos-12.4.5-Makefile.patch
deleted file mode 100644
index 3cdee15d4db7..000000000000
--- a/app-backup/bareos/files/bareos-12.4.5-Makefile.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-# stop build if there are errors in subdirs
---- Makefile.in.orig 2010-07-20 16:53:44.000000000 +0000
-+++ Makefile.in 2010-07-20 16:55:50.000000000 +0000
-@@ -44,9 +44,8 @@
-
- all: Makefile
- @for I in ${all_subdirs}; \
-- do (cd $$I; echo "==>Entering directory `pwd`"; \
-- $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
-- echo ""; echo ""; exit 1;)); \
-+ do \
-+ $(MAKE) DESTDIR=$(DESTDIR) -C $$I $@ || exit 1; \
- done
-
- depend:
-@@ -55,9 +54,8 @@
-
- bacula-fd: Makefile
- @for I in ${fd_subdirs}; \
-- do (cd $$I; echo "==>Entering directory `pwd`"; \
-- $(MAKE) DESTDIR=$(DESTDIR) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
-- echo ""; echo ""; exit 1;)); \
-+ do \
-+ $(MAKE) DESTDIR=$(DESTDIR) -C $$I all || exit 1; \
- done
-
- #-------------------------------------------------------------------------
diff --git a/app-backup/bareos/files/bareos-12.4.5-bat-ldflags.patch b/app-backup/bareos/files/bareos-12.4.5-bat-ldflags.patch
deleted file mode 100644
index 94d8fb60120e..000000000000
--- a/app-backup/bareos/files/bareos-12.4.5-bat-ldflags.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-# bat needs to respect LDFLAGS
---- src/qt-console/bat.pro.in.orig 2010-07-20 18:28:50.000000000 +0000
-+++ src/qt-console/bat.pro.in 2010-07-20 18:29:25.000000000 +0000
-@@ -26,6 +26,7 @@
- QMAKE_LINK = $${LIBTOOL_LINK} $(CXX)
- QMAKE_INSTALL_PROGRAM = $${LIBTOOL_INSTALL} install -m @SBINPERM@ -p
- QMAKE_CLEAN += .libs/* bat
-+QMAKE_LFLAGS += @LDFLAGS@
-
- qwt {
- INCLUDEPATH += @QWT_INC@
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-21.1.2-no-automagic-ccache.patch b/app-backup/bareos/files/bareos-21.1.2-no-automagic-ccache.patch
new file mode 100644
index 000000000000..22cdc2a41c36
--- /dev/null
+++ b/app-backup/bareos/files/bareos-21.1.2-no-automagic-ccache.patch
@@ -0,0 +1,25 @@
+--- a/core/CMakeLists.txt
++++ b/core/CMakeLists.txt
+@@ -44,12 +44,6 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME common)
+
+ include(GNUInstallDirs)
+
+-find_program(CCACHE_FOUND ccache)
+-if(CCACHE_FOUND)
+- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+-endif(CCACHE_FOUND)
+-
+ # switch on CXX 17 Support
+ #
+ set(CMAKE_CXX_STANDARD 17)
+@@ -584,9 +578,6 @@ message(STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION})
+ # A simple way to get switches to the compiler is to use ADD_DEFINITIONS(). But
+ # there are also two variables exactly for this purpose:
+
+-# wheter or not
+-message(STATUS "CCACHE_FOUND: " ${CCACHE_FOUND})
+-
+ # Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug)
+ message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
+
diff --git a/app-backup/bareos/files/bareos-21.1.2-werror.patch b/app-backup/bareos/files/bareos-21.1.2-werror.patch
new file mode 100644
index 000000000000..10de9f1415b6
--- /dev/null
+++ b/app-backup/bareos/files/bareos-21.1.2-werror.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/841734
+--- a/core/CMakeLists.txt
++++ b/core/CMakeLists.txt
+@@ -96,7 +96,7 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ -Werror=format-security compiler_error_format_security
+ )
+ if(${compiler_error_format_security})
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat-security")
+ endif()
+ endif()
+
+@@ -353,8 +353,8 @@ if(developer)
+ add_definitions("-DDEVELOPER=1")
+ endif()
+
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+ include(BareosSetVariableDefaults)
+ option(ENABLE_BCONSOLE "Build bconsole binary" ON)
diff --git a/app-backup/bareos/files/bareos-22.0.2-werror.patch b/app-backup/bareos/files/bareos-22.0.2-werror.patch
new file mode 100644
index 000000000000..43f2aa5ad7d9
--- /dev/null
+++ b/app-backup/bareos/files/bareos-22.0.2-werror.patch
@@ -0,0 +1,23 @@
+diff -urN bareos-Release-22.0.2.orig/core/CMakeLists.txt bareos-Release-22.0.2/core/CMakeLists.txt
+--- bareos-Release-22.0.2.orig/core/CMakeLists.txt 2023-02-07 15:30:01.000000000 +0530
++++ bareos-Release-22.0.2/core/CMakeLists.txt 2023-03-01 23:06:39.577048453 +0530
+@@ -104,7 +104,7 @@
+ -Werror=format-security compiler_error_format_security
+ )
+ if(${compiler_error_format_security})
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat-security")
+ endif()
+ endif()
+
+@@ -394,8 +394,8 @@
+ add_definitions("-DDEVELOPER=1")
+ endif()
+
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wextra")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")
++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
+
+ include(BareosSetVariableDefaults)
+ option(ENABLE_BCONSOLE "Build bconsole binary" ON)
diff --git a/app-backup/bareos/files/bareos-22.1.2-include-algorithm.patch b/app-backup/bareos/files/bareos-22.1.2-include-algorithm.patch
new file mode 100644
index 000000000000..5f71576bc001
--- /dev/null
+++ b/app-backup/bareos/files/bareos-22.1.2-include-algorithm.patch
@@ -0,0 +1,41 @@
+From https://github.com/bareos/bareos/pull/1687/commits/3907be7ff9700d0328198b47c58885f5ec56546c
+https://bugs.gentoo.org/920489
+
+diff --git a/core/src/cats/sql_get.cc b/core/src/cats/sql_get.cc
+index b5d921c..150ebfc 100644
+--- a/core/src/cats/sql_get.cc
++++ b/core/src/cats/sql_get.cc
+@@ -31,6 +31,7 @@
+ */
+
+ #include "include/bareos.h"
++#include <algorithm>
+
+ #if HAVE_SQLITE3 || HAVE_MYSQL || HAVE_POSTGRESQL || HAVE_INGRES || HAVE_DBI
+
+diff --git a/core/src/stored/append.cc b/core/src/stored/append.cc
+index 05f6784..32234d4 100644
+--- a/core/src/stored/append.cc
++++ b/core/src/stored/append.cc
+@@ -41,6 +41,8 @@
+ #include "lib/berrno.h"
+ #include "lib/berrno.h"
+
++#include <algorithm>
++
+ namespace storagedaemon {
+
+ /* Responses sent to the daemon */
+diff --git a/core/src/dird/ua_prune.cc b/core/src/dird/ua_prune.cc
+index 9a0770c..15a0a56 100644
+--- a/core/src/dird/ua_prune.cc
++++ b/core/src/dird/ua_prune.cc
+@@ -40,6 +40,8 @@
+ #include "lib/edit.h"
+ #include "lib/parse_conf.h"
+
++#include <algorithm>
++
+ namespace directordaemon {
+
+ /* Forward referenced functions */
diff --git a/app-backup/bareos/files/bareos-cmake-gentoo.patch b/app-backup/bareos/files/bareos-cmake-gentoo.patch
deleted file mode 100644
index 0f67a9e5d9de..000000000000
--- a/app-backup/bareos/files/bareos-cmake-gentoo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- core/cmake/distname.sh.orig 2019-01-31 12:39:26.000000000 +0100
-+++ core/cmake/distname.sh 2019-02-05 10:26:43.258936535 +0100
-@@ -134,7 +134,7 @@
- elif test -f /etc/gentoo-release
- then
- DISTNAME=gentoo
-- DISTVER=`awk '/version / { print $5 }' < /etc/gentoo-release`
-+ DISTVER=`awk '/release / { print $5 }' < /etc/gentoo-release`
- elif test -f /etc/debian_version
- then
- if `test -f /etc/apt/sources.list && grep -q ubuntu /etc/apt/sources.list`; then
diff --git a/app-backup/bareos/files/bareos-cmake-rados.patch b/app-backup/bareos/files/bareos-cmake-rados.patch
deleted file mode 100644
index c9a0c176692e..000000000000
--- a/app-backup/bareos/files/bareos-cmake-rados.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- core/cmake/BareosCheckSymbols.cmake.orig 2018-12-05 23:39:37.307627387 +0100
-+++ core/cmake/BareosCheckSymbols.cmake 2018-12-05 23:40:00.999464771 +0100
-@@ -21,7 +21,7 @@
-
-
- CHECK_SYMBOL_EXISTS(__stub_lchmod features.h LCHMOD_IS_A_STUB1)
--CHECK_SYMBOL_EXISTS(__stub___lchmod features_h LCHMOD_IS_A_STUB2)
-+#CHECK_SYMBOL_EXISTS(__stub___lchmod features_h LCHMOD_IS_A_STUB2)
-
-
-
-@@ -43,7 +43,9 @@
-
- cmake_push_check_state()
- SET(CMAKE_REQUIRED_LIBRARIES ${RADOS_LIBRARIES})
-+if ("${HAVE_RADOS}")
- CHECK_SYMBOL_EXISTS(rados_ioctx_set_namespace rados/librados.h HAVE_RADOS_NAMESPACES)
- CHECK_SYMBOL_EXISTS(rados_nobjects_list_open rados/librados.h HAVE_RADOS_NOBJECTS_LIST)
-+endif()
- cmake_pop_check_state()
-
diff --git a/app-backup/bareos/files/bareos-cmake-symlink-default-db-backend.patch b/app-backup/bareos/files/bareos-cmake-symlink-default-db-backend.patch
deleted file mode 100644
index 8c46fdf0dc86..000000000000
--- a/app-backup/bareos/files/bareos-cmake-symlink-default-db-backend.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- work/bareos-Release-18.2.5/core/cmake/bareos-symlink-default-db-backend.cmake.orig 2019-01-31 12:39:26.000000000 +0100
-+++ work/bareos-Release-18.2.5/core/cmake/bareos-symlink-default-db-backend.cmake 2019-02-05 11:00:24.559983661 +0100
-@@ -19,5 +19,5 @@
- MESSAGE(STATUS "${CMAKE_COMMAND} -E create_symlink ${libdir}/libbareoscats${CMAKE_SHARED_LIBRARY_SUFFIX} ${backenddir}/libbareoscats-${default_db_backend}${CMAKE_SHARED_LIBRARY_SUFFIX}")
- execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
- ${backenddir}/libbareoscats-${default_db_backend}${CMAKE_SHARED_LIBRARY_SUFFIX}
-- ${libdir}/libbareoscats${CMAKE_SHARED_LIBRARY_SUFFIX}.${BAREOS_NUMERIC_VERSION}
-+ $ENV{DESTDIR}/${libdir}/libbareoscats${CMAKE_SHARED_LIBRARY_SUFFIX}.${BAREOS_NUMERIC_VERSION}
- )
diff --git a/app-backup/bareos/files/bareos-dir-21-r1.initd b/app-backup/bareos/files/bareos-dir-21-r1.initd
new file mode 100644
index 000000000000..1363833e8962
--- /dev/null
+++ b/app-backup/bareos/files/bareos-dir-21-r1.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use dns
+}
+
+start_pre() {
+ checkpath --directory --owner root:root --mode 00755 /run/bareos
+}
+
+command="/usr/sbin/bareos-dir"
+command_args="-f ${DIR_OPTIONS}"
+command_background="true"
+pidfile="/run/bareos/bareos-dir.9101.pid"
diff --git a/app-backup/bareos/files/bareos-dir.confd b/app-backup/bareos/files/bareos-dir-21.confd
index 6d755bf93344..4e2ee55d8924 100644
--- a/app-backup/bareos/files/bareos-dir.confd
+++ b/app-backup/bareos/files/bareos-dir-21.confd
@@ -1,15 +1,8 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Config file for /etc/init.d/bareos-dir
-# Bareos can use more than one catalog database and each one can
-# be of any supported type.
-# If a database server where you store a bareos catalog
-# is on a different machine, you might want to remove the corresponding
-# type from the rc_need variable.
-rc_need="%databasetypes%"
-
# 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
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
diff --git a/app-backup/bareos/files/bareos-dir.confd-16 b/app-backup/bareos/files/bareos-dir.confd-16
deleted file mode 100644
index a11eba90a755..000000000000
--- a/app-backup/bareos/files/bareos-dir.confd-16
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# Config file for /etc/init.d/bareos-dir
-
-# Bareos can use more than one catalog database and each one can
-# be of any supported type.
-# If a database server where you store a bareos catalog
-# is on a different machine, you might want to remove the corresponding
-# type from the rc_need variable.
-rc_need="%databasetypes%"
-
-# 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 root -g bareos"
diff --git a/app-backup/bareos/files/bareos-dir.initd b/app-backup/bareos/files/bareos-dir.initd
deleted file mode 100644
index 826d27a829c9..000000000000
--- a/app-backup/bareos/files/bareos-dir.initd
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
- use dns bareos-fd bareos-sd
-}
-
-start() {
- ebegin "Starting bareos director"
- checkpath -d -m 0750 -o bareos:bareos /run/bareos
- start-stop-daemon --start --quiet --exec /usr/sbin/bareos-dir \
- -- ${DIR_OPTIONS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping bareos director"
- start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-dir.*.pid
- eend $?
-}
diff --git a/app-backup/bareos/files/bareos-dir.service b/app-backup/bareos/files/bareos-dir.service
deleted file mode 100644
index 440d3c3be98d..000000000000
--- a/app-backup/bareos/files/bareos-dir.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
- Description=Bareos Director
- After=syslog.target network.target
- Requires=bareos-sd.service bareos-fd.service
-
-[Install]
- WantedBy=multi-user.target
-
-[Service]
- Type=forking
- User=root
- ExecStartPre=-/bin/mkdir /run/bareos
- ExecStart=/usr/sbin/bareos-dir
diff --git a/app-backup/bareos/files/bareos-fd-21-r1.initd b/app-backup/bareos/files/bareos-fd-21-r1.initd
new file mode 100644
index 000000000000..2b752085c764
--- /dev/null
+++ b/app-backup/bareos/files/bareos-fd-21-r1.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use dns
+}
+
+command="/usr/sbin/bareos-fd"
+command_args="-f ${DIR_OPTIONS}"
+command_background="true"
+pidfile="/run/bareos/bareos-fd.9102.pid"
diff --git a/app-backup/bareos/files/bareos-fd.confd b/app-backup/bareos/files/bareos-fd-21.confd
index 5e429a6bd31c..407f2a8828eb 100644
--- a/app-backup/bareos/files/bareos-fd.confd
+++ b/app-backup/bareos/files/bareos-fd-21.confd
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Config file for /etc/init.d/bareos-fd
diff --git a/app-backup/bareos/files/bareos-fd.confd-16 b/app-backup/bareos/files/bareos-fd.confd-16
deleted file mode 100644
index e3b8a1f576fd..000000000000
--- a/app-backup/bareos/files/bareos-fd.confd-16
+++ /dev/null
@@ -1,7 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# Config file for /etc/init.d/bareos-fd
-
-# Options for the file daemon.
-FD_OPTIONS="-u root -g bareos"
diff --git a/app-backup/bareos/files/bareos-fd.initd b/app-backup/bareos/files/bareos-fd.initd
deleted file mode 100644
index e272daa88ecd..000000000000
--- a/app-backup/bareos/files/bareos-fd.initd
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
- use dns
-}
-
-start() {
- ebegin "Starting bareos file daemon"
- checkpath -d -m 0750 /run/bareos
- start-stop-daemon --start --quiet --exec /usr/sbin/bareos-fd \
- -- ${FD_OPTIONS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping bareos file daemon"
- start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-fd.*.pid
- eend $?
-}
diff --git a/app-backup/bareos/files/bareos-fd.service b/app-backup/bareos/files/bareos-fd.service
index 103286094250..e9b4b832afb1 100644
--- a/app-backup/bareos/files/bareos-fd.service
+++ b/app-backup/bareos/files/bareos-fd.service
@@ -1,12 +1,26 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+#
+# Bareos File Daemon
+#
[Unit]
- Description=Bareos File Daemon
- After=syslog.target network.target
-
-[Install]
- WantedBy=multi-user.target
+Description=Bareos File Daemon
+Documentation=man:bareos-fd(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
[Service]
- Type=forking
- User=root
- ExecStartPre=-/bin/mkdir /run/bareos
- ExecStart=/usr/sbin/bareos-fd
+Type=forking
+User=root
+Group=bareos
+WorkingDirectory=/var/lib/bareos
+PIDFile=/run/bareos/bareos-fd.9102.pid
+StandardError=journal
+ExecStartPre=/usr/sbin/bareos-fd -f -t
+ExecStart=/usr/sbin/bareos-fd
+SuccessExitStatus=0 15
+#Restart=on-failure
+
+[Install]
+Alias=bareos-filedaemon.service
+WantedBy=multi-user.target
diff --git a/app-backup/bareos/files/bareos-sd-21-r1.initd b/app-backup/bareos/files/bareos-sd-21-r1.initd
new file mode 100644
index 000000000000..d6a5765a74a4
--- /dev/null
+++ b/app-backup/bareos/files/bareos-sd-21-r1.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use dns
+}
+
+start_pre() {
+ checkpath --directory --owner root:root --mode 00755 /run/bareos
+}
+
+command="/usr/sbin/bareos-sd"
+command_args="-f ${DIR_OPTIONS}"
+command_background="true"
+pidfile="/run/bareos/bareos-sd.9103.pid"
diff --git a/app-backup/bareos/files/bareos-sd.confd b/app-backup/bareos/files/bareos-sd-21.confd
index d0153b2b30b5..2a67ae2b5523 100644
--- a/app-backup/bareos/files/bareos-sd.confd
+++ b/app-backup/bareos/files/bareos-sd-21.confd
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Config file for /etc/init.d/bareos-sd
diff --git a/app-backup/bareos/files/bareos-sd.confd-16 b/app-backup/bareos/files/bareos-sd.confd-16
deleted file mode 100644
index 5d377b978dd5..000000000000
--- a/app-backup/bareos/files/bareos-sd.confd-16
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# Config file for /etc/init.d/bareos-sd
-
-# Options for the storage daemon.
-# The storage daemon can be run as a non-root user, however
-# please ensure that this user has proper permissions to
-# access your backup devices.
-SD_OPTIONS="-u root -g bareos"
diff --git a/app-backup/bareos/files/bareos-sd.initd b/app-backup/bareos/files/bareos-sd.initd
deleted file mode 100644
index f20be4ecf56e..000000000000
--- a/app-backup/bareos/files/bareos-sd.initd
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-depend() {
- use dns
-}
-
-start() {
- ebegin "Starting bareos storage daemon"
- checkpath -d -m 0750 -o bareos:bareos /run/bareos
- start-stop-daemon --start --quiet --exec /usr/sbin/bareos-sd \
- -- ${SD_OPTIONS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping bareos storage daemon"
- start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-sd.*.pid
- eend $?
-}
diff --git a/app-backup/bareos/files/bareos-sd.service b/app-backup/bareos/files/bareos-sd.service
index 6c617ec6a37f..acf8cb0156e1 100644
--- a/app-backup/bareos/files/bareos-sd.service
+++ b/app-backup/bareos/files/bareos-sd.service
@@ -1,12 +1,31 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+#
+# Bareos Storage Daemon
+#
[Unit]
- Description=Bareos Storage Daemon
- After=syslog.target network-online.target
-
-[Install]
- WantedBy=multi-user.target
+Description=Bareos Storage Daemon
+Documentation=man:bareos-sd(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
[Service]
- Type=forking
- User=root
- ExecStartPre=-/bin/mkdir /run/bareos
- ExecStart=/usr/sbin/bareos-sd
+# see bug #631598
+#Type=forking
+Type=simple
+User=root
+Group=bareos
+WorkingDirectory=/var/lib/bareos
+#PIDFile=/run/bareos/bareos-sd.9103.pid
+StandardError=journal
+ExecStartPre=/usr/sbin/bareos-sd -t -f
+#ExecStart=/usr/sbin/bareos-sd
+ExecStart=/usr/sbin/bareos-sd -f
+# enable this for scsicrypto-sd
+# CapabilityBoundingSet=cap_sys_rawio+ep
+SuccessExitStatus=0 15
+#Restart=on-failure
+
+[Install]
+Alias=bareos-storage.service
+WantedBy=multi-user.target
diff --git a/app-backup/bareos/files/tmpfiles.d-bareos.conf b/app-backup/bareos/files/tmpfiles.d-bareos.conf
new file mode 100644
index 000000000000..81c57569c455
--- /dev/null
+++ b/app-backup/bareos/files/tmpfiles.d-bareos.conf
@@ -0,0 +1 @@
+d /run/bareos 0750 root bareos -
diff --git a/app-backup/bareos/metadata.xml b/app-backup/bareos/metadata.xml
index 4f7694434a3e..bc08ba42ba52 100644
--- a/app-backup/bareos/metadata.xml
+++ b/app-backup/bareos/metadata.xml
@@ -1,26 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>mschiff@gentoo.org</email>
<name>Marc Schiffbauer</name>
</maintainer>
<use>
- <flag name="cephfs">Enable cephfs storage backend</flag>
+ <flag name="ceph">Enable <pkg>sys-cluster/ceph</pkg> support</flag>
<flag name="clientonly">Only install file-daemon (client)</flag>
<flag name="director">Install director</flag>
- <flag name="fastlz">Enable support vor lz4, lz4hc and lzfast using dev-libs/bareos-fastlzlib</flag>
- <flag name="glusterfs">Enable glusterfs storage backend</flag>
- <flag name="gnutls">When ssl is enabled, use GnuTLS instead of OpenSSL</flag>
- <flag name="jansson">JSON API support using JANSSON for director</flag>
- <flag name="lmdb">enable build of LMDB support for faster accurate backup</flag>
- <flag name="logwatch">Install support files for logwatch</flag>
+ <flag name="glusterfs">Enable <pkg>sys-cluster/glusterfs</pkg> storage backend</flag>
+ <flag name="lmdb">enable build of <pkg>dev-db/lmdb</pkg> support for faster accurate backup</flag>
+ <flag name="logwatch">Install support files for <pkg>sys-apps/logwatch</pkg></flag>
<flag name="ndmp">Enable support for NDMP (Network Data Management Protocol)</flag>
- <flag name="rados">Enable rados storage backend</flag>
- <flag name="rados-striper">Enable use of rados-striper</flag>
<flag name="scsi-crypto">Enable low level SCSI crypto support</flag>
- <flag name="sql-pooling">Enable SQL pooling support</flag>
<flag name="storage-daemon">Install storage daemon (bareos-sd)</flag>
+ <flag name="vmware">Enable bareos-fd VMware plugin</flag>
</use>
<upstream>
<remote-id type="github">bareos/bareos</remote-id>