# SliTaz package receipt.

PACKED_SIZE="56.0K"
UNPACKED_SIZE="176.0K"
PACKAGE="attr"
VERSION="2.4.46"
CATEGORY="system-tools"
SHORT_DESC="Commands for Manipulating Filesystem Extended Attributes."
MAINTAINER="rcx@zoominternet.net"
LICENSE="GPL2"
WEB_SITE="http://savannah.nongnu.org/projects/attr/"
TARBALL="${PACKAGE}-${VERSION}.src.tar.gz"
WGET_URL="http://download.savannah.gnu.org/releases-noredirect/$PACKAGE/$TARBALL"
HOST_ARCH="i486 arm"

DEPENDS="glibc-base"
BUILD_DEPENDS="autoconf automake m4 libtool gettext"

# When cross compiling auto-tools, gettext and m4 build system are used.
case "$ARCH" in
	arm) BUILD_DEPENDS="" ;;
esac

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

	# Need bash sh to compile
	mv /bin/sh /bin/sh.bak
	ln -s /bin/bash /bin/sh

	# Configure is included in Makefile
	{ make LOCAL_CONFIGURE_OPTIONS="$CONFIGURE_ARGS" &&
	make install install-lib install-dev DIST_ROOT=$DESTDIR
	} || { mv -f /bin/sh.bak /bin/sh; return 1; }

	mv -f /bin/sh.bak /bin/sh
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/lib $fs/usr/lib
	cp -a $install/lib/*.so* $fs/lib
	cp -a $install/usr/lib/*.so* $fs/usr/lib
	cp -a $install/usr/bin $fs/usr
	find $fs -type f -name '*.so*' -exec chmod a+x \{\} \;
	# Fix /usr/lib/libattr.so
	cd $fs/usr/lib
	rm libattr.so && ln -s ../../lib/libattr.so
}
