Receipt for: sysbench

source
# SliTaz package receipt.

PACKAGE="sysbench"
VERSION="1.0.20"
CATEGORY="misc"
SHORT_DESC="A modular, cross-platform and multi-threaded benchmark tool."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://github.com/akopytov/sysbench"
WGET_URL="https://github.com/akopytov/sysbench/archive/refs/tags/$VERSION.tar.gz"

DEPENDS="libmysqlclient libssl zlib"
BUILD_DEPENDS="git automake autoconf libtool mysql-dev openssl-dev zlib-dev"

# What is the latest version available today?
current_version()
{
	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
	sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
	mkdir src/gcc third_party/concurrency_kit/lib third_party/luajit/lib
	./autogen.sh
	./configure --prefix=/usr $CONFIGURE_ARGS

	# generate *.h ..
	make -k 2>&1 | grep -v 'No such file' | grep -v Error
	find . -type d | grep -v tmp > dirs
	while read dir; do  cp -au third_party/concurrency_kit/tmp/ck/include/*.h third_party/concurrency_kit/tmp/ck/include/*/ $dir ; done < dirs

	# generate *.a
	make -k DESTDIR=$DESTDIR install 2>&1 | grep -v 'No such file' | grep -v Error
	find $install -name libck.a -print -exec cp {} third_party/concurrency_kit/lib/ \;
	find $install -name libluajit-5.1.a -print -exec cp {} third_party/luajit/lib/ \;

	make DESTDIR=$DESTDIR install

	# dirty fix for install paths...
	cp -a $install/home/slitaz/wok/sysbench/source/sysbench-1.0.20/third_party/luajit/* $install/usr
	rm -rf $install/home
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr
	cp -a $install/usr/* $fs/usr
}