# SliTaz package receipt.

PACKAGE="matchbox-common"
VERSION="0.9.1"
CATEGORY="x-window"
SHORT_DESC="Common files for matchbox window manager."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.bz2"
WEB_SITE="http://matchbox-project.org/"
WGET_URL="http://downloads.yoctoproject.org/releases/matchbox/$PACKAGE/${VERSION%.*}/$TARBALL"

DEPENDS="gtk+ libmatchbox"
BUILD_DEPENDS="gtk+-dev libmatchbox-dev"

# What is the latest version available today?
current_version()
{
	wget -O - http://mirrors.kernel.org/yocto/matchbox/matchbox-common/$( \
	wget -O - http://mirrors.kernel.org/yocto/matchbox/matchbox-common/ 2>/dev/null | \
	sed '/href="[0-9]/!d;s|.*="||;s|/.*||' | sort -Vr | sed q)/ 2>/dev/null | \
	sed '/href="matchbox-common-[0-9]/!d;s|.*="matchbox-common-||;s|.tar.*||' | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
	./configure $CONFIGURE_ARGS &&
	make && make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/bin
	cp -a $install/usr/share $fs/usr
	cp -a $stuff/matchbox-session $fs/usr/bin
	# For matchbox v2
	#cp -a $stuff/matchbox-session-2 $fs/usr/bin
}