# SliTaz package receipt.

PACKED_SIZE="32.0K"
UNPACKED_SIZE="112.0K"
PACKAGE="attr"
VERSION="2.5.1"
CATEGORY="system-tools"
SHORT_DESC="Commands for manipulating Filesystem Extended Attributes."
MAINTAINER="rcx@zoominternet.net"
LICENSE="GPL2"
WEB_SITE="https://savannah.nongnu.org/projects/attr/"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://download.savannah.gnu.org/releases/$PACKAGE/$TARBALL"

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

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

current_version()
{
	wget -O - http://download.savannah.nongnu.org/releases/attr/ 2>/dev/null | \
	sed '/href="attr/!d;s|.*attr-\([0-9\.]*\)\..*|\1|' | sed '$!d'
}

# Rules to configure and make the package.
compile_rules()
{
	# Need bash sh to compile
	mv /bin/sh /bin/sh.bak
	ln -s /bin/bash /bin/sh

	# No need to use rpm
	rm /bin/rpm

	export	INSTALL_USER=root
	export	INSTALL_GROUP=root

	./configure $CONFIGURE_ARGS &&
	make &&
	make install install-lib install-dev DIST_ROOT=$DESTDIR
	
	mv -f /bin/sh.bak /bin/sh
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	cook_copy_folders	bin
	cook_copy_files		*.so*

	find $fs -type f -name '*.so*' -exec chmod a+x \{\} \;
}
