# SliTaz package receipt.

PACKAGE="gc"
VERSION="7.2g"
CATEGORY="development"
SHORT_DESC="A garbage collector for C and C++."
MAINTAINER="pankso@slitaz.org"
LICENSE="MIT GPL"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://github.com/ivmai/bdwgc"
WGET_URL="http://www.hboehm.info/gc/gc_source/$TARBALL"
HOST_ARCH="i486 arm"

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

# Rules to configure and make the package.
compile_rules()
{
	./configure \
		--enable-cplusplus \
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install &&
	# libatomic_ops
	cd $src/libatomic_ops &&
	./configure \
		--prefix=/usr \
		--disable-static \
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

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