# SliTaz package receipt.

PACKAGE="procps"
VERSION="3.2.8"
CATEGORY="utilities"
SHORT_DESC="The proc filesystem utilities."
MAINTAINER="paul@slitaz.org"
DEPENDS="ncurses"
BUILD_DEPENDS="ncurses-dev"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://procps.sourceforge.net/"
WGET_URL="http://procps.sourceforge.net/$TARBALL"

# Rules to configure and make the package.
compile_rules()
{
	cd $src
	patch -Np1 -i $stuff/$PACKAGE-$VERSION+gmake-3.82.patch
	make && make -j1 install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr 
	cp -a $_pkg/usr/bin $fs/usr
	cp -a $_pkg/bin $fs
	cp -a $_pkg/sbin $fs
	cp -a $_pkg/lib $fs
}

# Overlap busybox
pre_install()
{
	rm -f $1/bin/kill
	rm -f $1/bin/ps
	rm -f $1/bin/watch
	rm -f $1/sbin/sysctl
	rm -f $1/usr/bin/pkill
	rm -f $1/usr/bin/pmap
	rm -f $1/usr/bin/pgrep
	rm -f $1/usr/bin/top
	rm -f $1/usr/bin/free
	rm -f $1/usr/bin/uptime
}

post_remove()
{
	ln -s /bin/busybox /bin/kill
	ln -s /bin/busybox /bin/ps
	ln -s /bin/busybox /bin/watch
	ln -s /bin/busybox /sbin/sysctl	
	ln -s /bin/busybox /usr/bin/pkill
	ln -s /bin/busybox /usr/bin/pmap
	ln -s /bin/busybox /usr/bin/pgrep
	ln -s /bin/busybox /usr/bin/top
	ln -s /bin/busybox /usr/bin/free
	ln -s /bin/busybox /usr/bin/uptime
}