# SliTaz package receipt for lxtaz-dash.

PACKAGE="lxtaz-dash"
VERSION="1.0"
CATEGORY="x-window"
SHORT_DESC="Fullscreen GTK3 app menu/launcher for SliTaz LXDE (Super key)."
MAINTAINER="pankso@slitaz.org"
LICENSE="BSD"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://www.slitaz.org/"
WGET_URL="https://www.slitaz.org/sources/packages/l/$TARBALL"

DEPENDS="gtk+3 xorg-libXtst"
BUILD_DEPENDS="gtk+3-dev xorg-libXtst-dev pkg-config gettext-tools"

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

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/bin $fs/usr/share/applications $fs/etc/xdg/autostart
	mkdir -p $fs/usr/share/icons/hicolor/scalable/apps
	cp -a $src/src/lxtaz-dash			$fs/usr/bin
	cp -a $src/data/lxtaz-dash.desktop		$fs/usr/share/applications
	cp -a $src/data/lxtaz-dash-daemon.desktop	$fs/etc/xdg/autostart
	cp -a $src/data/icons/hicolor/scalable/apps/lxtaz-dash.svg \
 							$fs/usr/share/icons/hicolor/scalable/apps
	# Raster fallbacks (lxpanel/GTK2 renders SVG black, same as lxtaz-ctrl)
	for s in 22 24 32 48; do
		mkdir -p $fs/usr/share/icons/hicolor/${s}x${s}/apps
		cp -a $src/data/icons/hicolor/${s}x${s}/apps/lxtaz-dash.png \
							$fs/usr/share/icons/hicolor/${s}x${s}/apps
	done
	# Openbox fallback keybind: Super_L -> lxtaz-dash --toggle
	mkdir -p $fs/usr/share/lxtaz-dash
	cp -a $src/data/openbox-rc-snippet.xml		$fs/usr/share/lxtaz-dash
	cp -a $src/stuff/lxtaz-dash-openbox-setup	$fs/usr/bin
	chmod +x $fs/usr/bin/lxtaz-dash-openbox-setup
	# Compiled translations (po/LINGUAS drives the language list)
	make -C $src/po install DESTDIR=$fs PREFIX=/usr
}

post_install()
{
	gtk-update-icon-cache -q -t -f usr/share/icons/hicolor 2>/dev/null
	true
}
