# Contributor: John Regan <john@jrjrtech.com>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=execline
pkgver=2.9.6.0
pkgrel=0
pkgdesc="A small scripting language, to be used in place of a shell in non-interactive scripts."
url=https://skarnet.org/software/execline/
arch="all"
license="ISC"
options="!check"
makedepends="skalibs-dev>=2.14"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/execline/execline-$pkgver.tar.gz"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--libdir=/usr/lib \
		--with-dynlib=/lib \
		--enable-multicall
	make
}

package() {
	make DESTDIR="$pkgdir" install
	# Compat symlink for #!/usr/bin/execlineb shebangs, remove if usrmerge
	mkdir -p "$pkgdir/usr/bin"
	ln -s ../../bin/execlineb "$pkgdir/usr/bin/execlineb"
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

static() {
	default_static
	rmdir -p "$pkgdir"/usr/lib || :
}

sha512sums="
1c5233b0f17b4c92ab2e9e8700b47c8429ad97962bcb7c83190d0b3251b26584e591d77418eca77e8112cdecd24eec50aaca7da1dbb506120931bbda39f2b7cb  execline-2.9.6.0.tar.gz
"
