# Distribution  : Obarun S6/66
#-----------------------------
# Maintainer    : Eric Vidal <eric@obarun.org>
# Maintainer    : Jean-Michel T.Dydak <jean-michel@obarun.org>
#----------------
# Obarun PkgSrc : https://git.obarun.org/pkg/obcore/66-tools
#--------------------------------------------------------------------------------
# DESCRIPTION ]

pkgname=66-tools
pkgver=0.0.8.0
pkgrel=1
pkgdesc="small tools and helpers for service scripts execution"

url='https://framagit.org/Obarun/66-tools.git'

track="tag"
target="v$pkgver"
source=(
    "${pkgname}::git+${url}#${track}=${target}"
)

#----------------------
# BUILD CONFIGURATION ]

makedepends=(
    'git'
    'skalibs>=2.11.0.0'
    'execline>=2.8.1.0'
    'oblibs>=0.1.4.0'
    'lowdown'
)

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

depends=(
    'skalibs>=2.11.0.0'
    'execline>=2.8.1.0'
    'oblibs>=0.1.4.0'
)

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

#----------------
# BUILD CONTROL ]

_flags=(
    --bindir=/usr/bin
    --with-lib=/usr/lib/skalibs
    --with-lib=/usr/lib/execline
    --with-lib=/usr/lib/oblibs
    --with-ns-rule=/usr/lib/66/script/ns
    --disable-shared
)

#--------
# BUILD ]

build() {
    cd $pkgname

    ./configure "${_flags[@]}"
    make
}

#----------
# PACKAGE ]

package() {
    cd $pkgname

    make DESTDIR="$pkgdir" install install-ns-rule

    install -Dm 0644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

#--------------------
# ARCH LICENSE AUTH ]

arch=(x86_64)
license=(ISC)

sha512sums=('')
