Receipt for: attr

source
# SliTaz package receipt.

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 x86_64"

# 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 as /bin/sh to compile (busybox sh choke sur le configure).
	cp -a /bin/sh /bin/sh.bak
	ln -sf /bin/bash /bin/sh

	{
		INSTALL_USER=root		\
		INSTALL_GROUP=root		\
		./configure 			\
		    $CONFIGURE_ARGS &&
		make &&
		# attr 2.5.1 : autotools standard, les targets install-lib /
		# install-dev n'existent plus (headers via install-data-local,
		# déjà dans `make install`).
		make install DIST_ROOT=$DESTDIR
	} || {
		cp -a /bin/sh.bak /bin/sh
		return 1
	}

	cp -a /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 \{\} \;
}