Skip to content

Commit

Permalink
add PKGBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
khvalera committed May 31, 2022
1 parent 446bcd0 commit c0874ee
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
12 changes: 12 additions & 0 deletions ARCH/.SRCINFO
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions ARCH/PKGBUILD
Original file line number Diff line number Diff line change
@@ -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/[email protected]"
install -d "${pkgdir}/usr/lib/systemd/system"

# Copy files
install -m644 bareos-scripts.conf "${pkgdir}"/etc/bareos/bareos-scripts.conf
install -m644 systemd/[email protected]/bareos-incoming-connect.conf \
"${pkgdir}"/etc/systemd/system/[email protected]/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}"
}

12 changes: 12 additions & 0 deletions ARCH/bareos-scripts.install
Original file line number Diff line number Diff line change
@@ -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/
}
2 changes: 1 addition & 1 deletion bareos-incoming-connect
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c0874ee

Please sign in to comment.