| 1 |
radhermit |
1.1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
|
|
# $Header: $
|
| 4 |
|
|
|
| 5 |
|
|
EAPI=4
|
| 6 |
|
|
|
| 7 |
|
|
inherit flag-o-matic
|
| 8 |
|
|
|
| 9 |
|
|
DESCRIPTION="A general-purpose (yacc-compatible) parser generator"
|
| 10 |
|
|
HOMEPAGE="http://www.gnu.org/software/bison/"
|
| 11 |
|
|
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
|
| 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 |
|
|
sys-devel/flex
|
| 21 |
|
|
nls? ( sys-devel/gettext )"
|
| 22 |
|
|
|
| 23 |
|
|
DOCS="AUTHORS ChangeLog-2012 NEWS README THANKS TODO" # ChangeLog-1998 PACKAGING README-alpha README-release
|
| 24 |
|
|
|
| 25 |
|
|
src_configure() {
|
| 26 |
|
|
use static && append-ldflags -static
|
| 27 |
|
|
|
| 28 |
|
|
econf \
|
| 29 |
|
|
--disable-silent-rules \
|
| 30 |
|
|
$(use_enable nls)
|
| 31 |
|
|
}
|
| 32 |
|
|
|
| 33 |
|
|
src_install() {
|
| 34 |
|
|
default
|
| 35 |
|
|
|
| 36 |
|
|
# This one is installed by dev-util/yacc
|
| 37 |
|
|
mv -v "${ED}"/usr/bin/yacc{,.bison} || die
|
| 38 |
|
|
mv -v "${ED}"/usr/share/man/man1/yacc{,.bison}.1 || die
|
| 39 |
|
|
|
| 40 |
|
|
# We do not need liby.a
|
| 41 |
|
|
rm -r "${ED}"/usr/lib* || die
|
| 42 |
|
|
|
| 43 |
|
|
# Move to documentation directory and leave compressing for EAPI>=4
|
| 44 |
|
|
mv -v "${ED}"/usr/share/${PN}/README "${ED}"/usr/share/doc/${PF}/README.data
|
| 45 |
|
|
}
|
| 46 |
|
|
|
| 47 |
|
|
pkg_postinst() {
|
| 48 |
|
|
local f="${EROOT}/usr/bin/yacc"
|
| 49 |
|
|
if [[ ! -e ${f} ]] ; then
|
| 50 |
|
|
ln -s yacc.bison "${f}"
|
| 51 |
|
|
fi
|
| 52 |
|
|
}
|
| 53 |
|
|
|
| 54 |
|
|
pkg_postrm() {
|
| 55 |
|
|
# clean up the dead symlink when we get unmerged #377469
|
| 56 |
|
|
local f="${EROOT}/usr/bin/yacc"
|
| 57 |
|
|
if [[ -L ${f} && ! -e ${f} ]] ; then
|
| 58 |
|
|
rm -f "${f}"
|
| 59 |
|
|
fi
|
| 60 |
|
|
}
|