diff --git a/ARCH/.SRCINFO b/ARCH/.SRCINFO new file mode 100644 index 0000000..de9d61a --- /dev/null +++ b/ARCH/.SRCINFO @@ -0,0 +1,12 @@ +pkgbase = bareos-scripts + pkgver = 0.0.1 + pkgrel = 1 + url = https://github.com/snuglinux/bareos-scripts + install = bareos-scripts.install + arch = any + license = GPL2 + depends = python2-bareos + source = https://github.com/snuglinux/bareos-scripts/archive/0.0.1.zip + md5sums = 6c306a419c41a8eeaa75744bba00fe73 + +pkgname = bareos-scripts diff --git a/ARCH/PKGBUILD b/ARCH/PKGBUILD new file mode 100644 index 0000000..d3185d3 --- /dev/null +++ b/ARCH/PKGBUILD @@ -0,0 +1,35 @@ +pkgname="bareos-scripts" +pkgver=0.0.1 +pkgrel=1 +arch=('any') +url="https://github.com/snuglinux/${pkgname}" +license=('GPL2') +depends=("python2-bareos") +source=("https://github.com/snuglinux/${pkgname}/archive/${pkgver}.zip") +md5sums=('6c306a419c41a8eeaa75744bba00fe73') +install=${pkgname}.install + +package(){ + cd "$srcdir/${pkgname}-${pkgver}" + + # Create folders + install -d "${pkgdir}/usr/bin" + install -d "${pkgdir}/usr/share/doc/${pkgname}" + install -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -d "${pkgdir}/etc/bareos/" + install -d "${pkgdir}/etc/systemd/system/bareos-incoming-connect@.timer.d" + install -d "${pkgdir}/usr/lib/systemd/system" + + # Copy files + install -m644 bareos-scripts.conf "${pkgdir}"/etc/bareos/bareos-scripts.conf + install -m644 systemd/bareos-incoming-connect@.timer.d/bareos-incoming-connect.conf \ + "${pkgdir}"/etc/systemd/system/bareos-incoming-connect@.timer.d/bareos-incoming-connect.conf + install -m644 systemd/bareos-incoming-connect@.{service,timer} \ + "${pkgdir}"/usr/lib/systemd/system/ + + install -m644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README" + install -Dm 644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -m755 "bareos-incoming-connect" "${pkgdir}/usr/bin" + #sed -e "s/CURRENT_VERSION=0.0.0/CURRENT_VERSION=${pkgver}/" -i "${pkgdir}/usr/bin/${pkgname}" +} + diff --git a/ARCH/bareos-scripts.install b/ARCH/bareos-scripts.install new file mode 100644 index 0000000..1d59f13 --- /dev/null +++ b/ARCH/bareos-scripts.install @@ -0,0 +1,12 @@ +USER=bareos +GROUP=bareos + +pre_install() { + # Create User/Group + getent group ${GROUP} > /dev/null || groupadd --system ${GROUP} + getent passwd ${USER} > /dev/null || useradd --system --gid ${USER} --home-dir /dev/null --shell /sbin/nologin --no-create-home ${USER} +} + +post_install() { + chown -R ${USER}:${GROUP} /etc/bareos/ +} diff --git a/bareos-incoming-connect b/bareos-incoming-connect index caa34d9..143337b 100755 --- a/bareos-incoming-connect +++ b/bareos-incoming-connect @@ -12,7 +12,7 @@ try: except ImportError: import ConfigParser as configparser -dir_conf = '/etc/bareos/bareos-dir.d/' +dir_conf = '/etc/bareos/' file_conf = 'bareos-scripts.conf' def get_job_names(director):