# SliTaz package receipt.

ORIGIN="lxsession"
PACKED_SIZE="44.0K"
UNPACKED_SIZE="144.0K"
PACKAGE="lxsession046"
VERSION="0.4.6.1"
CATEGORY="x-window"
SHORT_DESC="LXDE X session manager."
MAINTAINER="devel@slitaz.org"
LICENSE="GPL2"
WEB_SITE="https://www.lxde.org/"
TARBALL="$ORIGIN-$VERSION.tar.gz"
WGET_URL="$SF_MIRROR/lxde/$TARBALL"
HOST_ARCH="i486 arm"
PROVIDE="lxsession"

DEPENDS="gtk+ dbus"
BUILD_DEPENDS="gtk+-dev dbus-dev intltool"

# What is the latest version available today?
current_version()
{
	wget -O - https://sourceforge.net/projects/lxde/files/LXSession%20%28session%20manager%29/ 2>/dev/null | \
	sed '/scope="row/!d;/0.4.6/!d;s|.*a href="|"https://sourceforge.net|;s| .*||;q' | xargs wget -O - 2>/dev/null | \
	sed "/$ORIGIN-/!d;s|.*$ORIGIN-\\(.*\\).tar.*\".*|\\1|;q"
}

# Rules to configure and make the package.
compile_rules()
{
	./configure \
		--sysconfdir=/etc \
		$CONFIGURE_ARGS &&
	make && make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share $fs/etc/xdg/lxsession/LXDE
	cp -a $install/usr/bin $fs/usr
	cp -a $install/usr/share/lxsession $fs/usr/share
	# Use SliTaz Icon them for lxsession-logout
	cp -a $stuff/desktop.conf $fs/etc/xdg/lxsession/LXDE
	chown -R 0.0 $fs
}
