# SliTaz package receipt.

PACKED_SIZE="68.0K"
UNPACKED_SIZE="452.0K"
PACKAGE="galculator"
VERSION="2.1.3"
CATEGORY="system-tools"
SHORT_DESC="Graphical scientific calculator."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL2"
WEB_SITE="http://galculator.sourceforge.net/"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
HOST_ARCH="i486 arm"
GENERIC_PIXMAPS="no"; GENERIC_MENUS="no"

DEPENDS="gtk+"
BUILD_DEPENDS="gtk+-dev flex sdft"

# Rules to configure and make the package.
compile_rules()
{
	# Binutils 2.22 break many packages build without LDFLAGS set correctly.
	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"

	./configure \
		--disable-gtk3 \
		--disable-quadmath \
		$CONFIGURE_ARGS &&
	make && make install
	sdft $install/usr/share/applications/galculator.desktop -i -tf \
		-a "Name[fr]=Calculatrice scientifique" \
		-a "Name[pt]=Calculadora Científica" \
		-a "Name[pt_BR]=Calculadora Científica" \
		-a "Name[ru]=Инженерный калькулятор" \
		-a "Name[zh_CN]=科学计算器" \
		-a "Comment[ru]=Выполняйте простые и инженерные вычисления" \
		-s "Icon=accessories-calculator" \
		-s "Categories=Utility;Calculator;"
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share/icons/hicolor/48x48

	cp -a $install/usr/bin $fs/usr

	cp -a $install/usr/share/galculator $fs/usr/share
	find $fs/usr/share/galculator -name '*gtk3*' -delete
	sed -i 's|^[ ]*||g' $fs/usr/share/galculator/ui/*

	cp -a $install/usr/share/icons/hicolor/48x48/apps $fs/usr/share/icons/hicolor/48x48

	cp -a $install/usr/share/applications $fs/usr/share
}
