summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-25 15:40:41 +0100
committerErich Eckner <git@eckner.net>2019-02-25 15:40:41 +0100
commitcbc416a25d57f5541531186b402d8df9400de179 (patch)
treea6233243e6a912b72bcbb085e3cced26aaefb404
parent8949a82c8aa34b44a06fef23f3cc1f3f5c6010d6 (diff)
downloadarchlinuxewe-cbc416a25d57f5541531186b402d8df9400de179.tar.xz
bareos new
-rw-r--r--bareos/.gitignore1
-rw-r--r--bareos/PKGBUILD452
-rw-r--r--bareos/bareos-bconsole.install12
-rw-r--r--bareos/bareos-common.install31
-rw-r--r--bareos/bareos-database-mysql.install24
-rw-r--r--bareos/bareos-database-postgresql.install24
-rw-r--r--bareos/bareos-director.install22
-rw-r--r--bareos/bareos-filedaemon.install9
-rw-r--r--bareos/bareos-storage.install19
9 files changed, 594 insertions, 0 deletions
diff --git a/bareos/.gitignore b/bareos/.gitignore
new file mode 100644
index 000000000..0bf7e0511
--- /dev/null
+++ b/bareos/.gitignore
@@ -0,0 +1 @@
+bareos
diff --git a/bareos/PKGBUILD b/bareos/PKGBUILD
new file mode 100644
index 000000000..b384eebbc
--- /dev/null
+++ b/bareos/PKGBUILD
@@ -0,0 +1,452 @@
+# Maintainer: Erich Eckner <arch at eckner dot net>
+# Contributor: Michael Spradling <mike@mspradling.com>
+
+pkgbase='bareos'
+
+pkgname=("${pkgbase}-common"
+ "${pkgbase}-bconsole"
+ "${pkgbase}-database-common"
+ "${pkgbase}-database-mysql"
+ "${pkgbase}-database-postgresql"
+ "${pkgbase}-database-sqlite3"
+ "${pkgbase}-database-tools"
+ "${pkgbase}-devel"
+ "${pkgbase}-director"
+ "${pkgbase}-storage-fifo"
+ "${pkgbase}-tools"
+ "${pkgbase}-filedaemon"
+ "${pkgbase}-storage"
+ "${pkgbase}-storage-tape"
+ "${pkgbase}-director-python-plugin"
+ "${pkgbase}-filedaemon-python-plugin"
+ "${pkgbase}-storage-python-plugin")
+
+pkgver=17.2.7
+pkgrel=1
+arch=(i686 x86_64 armv7h aarch64)
+groups=('bareos')
+pkgdesc="Bareos - Backup Archiving REcovery Open Sourced"
+url="http://www.bareos.org"
+license=('AGPL3')
+makedepends=('libmariadbclient' 'postgresql-libs' 'sqlite3' 'python2')
+source=("git+https://github.com/bareos/bareos.git#tag=Release/$pkgver")
+md5sums=('SKIP')
+
+prepare() {
+ cd $pkgbase
+ sed -i "s/python-config/python2-config/g" configure
+}
+
+build() {
+ cd $pkgbase
+
+ # Disable cephfs, broken
+ sed -i 's/have_cephfs=\"yes\"/have_cephfs=\"no\"/' ./configure
+
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --localstatedir=/ \
+ --libdir=/usr/lib/$pkgbase \
+ --disable-conio \
+ --enable-dynamic-cats-backends \
+ --enable-dynamic-storage-backends \
+ --with-python \
+ --with-openssl \
+ --with-mysql \
+ --disable-rpath \
+ --with-postgresql \
+ --with-sqlite3 \
+ --with-logdir=/var/log/$pkgbase \
+ --with-dir-user=$pkgbase \
+ --with-dir-group=$pkgbase \
+ --with-sd-user=$pkgbase \
+ --with-sd-group=$pkgbase \
+ --with-fd-user=root \
+ --with-pid-dir=/run/bareos \
+ --with-fd-group=root \
+ --with-configtemplatedir=/usr/share/$pkgbase/config \
+ --with-working-dir=/var/lib/$pkgbase \
+ --with-plugindir=/usr/lib/$pkgbase/plugins \
+ --with-scriptdir=/usr/lib/$pkgbase/scripts \
+ --with-backenddir=/usr/lib/$pkgbase/backends \
+ --with-archivedir=/var/lib/$pkgbase/storage \
+ --with-bsrdir=/var/lib/$pkgbase \
+ --with-subsys-dir=/run/$pkgbase \
+ --with-systemd && make
+
+ make DESTDIR="$srcdir/install" install install-autostart
+}
+
+
+_cp() {
+ mkdir -p "$(dirname $2)"
+ cp -a "$1" "$2"
+}
+
+package_bareos-common() {
+ # Matches bareos-common.install.in
+ pkgdesc="${pkgdesc} - Common files"
+ depends=('libcap' 'openssl' 'acl' 'bash' 'lzo' 'jansson' 'zlib')
+ install=bareos-common.install
+
+ for f in \
+ usr/lib/bareos/libbareos-$pkgver.so \
+ usr/lib/bareos/libbareos.so \
+ usr/lib/bareos/libbareoscfg-$pkgver.so \
+ usr/lib/bareos/libbareoscfg.so \
+ usr/lib/bareos/libbareosfind-$pkgver.so \
+ usr/lib/bareos/libbareosfind.so \
+ usr/lib/bareos/scripts/bareos-config \
+ usr/lib/bareos/scripts/bareos-config-lib.sh \
+ usr/lib/bareos/scripts/btraceback.gdb \
+ usr/bin/bsmtp \
+ usr/bin/btraceback \
+ usr/share/man/man1/bsmtp.1.gz \
+ usr/share/man/man8/btraceback.8.gz \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+
+ install -d $pkgdir/var/lib/bareos
+ install -d $pkgdir/etc/bareos
+ install -d $pkgdir/run/bareos
+}
+
+package_bareos-bconsole() {
+ pkgdesc="${pkgdesc} - Admin Tool (CLI)"
+ depends=("bareos-common=$pkgver" 'readline' 'jansson')
+ groups+=('bareos-client')
+ install=bareos-bconsole.install
+
+ for f in \
+ /usr/share/bareos/config/bconsole.conf \
+ usr/bin/bconsole \
+ usr/share/man/man1/bconsole.1.gz \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-database-common() {
+ pkgdesc="${pkgdesc} - Generic abstration libs and tools for sql catalog"
+ depends=("bareos-common=$pkgver" 'libcap' 'lzo' 'zlib' 'openssl' 'bash' 'jansson')
+
+ for f in \
+ usr/lib/bareos/libbareoscats-$pkgver.so \
+ usr/lib/bareos/libbareoscats.so \
+ usr/lib/bareos/libbareossql-$pkgver.so \
+ usr/lib/bareos/libbareossql.so \
+ usr/lib/bareos/scripts/create_bareos_database \
+ usr/lib/bareos/scripts/drop_bareos_database \
+ usr/lib/bareos/scripts/drop_bareos_tables \
+ usr/lib/bareos/scripts/grant_bareos_privileges \
+ usr/lib/bareos/scripts/make_bareos_tables \
+ usr/lib/bareos/scripts/update_bareos_tables \
+ usr/lib/bareos/scripts/ddl/versions.map \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-database-mysql() {
+ pkgdesc="${pkgdesc} - Libs and tools for mysql catalog"
+ provides=("bareos-database=$pkgver")
+ depends=("bareos-database-common=$pkgver" 'libmariadbclient')
+ install=bareos-database-mysql.install
+
+ for f in \
+ usr/lib/bareos/backends/libbareoscats-mysql-$pkgver.so \
+ usr/lib/bareos/backends/libbareoscats-mysql.so \
+ usr/lib/bareos/scripts/ddl/drops/mysql.sql \
+ usr/lib/bareos/scripts/ddl/grants/mysql.sql \
+ usr/lib/bareos/scripts/ddl/creates/mysql.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.10_11.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.11_12.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.12_14.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.14_2001.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.2001_2002.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.2002_2003.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.2003_2004.sql \
+ usr/lib/bareos/scripts/ddl/updates/mysql.2004_2171.sql \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-database-postgresql() {
+ pkgdesc="${pkgdesc} - Libs and tools for postgresql catalog"
+ provides=("bareos-database=$pkgver")
+ depends=("bareos-database-common=$pkgver" "postgresql-libs")
+ install='bareos-database-postgresql.install'
+
+ for f in \
+ usr/lib/bareos/backends/libbareoscats-postgresql-$pkgver.so \
+ usr/lib/bareos/backends/libbareoscats-postgresql.so \
+ usr/lib/bareos/scripts/ddl/drops/postgresql.sql \
+ usr/lib/bareos/scripts/ddl/grants/postgresql-change_owner.dbconfig-template.sql \
+ usr/lib/bareos/scripts/ddl/grants/postgresql-readonly.sql \
+ usr/lib/bareos/scripts/ddl/grants/postgresql.sql \
+ usr/lib/bareos/scripts/ddl/creates/postgresql.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.10_11.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.11_12.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.12_14.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.14_2001.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.2001_2002.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.2002_2003.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.2003_2004.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.2004_2171.sql \
+ usr/lib/bareos/scripts/ddl/updates/postgresql.bee.1017_2004.sql \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-database-sqlite3() {
+ pkgdesc="${pkgdesc} - Libs and tools for sqlite3 catalog"
+ provides=("bareos-database=$pkgver")
+ depends=("bareos-database-common=$pkgver" "sqlite3")
+
+ for f in \
+ usr/lib/bareos/backends/libbareoscats-sqlite3-$pkgver.so \
+ usr/lib/bareos/backends/libbareoscats-sqlite3.so \
+ usr/lib/bareos/scripts/ddl/creates/sqlite3.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.10_11.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.11_12.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.12_14.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.14_2001.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.2001_2002.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.2002_2003.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.2003_2004.sql \
+ usr/lib/bareos/scripts/ddl/updates/sqlite3.2004_2171.sql \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-database-tools() {
+ pkgdesc="${pkgdesc} - CLI tools with database dpendencies (dbcheck, bscan)"
+ depends=("bareos-database-common=$pkgver" 'openssl' 'jansson')
+
+ for f in \
+ usr/bin/bareos-dbcheck \
+ usr/bin/bscan \
+ usr/share/man/man8/bareos-dbcheck.8.gz \
+ usr/share/man/man8/bscan.8.gz \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-devel() {
+ pkgdesc="${pkgdesc} - Devel headers"
+ arch=(any)
+ # TODO
+ install -d $pkgdir/usr/include/bareos
+}
+
+package_bareos-director() {
+ pkgdesc="${pkgdesc} - Director daemon"
+ depends=("bareos-common=$pkgver" 'openssl' 'bash' 'jansson')
+ install=bareos-director.install
+
+ for f in \
+ usr/lib/bareos/scripts/delete_catalog_backup \
+ usr/lib/bareos/scripts/make_catalog_backup \
+ usr/lib/bareos/scripts/make_catalog_backup.pl \
+ usr/lib/bareos/scripts/query.sql \
+ usr/share/bareos/config/bareos-dir.d/catalog/MyCatalog.conf \
+ usr/share/bareos/config/bareos-dir.d/client/bareos-fd.conf \
+ usr/share/bareos/config/bareos-dir.d/console/bareos-mon.conf \
+ usr/share/bareos/config/bareos-dir.d/director/bareos-dir.conf \
+ usr/share/bareos/config/bareos-dir.d/fileset/Catalog.conf \
+ usr/share/bareos/config/bareos-dir.d/fileset/LinuxAll.conf \
+ usr/share/bareos/config/bareos-dir.d/fileset/SelfTest.conf \
+ usr/share/bareos/config/bareos-dir.d/fileset/Windows\ All\ Drives.conf \
+ usr/share/bareos/config/bareos-dir.d/job/backup-bareos-fd.conf \
+ usr/share/bareos/config/bareos-dir.d/job/BackupCatalog.conf \
+ usr/share/bareos/config/bareos-dir.d/job/RestoreFiles.conf \
+ usr/share/bareos/config/bareos-dir.d/jobdefs/DefaultJob.conf \
+ usr/share/bareos/config/bareos-dir.d/messages/Daemon.conf \
+ usr/share/bareos/config/bareos-dir.d/messages/Standard.conf \
+ usr/share/bareos/config/bareos-dir.d/pool/Differential.conf \
+ usr/share/bareos/config/bareos-dir.d/pool/Full.conf \
+ usr/share/bareos/config/bareos-dir.d/pool/Incremental.conf \
+ usr/share/bareos/config/bareos-dir.d/pool/Scratch.conf \
+ usr/share/bareos/config/bareos-dir.d/profile/operator.conf \
+ usr/share/bareos/config/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf \
+ usr/share/bareos/config/bareos-dir.d/schedule/WeeklyCycle.conf \
+ usr/share/bareos/config/bareos-dir.d/storage/File.conf \
+ usr/bin/bareos-dir \
+ usr/share/man/man8/bareos-dir.8.gz \
+ usr/share/man/man8/bareos.8.gz \
+ ; do
+ # pacman LINT tool currently does not like spaces
+ space_removal=`echo $f | tr ' ' '_'`
+ _cp "$srcdir/install/$f" "$pkgdir/$space_removal"
+ done
+
+ # Currently upstream systemd file does not automatically create run directory
+ sed -i '/\[Service\]/a RuntimeDirectory=bareos' $srcdir/bareos/platforms/systemd/bareos-dir.service
+ _cp $srcdir/bareos/platforms/systemd/bareos-dir.service $pkgdir/usr/lib/systemd/system/bareos-dir.service
+}
+
+package_bareos-storage-fifo() {
+ pkgdesc="${pkgdesc} - FIFO support for storage daemon"
+ depends=("bareos-storage=$pkgver" 'zlib' 'libcap' 'openssl' 'jansson' 'lzo')
+ for f in \
+ usr/lib/bareos/backends/libbareossd-fifo-$pkgver.so \
+ usr/lib/bareos/backends/libbareossd-fifo.so \
+ usr/share/bareos/config/bareos-dir.d/storage/NULL.conf.example \
+ usr/share/bareos/config/bareos-sd.d/device/NULL.conf.example \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-tools() {
+ pkgdesc="${pkgdesc} - CLI tools (bcopy, bextract, bls, bregeq, bwild)"
+ depends=("bareos-common=$pkgver" 'glibc')
+
+ for f in \
+ usr/bin/bregex \
+ usr/bin/bwild \
+ usr/bin/bcopy \
+ usr/bin/bextract \
+ usr/bin/bls \
+ usr/bin/bpluginfo \
+ usr/share/man/man1/bwild.1.gz \
+ usr/share/man/man1/bregex.1.gz \
+ usr/share/man/man8/bcopy.8.gz \
+ usr/share/man/man8/bextract.8.gz \
+ usr/share/man/man8/bls.8.gz \
+ usr/share/man/man8/bpluginfo.8.gz \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-filedaemon() {
+ pkgdesc="${pkgdesc} - File daemon"
+ depends=("bareos-common=$pkgver" 'jansson' 'zlib' 'gcc-libs')
+ groups+=('bareos-client')
+ install=bareos-filedaemon.install
+
+ for f in \
+ usr/share/bareos/config/bareos-fd.d/client/myself.conf \
+ usr/share/bareos/config/bareos-fd.d/director/bareos-dir.conf \
+ usr/share/bareos/config/bareos-fd.d/director/bareos-mon.conf \
+ usr/share/bareos/config/bareos-fd.d/messages/Standard.conf \
+ usr/bin/bareos-fd \
+ usr/lib/bareos/plugins/bpipe-fd.so \
+ usr/share/man/man8/bareos-fd.8.gz \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+
+ # Currently upstream systemd file does not automatically create run directory
+ sed -i '/\[Service\]/a RuntimeDirectory=bareos' $srcdir/bareos/platforms/systemd/bareos-fd.service
+ _cp $srcdir/bareos/platforms/systemd/bareos-fd.service $pkgdir/usr/lib/systemd/system/bareos-fd.service
+}
+
+package_bareos-storage() {
+ pkgdesc="${pkgdesc} - Storage daemon"
+ depends=("bareos-common=$pkgver" 'zlib' 'lzo' 'jansson' 'openssl' 'libcap')
+ install=bareos-storage.install
+
+ for f in \
+ usr/lib/bareos/plugins/autoxflate-sd.so \
+ usr/lib/bareos/scripts/disk-changer \
+ usr/share/bareos/config/bareos-sd.d/device/FileStorage.conf \
+ usr/share/bareos/config/bareos-sd.d/director/bareos-dir.conf \
+ usr/share/bareos/config/bareos-sd.d/director/bareos-mon.conf \
+ usr/share/bareos/config/bareos-sd.d/messages/Standard.conf \
+ usr/share/bareos/config/bareos-sd.d/storage/bareos-sd.conf \
+ usr/bin/bareos-sd \
+ usr/share/man/man8/bareos-sd.8.gz \
+ usr/lib/bareos/libbareossd-$pkgver.so \
+ usr/lib/bareos/libbareossd.so \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+
+ install -d $pkgdir/var/lib/bareos/storage
+ # Currently upstream systemd file does not automatically create run directory
+ sed -i '/\[Service\]/a RuntimeDirectory=bareos' $srcdir/bareos/platforms/systemd/bareos-sd.service
+ _cp $srcdir/bareos/platforms/systemd/bareos-sd.service $pkgdir/usr/lib/systemd/system/bareos-sd.service
+}
+
+package_bareos-storage-tape() {
+ pkgdesc="${pkgdesc} - Tape support for storage daemon"
+ depends=("bareos-storage=$pkgver" 'zlib' 'libcap' 'bash' 'openssl' 'jansson' 'lzo' "mtx")
+ backup=(etc/bareos/mtx-changer.conf)
+
+ for f in \
+ etc/bareos/mtx-changer.conf \
+ usr/share/bareos/config/bareos-dir.d/storage/Tape.conf.example \
+ usr/share/bareos/config/bareos-sd.d/autochanger/autochanger-0.conf.example \
+ usr/share/bareos/config/bareos-sd.d/device/tapedrive-0.conf.example \
+ usr/lib/bareos/backends/libbareossd-gentape-$pkgver.so \
+ usr/lib/bareos/backends/libbareossd-gentape.so \
+ usr/lib/bareos/backends/libbareossd-tape-$pkgver.so \
+ usr/lib/bareos/backends/libbareossd-tape.so \
+ usr/lib/bareos/scripts/mtx-changer \
+ usr/share/man/man8/bscrypto.8.gz \
+ usr/share/man/man8/btape.8.gz \
+ usr/bin/bscrypto \
+ usr/bin/btape \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-director-python-plugin() {
+ pkgdesc="${pkgdesc} - Python plugin for director daemon"
+ depends=("bareos-director=$pkgver" 'libcap' 'jansson' 'lzo' 'python' 'python2')
+
+ for f in \
+ usr/lib/bareos/plugins/python-dir.so \
+ usr/lib/bareos/plugins/bareos-dir.py.template \
+ usr/lib/bareos/plugins/bareos_dir_consts.py \
+ usr/lib/bareos/plugins/BareosDirWrapper.py \
+ usr/lib/bareos/plugins/BareosDirPluginBaseclass.py \
+ usr/lib/bareos/plugins/bareos-dir-class-plugin.py \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-filedaemon-python-plugin() {
+ pkgdesc="${pkgdesc} - Python plugin for file daemon"
+ depends=("bareos-filedaemon=$pkgver" 'python' 'python2' 'libcap' 'lzo' 'jansson')
+
+ for f in \
+ usr/lib/bareos/plugins/python-fd.so \
+ usr/lib/bareos/plugins/bareos-fd.py.template \
+ usr/lib/bareos/plugins/bareos-fd-local-fileset.py \
+ usr/lib/bareos/plugins/bareos-fd-mock-test.py \
+ usr/lib/bareos/plugins/BareosFdPluginBaseclass.py \
+ usr/lib/bareos/plugins/BareosFdPluginLocalFileset.py \
+ usr/lib/bareos/plugins/BareosFdWrapper.py \
+ usr/lib/bareos/plugins/bareos_fd_consts.py \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
+
+package_bareos-storage-python-plugin() {
+ pkgdesc="${pkgdesc} - Python plugin for storage daemon"
+ depends=("bareos-storage=$pkgver" 'python2' 'lzo' 'python' 'libcap' 'jansson')
+
+ for f in \
+ usr/lib/bareos/plugins/python-sd.so \
+ usr/lib/bareos/plugins/bareos-sd.py.template \
+ usr/lib/bareos/plugins/bareos_sd_consts.py \
+ usr/lib/bareos/plugins/BareosSdPluginBaseclass.py \
+ usr/lib/bareos/plugins/BareosSdWrapper.py \
+ usr/lib/bareos/plugins/bareos-sd-class-plugin.py \
+ ; do
+ _cp $srcdir/install/$f $pkgdir/$f
+ done
+}
diff --git a/bareos/bareos-bconsole.install b/bareos/bareos-bconsole.install
new file mode 100644
index 000000000..0b1c1d30f
--- /dev/null
+++ b/bareos/bareos-bconsole.install
@@ -0,0 +1,12 @@
+## arg 1: the new package version
+post_install() {
+ /usr/lib/bareos/scripts/bareos-config initialize_local_hostname
+ /usr/lib/bareos/scripts/bareos-config initialize_passwords
+
+ chown root:bareos /usr/share/bareos/config/bconsole.conf
+ chmod 640 /usr/share/bareos/config/bconsole.conf
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/bareos/bareos-common.install b/bareos/bareos-common.install
new file mode 100644
index 000000000..426157081
--- /dev/null
+++ b/bareos/bareos-common.install
@@ -0,0 +1,31 @@
+# arg 1: the new package version
+pre_install() {
+ # Create User/Group
+ getent group bareos > /dev/null || groupadd --system bareos
+ getent passwd bareos > /dev/null || useradd --system --gid bareos \
+ --home-dir /var/lib/bareos --no-create-home bareos
+
+}
+
+# arg 1: the new package version
+post_install() {
+ chown bareos:bareos /var/lib/bareos/
+ chown bareos:bareos /run/bareos/
+ #chown bareos:bareos /var/log/bareos/
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_upgrade() {
+ pre_install
+}
+
+post_upgrade() {
+ post_install
+}
+
+# arg 1: the old package version
+post_remove() {
+ getent passwd bareos > /dev/null && userdel bareos
+ rm -f /etc/bareos/.rndpwd
+}
diff --git a/bareos/bareos-database-mysql.install b/bareos/bareos-database-mysql.install
new file mode 100644
index 000000000..dcfdf0406
--- /dev/null
+++ b/bareos/bareos-database-mysql.install
@@ -0,0 +1,24 @@
+yellow='\e[0;33m'
+coloroff='\e[0m'
+
+# arg 0: the new package version
+post_install() {
+ echo -e "${yellow}NOTE: Please see documentation (section 2.4.2) to setup database:${coloroff}"
+ #echo -e "${yellow} http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-400002.4.2${coloroff}"
+ echo -e "${yellow} http://download.bareos.org/bareos/release/17.2/documentation/html/bareos-manual-main-reference.html#QQ2-1-47${coloroff}"
+
+}
+
+# arg 0: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ #echo -e "${yellow}NOTE: Please see documentation (section) 3.1.2 to update database${coloroff}"
+ #echo -e "${yellow} http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-450003.1.2${coloroff}"
+ echo -e "${yellow}NOTE: Please see documentation (section) 4.2.2 to update database${coloroff}"
+ echo -e "${yellow} http://download.bareos.org/bareos/release/17.2/documentation/html/bareos-manual-main-reference.html#x1-710004.2.2${coloroff}"
+}
+
+# arg 0: the old package version
+post_remove() {
+ echo -e "${yellow}NOTE: To remove all traces of bareos please delete the bareos database.${coloroff}"
+}
diff --git a/bareos/bareos-database-postgresql.install b/bareos/bareos-database-postgresql.install
new file mode 100644
index 000000000..dcfdf0406
--- /dev/null
+++ b/bareos/bareos-database-postgresql.install
@@ -0,0 +1,24 @@
+yellow='\e[0;33m'
+coloroff='\e[0m'
+
+# arg 0: the new package version
+post_install() {
+ echo -e "${yellow}NOTE: Please see documentation (section 2.4.2) to setup database:${coloroff}"
+ #echo -e "${yellow} http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-400002.4.2${coloroff}"
+ echo -e "${yellow} http://download.bareos.org/bareos/release/17.2/documentation/html/bareos-manual-main-reference.html#QQ2-1-47${coloroff}"
+
+}
+
+# arg 0: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ #echo -e "${yellow}NOTE: Please see documentation (section) 3.1.2 to update database${coloroff}"
+ #echo -e "${yellow} http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-450003.1.2${coloroff}"
+ echo -e "${yellow}NOTE: Please see documentation (section) 4.2.2 to update database${coloroff}"
+ echo -e "${yellow} http://download.bareos.org/bareos/release/17.2/documentation/html/bareos-manual-main-reference.html#x1-710004.2.2${coloroff}"
+}
+
+# arg 0: the old package version
+post_remove() {
+ echo -e "${yellow}NOTE: To remove all traces of bareos please delete the bareos database.${coloroff}"
+}
diff --git a/bareos/bareos-director.install b/bareos/bareos-director.install
new file mode 100644
index 000000000..518d7869a
--- /dev/null
+++ b/bareos/bareos-director.install
@@ -0,0 +1,22 @@
+## arg 1: the new package version
+post_install() {
+ /usr/lib/bareos/scripts/bareos-config initialize_local_hostname
+ /usr/lib/bareos/scripts/bareos-config initialize_passwords
+
+ chown -R bareos:bareos /usr/share/bareos/config/bareos-dir.d
+ chmod -R 750 /usr/share/bareos/config/bareos-dir.d
+
+ chown bareos:bareos /usr/bin/bareos-dir
+
+ /usr/lib/bareos/scripts/bareos-config initialize_database_driver
+ /usr/lib/bareos/scripts/bareos-config apply_dbconfig_settings
+
+ #for dir in /etc/bareos/bareos-dir-export/ /etc/bareos/bareos-dir-export/client; do
+ #chown bareos:bareos "$dir"
+ #chmod 750 "$dir"
+ #done
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/bareos/bareos-filedaemon.install b/bareos/bareos-filedaemon.install
new file mode 100644
index 000000000..bfd1ca0f1
--- /dev/null
+++ b/bareos/bareos-filedaemon.install
@@ -0,0 +1,9 @@
+## arg 1: the new package version
+post_install() {
+ /usr/lib/bareos/scripts/bareos-config initialize_local_hostname
+ /usr/lib/bareos/scripts/bareos-config initialize_passwords
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/bareos/bareos-storage.install b/bareos/bareos-storage.install
new file mode 100644
index 000000000..8026ef6fa
--- /dev/null
+++ b/bareos/bareos-storage.install
@@ -0,0 +1,19 @@
+## arg 1: the new package version
+post_install() {
+ /usr/lib/bareos/scripts/bareos-config initialize_local_hostname
+ /usr/lib/bareos/scripts/bareos-config initialize_passwords
+
+ chown -R bareos:bareos /usr/share/bareos/config/bareos-sd.d
+ chmod -R 750 /usr/share/bareos/config/bareos-sd.d
+
+ chown bareos:bareos /usr/bin/bareos-sd
+
+ chown bareos:bareos /var/lib/bareos/storage/
+ chmod 750 /var/lib/bareos/storage/
+
+ /usr/lib/bareos/scripts/bareos-config setup_sd_user
+}
+
+post_upgrade() {
+ post_install
+}