# SliTaz package receipt.

PACKED_SIZE="24.0K"
UNPACKED_SIZE="84.0K"
PACKAGE="lxinput"
VERSION="0.3.5"
CATEGORY="x-window"
TAGS="LXDE keyboard mouse"
SHORT_DESC="LXDE keyboard and mouse configuration."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL3"
WEB_SITE="https://lxde.org"

TARBALL="$PACKAGE-$VERSION.tar.xz"
WGET_URL="$SF_MIRROR/lxde/$TARBALL"

DEPENDS="gtk+ xorg-xset"
BUILD_DEPENDS="gtk+-dev"
GENERIC_MENUS="no"

HOST_ARCH="i486 arm"

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

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

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	cp -a $install/* $fs

	rm -r $fs/usr/share/locale
	rm -r $fs/usr/share/man
	rm -r $fs/usr/share/lxinput/*.png

	sed -i 's|^Icon=.*$|Icon=preferences-desktop-keyboard|' \
		$fs/usr/share/applications/lxinput.desktop
}
