| 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/gettext/gettext-0.18.1.1-r2.ebuild,v 1.5 2012/06/05 03:46:34 vapier Exp $ |
| 4 |
|
| 5 |
EAPI="2" |
| 6 |
|
| 7 |
inherit flag-o-matic eutils multilib toolchain-funcs mono libtool java-pkg-opt-2 |
| 8 |
|
| 9 |
DESCRIPTION="GNU locale utilities" |
| 10 |
HOMEPAGE="http://www.gnu.org/software/gettext/" |
| 11 |
SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" |
| 12 |
|
| 13 |
LICENSE="GPL-3 LGPL-2" |
| 14 |
SLOT="0" |
| 15 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" |
| 16 |
IUSE="acl doc emacs git java nls +cxx openmp elibc_glibc" |
| 17 |
|
| 18 |
DEPEND="virtual/libiconv |
| 19 |
dev-libs/libxml2 |
| 20 |
sys-libs/ncurses |
| 21 |
dev-libs/expat |
| 22 |
acl? ( virtual/acl ) |
| 23 |
java? ( >=virtual/jdk-1.4 )" |
| 24 |
RDEPEND="${DEPEND} |
| 25 |
git? ( dev-vcs/git ) |
| 26 |
java? ( >=virtual/jre-1.4 )" |
| 27 |
PDEPEND="emacs? ( app-emacs/po-mode )" |
| 28 |
|
| 29 |
src_prepare() { |
| 30 |
java-pkg-opt-2_src_prepare |
| 31 |
epunt_cxx |
| 32 |
elibtoolize |
| 33 |
epatch "${FILESDIR}"/${P}-uclibc-sched_param-def.patch |
| 34 |
epatch "${FILESDIR}"/${P}-no-gets.patch |
| 35 |
} |
| 36 |
|
| 37 |
src_configure() { |
| 38 |
local myconf="" |
| 39 |
# Build with --without-included-gettext (on glibc systems) |
| 40 |
if use elibc_glibc ; then |
| 41 |
myconf="${myconf} --without-included-gettext $(use_enable nls)" |
| 42 |
else |
| 43 |
myconf="${myconf} --with-included-gettext --enable-nls" |
| 44 |
fi |
| 45 |
use cxx || export CXX=$(tc-getCC) |
| 46 |
|
| 47 |
# --without-emacs: Emacs support is now in a separate package |
| 48 |
# --with-included-glib: glib depends on us so avoid circular deps |
| 49 |
# --with-included-libcroco: libcroco depends on glib which ... ^^^ |
| 50 |
# |
| 51 |
# --with-included-libunistring will _disable_ libunistring (since |
| 52 |
# --it's not bundled), see bug #326477 |
| 53 |
econf \ |
| 54 |
--docdir="/usr/share/doc/${PF}" \ |
| 55 |
--without-emacs \ |
| 56 |
--without-lispdir \ |
| 57 |
$(use_enable java) \ |
| 58 |
--with-included-glib \ |
| 59 |
--with-included-libcroco \ |
| 60 |
--with-included-libunistring \ |
| 61 |
$(use_enable acl) \ |
| 62 |
$(use_enable openmp) \ |
| 63 |
$(use_with git) \ |
| 64 |
--without-cvs |
| 65 |
} |
| 66 |
|
| 67 |
src_install() { |
| 68 |
emake install DESTDIR="${D}" || die "install failed" |
| 69 |
use nls || rm -r "${D}"/usr/share/locale |
| 70 |
dosym msgfmt /usr/bin/gmsgfmt #43435 |
| 71 |
dobin gettext-tools/misc/gettextize || die "gettextize" |
| 72 |
|
| 73 |
# remove stuff that glibc handles |
| 74 |
if use elibc_glibc ; then |
| 75 |
rm -f "${D}"/usr/include/libintl.h |
| 76 |
rm -f "${D}"/usr/$(get_libdir)/libintl.* |
| 77 |
fi |
| 78 |
rm -f "${D}"/usr/share/locale/locale.alias "${D}"/usr/lib/charset.alias |
| 79 |
|
| 80 |
if [[ ${USERLAND} == "BSD" ]] ; then |
| 81 |
libname="libintl$(get_libname)" |
| 82 |
# Move dynamic libs and creates ldscripts into /usr/lib |
| 83 |
dodir /$(get_libdir) |
| 84 |
mv "${D}"/usr/$(get_libdir)/${libname}* "${D}"/$(get_libdir)/ |
| 85 |
gen_usr_ldscript ${libname} |
| 86 |
fi |
| 87 |
|
| 88 |
if use java ; then |
| 89 |
java-pkg_dojar "${D}"/usr/share/${PN}/*.jar |
| 90 |
rm -f "${D}"/usr/share/${PN}/*.jar |
| 91 |
rm -f "${D}"/usr/share/${PN}/*.class |
| 92 |
if use doc ; then |
| 93 |
java-pkg_dojavadoc "${D}"/usr/share/doc/${PF}/javadoc2 |
| 94 |
rm -rf "${D}"/usr/share/doc/${PF}/javadoc2 |
| 95 |
fi |
| 96 |
fi |
| 97 |
|
| 98 |
if use doc ; then |
| 99 |
dohtml "${D}"/usr/share/doc/${PF}/*.html |
| 100 |
else |
| 101 |
rm -rf "${D}"/usr/share/doc/${PF}/{csharpdoc,examples,javadoc2,javadoc1} |
| 102 |
fi |
| 103 |
rm -f "${D}"/usr/share/doc/${PF}/*.html |
| 104 |
|
| 105 |
dodoc AUTHORS ChangeLog NEWS README THANKS |
| 106 |
} |
| 107 |
|
| 108 |
pkg_preinst() { |
| 109 |
# older gettext's sometimes installed libintl ... |
| 110 |
# need to keep the linked version or the system |
| 111 |
# could die (things like sed link against it :/) |
| 112 |
preserve_old_lib /{,usr/}$(get_libdir)/libintl$(get_libname 7) |
| 113 |
|
| 114 |
java-pkg-opt-2_pkg_preinst |
| 115 |
} |
| 116 |
|
| 117 |
pkg_postinst() { |
| 118 |
preserve_old_lib_notify /{,usr/}$(get_libdir)/libintl$(get_libname 7) |
| 119 |
} |