# SliTaz package receipt.

PACKED_SIZE="44.0K"
UNPACKED_SIZE="144.0K"
PACKAGE="gamin"
VERSION="0.1.10"
CATEGORY="system-tools"
SHORT_DESC="File and directory monitoring system."
MAINTAINER="pankso@slitaz.org"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://www.gnome.org/~veillard/gamin/"
WGET_URL="http://www.gnome.org/~veillard/gamin/sources/$TARBALL"
CROSS="error: cannot run test program while cross compiling"

DEPENDS="glib"
BUILD_DEPENDS="pkg-config glib glib-dev gtk+-dev"

# Rules to configure and make the package.
compile_rules()
{
	cd $src

	# Don't use deprecated G_CONST_RETURN. Fixes building with newer glib versions.
	# (gamin v0.1.10)
	cd server
	sed 's/^G_CONST_RETURN/const/'\
		-i gam_node.c gam_node.h gam_subscription.c gam_subscription.h \
		|| return 1
	cd ..

	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libexecdir=/usr/lib/gamin \
		--build=$HOST_SYSTEM \
		--host=$HOST_SYSTEM &&
	make &&
	mkdir -p $DESTDIR/usr/include &&
	make -j1 DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib
	cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
	cp -a $_pkg/usr/lib/$PACKAGE $fs/usr/lib
	strip -s $fs/usr/lib/$PACKAGE/*
}
