# 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 jansson libcap lzo openssl postgresql python readline sqlite3 zlib name=bareos-filedaemon _name=${name%-*} version=23.1.1 release=1 source=("https://github.com/$_name/$_name/archive/Release/$version.tar.gz" 'nullify-os-specifics.patch' 'check-if-bareos-backup-is-running' 'bareos-fd') 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 \ -Ddisable-rpath=yes \ -Dpostgresql=no \ -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 new_needed_libs=$( find "$PKG/usr/bin" -type f \ -exec objdump -x {} \; \ | sed ' s/^\s*NEEDED\s\+\(\S\+\.so\)\(\.[0-9.]\+\)\?$/\1/ t d ' \ | sort -u ) 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 objdump -x {} \; \ | sed ' s/^\s*NEEDED\s\+\(\S\+\.so\)\(\.[0-9.]\+\)\?$/\1/ t d ' \ | grep -vxF "${needed_libs}" \ | sort -u ) done find "$PKG/usr/lib" -xdev \ -type d -name scripts -prune , \ $( printf -- ' -not -name %s*\n' ${needed_libs} ) \ -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" \ "$PKG/var" \ -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" install -Dm755 \ "$SRC/bareos-fd" \ -t "$PKG/etc/rc.d" }