#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/skarnet/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=s6-rc
_pkgver=v0.5.4.1
pkgver=0.5.4.1
pkgrel=01
pkgdesc="A dependency-based init script management system"
url="http://skarnet.org/software/${pkgname}/"
#install=s6-rc.install
makedepends=('git' 'skalibs>=2.13.1.1' 'execline>=2.9.2.0' 's6>=2.11.3.2')
depends=('skalibs>=2.13.1.1' 'execline>=2.9.2.0' 's6>=2.11.3.2')
groups=('base' 's6-suite')
source=("$pkgname::git+git://git.skarnet.org/s6-rc#tag=${_pkgver}")
#_commit=d8c8f84dbb09a87bcdf7764a279f2b02244078ae # refs/tags/v0.5.3.3
#source=("$pkgname::git+git://git.skarnet.org/s6-rc#commit=$_commit")

_pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

build() {
  cd ${srcdir}/${pkgname}
  ./configure --prefix=/usr \
              --bindir=/usr/bin \
              --sbindir=/usr/bin \
              --datadir=/etc \
              --disable-shared \
              --with-lib=/usr/lib/skalibs \
              --with-lib=/usr/lib/execline \
              --with-lib=/usr/lib/s6
  make
}

package() {
  cd ${srcdir}/${pkgname}

  DESTDIR=${pkgdir} make install

  # add doc
  install -dm 0755 $pkgdir/usr/share/doc/$pkgname/
  cp -R doc/* $pkgdir/usr/share/doc/$pkgname/

  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=(ISC)

sha256sums=(SKIP)

##  00b06113c52164441f4f298d59e5df2559746e2339a9cc0eee9f7e8ac50eb4cf  s6-rc-0.5.4.1-01-x86_64.pkg.tar.lz
