# Obarun        : 66 init/supervisor
# Maintainer    : Eric Vidal <eric@obarun.org>
# Maintainer    : Jean-Michel T.Dydak <jean-michel@obarun.org>
# Source        : url="https://git.obarun.org/pkg/obcore/s6-linux-utils.git"
#-----------------------------------------------------------------------

pkgdesc="A set of tiny Linux-specific utilities"

pkgname=s6-linux-utils

pkgver=2.5.1.6
pkgrel=1

url="http://skarnet.org/software/${pkgname}/"

track=tag
target="v${pkgver}"
source=(
    "$pkgname::git+git://git.skarnet.org/s6-linux-utils#${track}=${target}"
)

#------------------------------BUILD PREPARATION------------------------

makedepends=(
    'git'
    'skalibs>=2.11.0.0'
)
#pkgver() {
#  cd $pkgbase
#  git describe --tags | sed 's/-/+/g'
#}

#------------------------------BUILD------------------------------------

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

#------------------------------PACKAGE----------------------------------

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"

}

#------------------------------INSTALL CONFIGURATION--------------------

arch=(x86_64)

depends=(
    'skalibs>=2.11.0.0'
)

groups=(
    'base'
    's6-suite'
)

#-------------------------------SECURITY AND LICENCE--------------------

sha256sums=('SKIP')
license=('ISC')
