# SliTaz package receipt.

PACKED_SIZE="28.0K"
UNPACKED_SIZE="76.0K"
PACKAGE="pkg-config"
VERSION="0.28"
CATEGORY="development"
SHORT_DESC="Free desktop packages manager."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://pkgconfig.freedesktop.org/wiki/"
WGET_URL="http://pkgconfig.freedesktop.org/releases/$TARBALL"
#HOST_ARCH="i486 arm"

DEPENDS="glibc-base"
BUILD_DEPENDS="gcc libtool"

# Handle cross compilation.
case "$ARCH" in
	arm) BUILD_DEPENDS="" ;;
esac

# Rules to configure and make the package.
compile_rules()
{
	patch -p1 < $stuff/autoconf-2.66.patch
	case "$ARCH" in
		arm)
			./configure \
				--program-prefix=$TOOLPREFIX \
				--build=i486-slitaz-linux \
				--host=arm-slitaz-linux-gnueabi \
				--cache-file=arm-linux.cache ;;
		*)
			./configure \
				--program-prefix=$TOOLPREFIX \
				--build=$HOST_SYSTEM \
				--host=$HOST_SYSTEM 2>&1 | \
				grep -v './libtool: No such file' ;;
	esac &&
	make && make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share
	cp -a $install/usr/bin $fs/usr
	cp -a $install/usr/share/aclocal $fs/usr/share
	# This is the default pkg-config so make a symling for package that dont
	# cross compile or search for /usr/bin/pkg-config.
	cd $fs/usr/bin && ln -s ${TOOLPREFIX}pkg-config pkg-config
}
