# SliTaz package receipt.

PACKED_SIZE="156.0K"
UNPACKED_SIZE="436.0K"
PACKAGE="xterm"
VERSION="314"
CATEGORY="utilities"
SHORT_DESC="X terminal emulator"
MAINTAINER="pankso@slitaz.org"
LICENSE="MIT"
TARBALL="$PACKAGE-$VERSION.tgz"
WEB_SITE="http://invisible-island.net/xterm/"
WGET_URL="ftp://invisible-island.net/$PACKAGE/$TARBALL"
GENERIC_PIXMAPS="no"
TAGS="terminal"
HOST_ARCH="i486 arm"

DEPENDS="expat fontconfig freetype ncurses xorg-libXft xorg-libXt \
xorg-libXaw3d xorg-libXpm"
BUILD_DEPENDS="expat-dev fontconfig-dev freetype-dev ncurses-dev \
xorg-libXft-dev xorg-libXt-dev xorg-libXaw3d-dev"

# Rules to configure and make the package.
compile_rules()
{
	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-Xaw3d \
		--with-app-defaults=/usr/share/X11/app-defaults \
		--enable-wide-chars \
		--enable-freetype \
		--enable-doublechars \
		--enable-256-color \
		--enable-meta-sends-esc \
		--disable-delete-is-del \
		--disable-sun-fkeys \
		--disable-boxchars \
		--disable-desktop \
		--disable-tek4014 \
		--disable-vt52 \
		--disable-luit \
		--disable-rectangles \
		--with-icon-symlink \
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	cp -a $install/* $fs
	find $fs -regex '.*\(2.\|U\|I\|8r\|ux\|man\).*' -delete
	rm -rf $fs/usr/share/pixmaps
	ln -s xterm $fs/usr/bin/uxterm
	cat >> $fs/usr/share/X11/app-defaults/XTerm <<EOT
!
!	libXaw3d  options
xterm*beNiceToColormap: false
xterm*SmeBSB.shadowWidth:  3
xterm*topShadowContrast: 20
xterm*bottomShadowContrast: 50
EOT
	chown -R root:root $fs	
}

# One of the first X apps cross compiled. Be sure all went well
testsuite()
{
	readelf -h $install/usr/bin/xterm
}
