NAME=zsh
VERSION=4.3.2
SOURCE=ftp://sunsite.auc.dk/pub/unix/shells/zsh/$NAME-$VERSION.tar.gz
BUILD=${BUILD:-1}
OPTIMIZE=${OPTIMIZE:-"-Os -pipe"}

build() {
	_explode 0
	cd "$NAME-$VERSION"
	$CONFIGURE \
	--enable-multibyte
	make
	make install DESTDIR=$PKG

	if [ "$PREFIX" = "/usr" ]; then
		mkdir -p $PKG/bin
		mv $PKG$BINDIR/zsh $PKG/bin/zsh
		ln -s /bin/zsh $PKG$BINDIR/zsh
	fi

	_doc 0 $NAME-$VERSION ChangeLog INSTALL LICENSE FEATURES

		cat << "EOF" > $PKG/install/doinst.sh
if [ ! -r etc/shells ]; then
	touch etc/shells
	chmod 644 etc/shells
fi
if fgrep "/bin/zsh" etc/shells 1> /dev/null 2> /dev/null ; then
	true
else
	echo "/bin/zsh" >> etc/shells
fi
EOF

	_chfix
	_chgrp_bin
}
