summaryrefslogtreecommitdiff
path: root/manualPorts
diff options
context:
space:
mode:
Diffstat (limited to 'manualPorts')
-rw-r--r--manualPorts/bareos-filedaemon/.footprint35
-rw-r--r--manualPorts/bareos-filedaemon/.md5sum3
-rw-r--r--manualPorts/bareos-filedaemon/.signature7
-rw-r--r--manualPorts/bareos-filedaemon/Pkgfile156
-rwxr-xr-xmanualPorts/bareos-filedaemon/check-if-bareos-backup-is-running50
-rw-r--r--manualPorts/bareos-filedaemon/nullify-os-specifics.patch11
-rwxr-xr-xmanualPorts/bareos-filedaemon/post-install14
7 files changed, 276 insertions, 0 deletions
diff --git a/manualPorts/bareos-filedaemon/.footprint b/manualPorts/bareos-filedaemon/.footprint
new file mode 100644
index 0000000..5c2cfa9
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/.footprint
@@ -0,0 +1,35 @@
+drwxr-xr-x root/root etc/
+drwxr-x--- root/root etc/bareos/
+drwxr-x--- root/root etc/bareos/bareos-fd.d/
+drwxr-x--- root/root etc/bareos/bareos-fd.d/client/
+-rw-rw---- root/root etc/bareos/bareos-fd.d/client/myself.conf
+drwxr-x--- root/root etc/bareos/bareos-fd.d/director/
+-rw-rw---- root/root etc/bareos/bareos-fd.d/director/bareos-dir.conf
+-rw-rw---- root/root etc/bareos/bareos-fd.d/director/bareos-mon.conf
+drwxr-x--- root/root etc/bareos/bareos-fd.d/messages/
+-rw-rw---- root/root etc/bareos/bareos-fd.d/messages/Standard.conf
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/bareos-fd
+-rwxr-xr-x root/root usr/bin/check-if-bareos-backup-is-running
+drwxr-xr-x root/root usr/lib/
+drwxr-xr-x root/root usr/lib/bareos/
+lrwxrwxrwx root/root usr/lib/bareos/libbareos.so -> libbareos.so.19
+lrwxrwxrwx root/root usr/lib/bareos/libbareos.so.19 -> libbareos.so.19.2.7
+-rwxr-xr-x root/root usr/lib/bareos/libbareos.so.19.2.7
+lrwxrwxrwx root/root usr/lib/bareos/libbareosfastlz.so -> libbareosfastlz.so.19
+lrwxrwxrwx root/root usr/lib/bareos/libbareosfastlz.so.19 -> libbareosfastlz.so.19.2.7
+-rwxr-xr-x root/root usr/lib/bareos/libbareosfastlz.so.19.2.7
+lrwxrwxrwx root/root usr/lib/bareos/libbareosfind.so -> libbareosfind.so.19
+lrwxrwxrwx root/root usr/lib/bareos/libbareosfind.so.19 -> libbareosfind.so.19.2.7
+-rwxr-xr-x root/root usr/lib/bareos/libbareosfind.so.19.2.7
+lrwxrwxrwx root/root usr/lib/bareos/libbareoslmdb.so -> libbareoslmdb.so.19
+lrwxrwxrwx root/root usr/lib/bareos/libbareoslmdb.so.19 -> libbareoslmdb.so.19.2.7
+-rwxr-xr-x root/root usr/lib/bareos/libbareoslmdb.so.19.2.7
+drwxr-xr-x root/root usr/lib/bareos/scripts/
+-rwxr-xr-x root/root usr/lib/bareos/scripts/bareos-config
+-rwxr-xr-x root/root usr/lib/bareos/scripts/bareos-config-lib.sh
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man8/
+-rw-r--r-- root/root usr/share/man/man8/bareos-fd.8.gz
diff --git a/manualPorts/bareos-filedaemon/.md5sum b/manualPorts/bareos-filedaemon/.md5sum
new file mode 100644
index 0000000..ed4e621
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/.md5sum
@@ -0,0 +1,3 @@
+d483ef56350c55492f916ce53798d377 19.2.7.tar.gz
+c0ff9a74d0e26f65122ecf3bb48a87bd check-if-bareos-backup-is-running
+4f26be549cf136364dcb08daab7b0724 nullify-os-specifics.patch
diff --git a/manualPorts/bareos-filedaemon/.signature b/manualPorts/bareos-filedaemon/.signature
new file mode 100644
index 0000000..b9f8bdd
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/.signature
@@ -0,0 +1,7 @@
+untrusted comment: verify with /etc/ports/deepthought.pub
+RWQxCptPusLGGg2Ifq6cycsdlxgRAMqbkPGjLsj4Gkyu/UZjn2jlv2Hg0hgkNzcinoZu/XIW0IVouVBDMgTBLNnNJotbki9zAAk=
+SHA256 (Pkgfile) = 21b8bd81b2f3793fbadf5c553904bc136b16d81a9b830633d82865db65f93971
+SHA256 (.footprint) = bad692d670557e894cc51c7ebf0f40b1f43dc3545fd5ec15c7b19e020384f85b
+SHA256 (19.2.7.tar.gz) = 283c1fa9cb6a96b1f09b402cd507ecd8bf798458bafcbfad867da08d33d12653
+SHA256 (nullify-os-specifics.patch) = d2c0943243aa6f8be7fe0548b2c160cbfb86c979ef535553b7d823dc7ab5462e
+SHA256 (check-if-bareos-backup-is-running) = 14fb81b235a18c31f8457d23c525b4a87a0399755535f883d0f6e1e7fa360fc0
diff --git a/manualPorts/bareos-filedaemon/Pkgfile b/manualPorts/bareos-filedaemon/Pkgfile
new file mode 100644
index 0000000..ad7ea75
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/Pkgfile
@@ -0,0 +1,156 @@
+# Description: Backup Archiving REcovery Open Sourced - client.
+# URL: http://www.bareos.org
+# Maintainer: Erich Eckner, crux at eckner dot net
+# Depends on: acl bash cmake glibc libcap lzo openssl python readline sqlite3 zlib
+
+name=bareos-filedaemon
+_name=${name%-*}
+version=19.2.7
+release=1
+source=("https://github.com/$_name/$_name/archive/Release/$version.tar.gz"
+'nullify-os-specifics.patch'
+'check-if-bareos-backup-is-running')
+
+build() {
+
+ cd "${SRC}/${_name}-Release-${version}"
+ patch -p1 -i "${SRC}/nullify-os-specifics.patch"
+
+ mkdir build
+ cd build
+
+ cmake .. \
+ -Dprefix=/usr \
+ -Dsbindir=/usr/bin \
+ -Dsysconfdir=/etc \
+ -Dconfdir=/etc/$_name \
+ -Dworkingdir=/etc/$_name \
+ -Dlocalstatedir=/ \
+ -Dlibdir=/usr/lib/$_name \
+ -Dmandir=/usr/share/man \
+ -Ddisable-conio=yes \
+ -Ddynamic-cats-backends=yes \
+ -Ddynamic-storage-backends=yes \
+ -Dpython=yes \
+ -Dopenssl=yes \
+ -Dmysql=no \
+ -Ddisable-rpath=yes \
+ -Dpostgresql=no \
+ -Dsqlite3=yes \
+ -Dndmp=no \
+ -Dhostname='XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX' \
+ -Ddir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
+ -Dfd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
+ -Dsd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
+ -Dmon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
+ -Dmon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
+ -Dmon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
+ -Dbasename="XXX_REPLACE_WITH_LOCAL_HOSTNAME_XXX" \
+ -Dlogdir=/var/log/$_name \
+ -Ddir-user=$_name \
+ -Ddir-group=$_name \
+ -Dsd-user=$_name \
+ -Dsd-group=$_name \
+ -Dfd-user=root \
+ -Dpid-dir=/run/bareos \
+ -Dfd-group=root \
+ -Dconfigtemplatedir=/usr/share/$_name/config \
+ -Dworking-dir=/var/lib/$_name \
+ -Dplugindir=/usr/lib/$_name/plugins \
+ -Dscriptdir=/usr/lib/$_name/scripts \
+ -Dbackenddir=/usr/lib/$_name/backends \
+ -Darchivedir=/var/lib/$_name/storage \
+ -Dbsrdir=/var/lib/$_name \
+ -Dsubsys-dir=/run/$_name \
+ -Dsystemd=no
+
+ make
+ make DESTDIR="$PKG" install
+
+ sed -i '1 a PID Directory = /run/bareos/fd' \
+ "$PKG/usr/share/bareos/config/bareos-fd.d/client/myself.conf"
+
+ # ok, we only want the filedaemon and all it takes to run it
+ rm -rf --one-file-system \
+ "$PKG/bareos-webui" \
+ "$PKG/etc" \
+ "$PKG/usr/local"
+ find "$PKG/usr/bin" -xdev -depth \
+ -not -name "bareos-fd" \
+ \( -type f -o -empty \) \
+ -delete
+
+ install -dm750 "$PKG/etc/bareos"
+ mv \
+ "$PKG/usr/share/bareos/config/bareos-fd.d" \
+ "$PKG/etc/bareos/"
+ rm -rf --one-file-system "$PKG/usr/share/bareos"
+ find "$PKG/usr/share/man" -xdev -depth \
+ -not -name 'bareos-fd.*' \
+ \( -type f -o -empty \) \
+ -delete
+
+ find "$PKG/var" "$PKG/usr/var" -depth \
+ -type d -empty -delete
+
+ new_needed_libs=$(
+ find "$PKG/usr/bin" -type f \
+ -exec ldd {} \; \
+ | sed '
+ s/^\s*\(\S\+\.so\)\(\.[0-9.]\+\)\? => not found$/\1/
+ t
+ d
+ '
+ )
+ while [ -n "$new_needed_libs" ]; do
+ needed_libs=$(
+ printf '%s\n' \
+ ${needed_libs} ${new_needed_libs} \
+ | sort -u
+ )
+ new_needed_libs=$(
+ find "$PKG/usr/lib" \
+ \( \
+ -false \
+ $(
+ printf -- ' -o -name %s\n' ${new_needed_libs}
+ ) \
+ \) \
+ -exec ldd {} \; \
+ | sed '
+ s/^\s*\(\S\+\.so\)\(\.[0-9.]\+\)\? => not found$/\1/
+ t
+ d
+ ' \
+ | grep -vxF "${needed_libs}" || true
+ )
+ done
+
+ find "$PKG/usr/lib" -xdev \
+ -type d -name scripts -prune , \
+ $(
+ find "$PKG/usr/bin" -type f \
+ -exec ldd {} \; \
+ | sed '
+ s/^\s*\(\S\+\.so\)\(\.[0-9.]\+\)\? => not found$/-not -name \1*/
+ t
+ d
+ '
+ ) \
+ -not -type d \
+ -exec rm {} +
+ find "$PKG/usr/lib/bareos/scripts" -xdev \
+ -not -name 'bareos-config*' \
+ \( -not -type d -o -empty \) \
+ -delete
+ find "$PKG/usr/lib" -xdev \
+ -type d \
+ -empty \
+ -delete
+
+ install -Dm755 \
+ "$SRC/check-if-bareos-backup-is-running" \
+ -t "$PKG/usr/bin"
+
+ chmod -R o-rx "$PKG/etc/bareos"
+}
diff --git a/manualPorts/bareos-filedaemon/check-if-bareos-backup-is-running b/manualPorts/bareos-filedaemon/check-if-bareos-backup-is-running
new file mode 100755
index 0000000..e638869
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/check-if-bareos-backup-is-running
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+if [ $# -ne 0 ]; then
+ >&2 echo 'check-if-bareos-backup-is-running: too many arguments'
+ exit 2
+fi
+
+bareos_pid=$(
+ pgrep -xf '(.*/)?bareos-fd' \
+ | head -n1
+)
+
+if [ -z "${bareos_pid}" ]; then
+ >&2 echo 'check-if-bareos-backup-is-running: cannot find running bareos-fd'
+ exit 2
+fi
+
+if ! grep -qxF bareos-fd "/proc/${bareos_pid}/comm"; then
+ >&2 echo 'check-if-bareos-backup-is-running: cannot find running bareos-fd'
+ exit 2
+fi
+
+if [ $(whoami) != 'root' ]; then
+ >&2 echo 'check-if-bareos-backup-is-running: must be run as root'
+ exit 2
+fi
+
+time_out=$((
+ $(date +%s)+30
+))
+was=$(
+ sed '
+ s/^read_bytes: //
+ t
+ d
+ ' "/proc/${bareos_pid}/io"
+)
+while [ $(date +%s) -le ${time_out} ]; do
+ sleep 1
+ if sed '
+ s/^read_bytes: //
+ t
+ d
+ ' "/proc/${bareos_pid}/io" \
+ | grep -qvxF "${was}"; then
+ >&2 echo 'bareos-fd is reading'
+ exit 1
+ fi
+done
+>&2 echo 'bareos-fd is not reading'
diff --git a/manualPorts/bareos-filedaemon/nullify-os-specifics.patch b/manualPorts/bareos-filedaemon/nullify-os-specifics.patch
new file mode 100644
index 0000000..707a01c
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/nullify-os-specifics.patch
@@ -0,0 +1,11 @@
+--- a/core/platforms/CMakeLists.txt 2020-02-03 11:13:07.249578448 +0100
++++ b/core/platforms/CMakeLists.txt 2020-02-03 11:13:07.249578448 +0100
+@@ -31,8 +31,6 @@
+ add_subdirectory(univention)
+ elseif(${DISTNAME} STREQUAL hpux)
+ message(STATUS "DISTNAME: " ${DISTNAME})
+- else()
+- add_subdirectory(${DISTNAME})
+ endif()
+
+ if(${systemd})
diff --git a/manualPorts/bareos-filedaemon/post-install b/manualPorts/bareos-filedaemon/post-install
new file mode 100755
index 0000000..f46d423
--- /dev/null
+++ b/manualPorts/bareos-filedaemon/post-install
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+/usr/lib/bareos/scripts/bareos-config initialize_local_hostname
+/usr/lib/bareos/scripts/bareos-config initialize_passwords
+
+if ! getent group bareos >/dev/null; then
+ groupadd -r bareos
+fi
+
+if ! getent passwd bareos >/dev/null; then
+ useradd -l -r -g bareos bareos
+fi
+
+chown -R bareos:bareos /etc/bareos