# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit toolchain-funcs DESCRIPTION="A portable version of the OpenSolaris Bourne Shell" HOMEPAGE="http://heirloom.sourceforge.net/sh.html" SRC_URI="mirror://sourceforge/heirloom/${P}.tar.bz2" LICENSE="" SLOT="0" KEYWORDS="~x86" IUSE="spell" DEPEND="" RDEPEND="${DEPEND}" src_compile() { # Don't strip during the install, let portage handle that sed -i -e "/STRIP/d" makefile use spell && myopts="${myopts} SPELL=-DSPELL" emake \ CC=$(tc-getCC) \ CFLAGS="${CFLAGS}" \ ${myopts} \ || die "emake failed" } src_install() { emake \ SV3BIN=/bin \ MANDIR=/usr/share/man \ UCBINST=/usr/bin/install \ ROOT="${D}" \ install || die "emake install failed" dodoc CHANGES README || die "dodoc failed" mv "${D}"/bin/sh "${D}"/bin/jsh || die "Moving exe to jsh failed" } pkg_preinst() { # If /bin/sh does not exist or is jsh, then provide it # Otherwise leave it alone if [[ ! -e ${ROOT}/bin/sh ]] ; then ln -s jsh "${ROOT}"/bin/sh elif [[ -L ${ROOT}/bin/sh ]] ; then case $(readlink "${ROOT}"/bin/sh) in jsh|/bin/jsh) cp -pPR "${ROOT}"/bin/sh "${D}"/bin/ ;; esac fi }