# SliTaz package receipt.

PACKED_SIZE="88.0K"
UNPACKED_SIZE="332.0K"
PACKAGE="acl"
VERSION="2.2.51"
CATEGORY="system-tools"
SHORT_DESC="Commands for Manipulating POSIX Access Control Lists."
MAINTAINER="rcx@zoominternet.net"
LICENSE="LGPL2.1 GPL2"
WEB_SITE="http://savannah.nongnu.org/projects/acl/"
TARBALL="$PACKAGE-$VERSION.src.tar.gz"
WGET_URL="http://download.savannah.gnu.org/releases/$PACKAGE/$TARBALL"
HOST_ARCH="i486 arm"

DEPENDS="attr"
BUILD_DEPENDS="attr-dev bash libtool"

# Handle cross compilation.
case "$ARCH" in
	arm) BUILD_DEPENDS="attr-dev" ;;
esac

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

	{
		INSTALL_USER=root  \
		INSTALL_GROUP=root \
		./configure \
			--prefix=/usr \
			--libdir=/lib \
			--libexecdir=/usr/lib \
			$CONFIGURE_ARGS &&
		make &&
		DIST_ROOT=$DESTDIR \
		make install install-lib install-dev
	} || {
		mv -f /bin/sh.bak /bin/sh; return 1
	}

	mv -f /bin/sh.bak /bin/sh
	# .so and .la files must be executable
	find $install -type f -name '*.[sl][oa]*' -exec chmod a+x \{\} \;
	sed -i "s|libdir='/lib'|libdir='/usr/lib'|" $install/usr/lib/libacl.la
}

# 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
}
