| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-devel/bison/bison-2.5.ebuild,v 1.5 2012/04/26 12:58:13 aballier Exp $ |
| 4 |
|
| 5 |
EAPI="2" |
| 6 |
|
| 7 |
inherit eutils flag-o-matic |
| 8 |
|
| 9 |
DESCRIPTION="A yacc-compatible parser generator" |
| 10 |
HOMEPAGE="http://www.gnu.org/software/bison/bison.html" |
| 11 |
SRC_URI="mirror://gnu/bison/${P}.tar.bz2" |
| 12 |
|
| 13 |
LICENSE="GPL-2" |
| 14 |
SLOT="0" |
| 15 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
| 16 |
IUSE="nls static" |
| 17 |
|
| 18 |
RDEPEND=">=sys-devel/m4-1.4.16" |
| 19 |
DEPEND="${RDEPEND} |
| 20 |
nls? ( sys-devel/gettext )" |
| 21 |
|
| 22 |
src_configure() { |
| 23 |
use static && append-ldflags -static |
| 24 |
econf $(use_enable nls) |
| 25 |
} |
| 26 |
|
| 27 |
src_install() { |
| 28 |
emake DESTDIR="${D}" install || die |
| 29 |
|
| 30 |
# This one is installed by dev-util/yacc |
| 31 |
mv "${D}"/usr/bin/yacc{,.bison} || die |
| 32 |
mv "${D}"/usr/share/man/man1/yacc{,.bison}.1 || die |
| 33 |
|
| 34 |
# We do not need this. |
| 35 |
rm -r "${D}"/usr/lib* || die |
| 36 |
|
| 37 |
dodoc AUTHORS NEWS ChangeLog README OChangeLog THANKS TODO |
| 38 |
} |
| 39 |
|
| 40 |
pkg_postinst() { |
| 41 |
local f="${ROOT}/usr/bin/yacc" |
| 42 |
if [[ ! -e ${f} ]] ; then |
| 43 |
ln -s yacc.bison "${f}" |
| 44 |
fi |
| 45 |
} |
| 46 |
|
| 47 |
pkg_postrm() { |
| 48 |
# clean up the dead symlink when we get unmerged #377469 |
| 49 |
local f="${ROOT}/usr/bin/yacc" |
| 50 |
if [[ -L ${f} && ! -e ${f} ]] ; then |
| 51 |
rm -f "${f}" |
| 52 |
fi |
| 53 |
} |