| 1 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/zlib-1.2.5-r2.ebuild,v 1.12 2011/05/01 09:52:06 xarthisius Exp $
|
| 4 |
|
| 5 |
inherit eutils toolchain-funcs
|
| 6 |
|
| 7 |
DESCRIPTION="Standard (de)compression library"
|
| 8 |
HOMEPAGE="http://www.zlib.net/"
|
| 9 |
SRC_URI="http://www.gzip.org/zlib/${P}.tar.gz
|
| 10 |
http://www.zlib.net/current/beta/${P}.tar.gz"
|
| 11 |
|
| 12 |
LICENSE="ZLIB"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
|
| 15 |
IUSE=""
|
| 16 |
|
| 17 |
RDEPEND="!<dev-libs/libxml2-2.7.7" #309623
|
| 18 |
|
| 19 |
src_unpack() {
|
| 20 |
unpack ${A}
|
| 21 |
cd "${S}"
|
| 22 |
# trust exit status of the compiler rather than stderr #55434
|
| 23 |
# -if test "`(...) 2>&1`" = ""; then
|
| 24 |
# +if (...) 2>/dev/null; then
|
| 25 |
sed -i 's|\<test "`\([^"]*\) 2>&1`" = ""|\1 2>/dev/null|' configure || die
|
| 26 |
|
| 27 |
epatch "${FILESDIR}"/${P}-version.patch
|
| 28 |
epatch "${FILESDIR}"/${P}-symlinks.patch
|
| 29 |
}
|
| 30 |
|
| 31 |
echoit() { echo "$@"; "$@"; }
|
| 32 |
src_compile() {
|
| 33 |
case ${CHOST} in
|
| 34 |
*-mingw*|mingw*)
|
| 35 |
emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}- || die
|
| 36 |
sed \
|
| 37 |
-e 's|@prefix@|/usr|g' \
|
| 38 |
-e 's|@exec_prefix@|${prefix}|g' \
|
| 39 |
-e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
|
| 40 |
-e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
|
| 41 |
-e 's|@includedir@|${prefix}/include|g' \
|
| 42 |
-e 's|@VERSION@|'${PV}'|g' \
|
| 43 |
zlib.pc.in > zlib.pc || die
|
| 44 |
;;
|
| 45 |
*) # not an autoconf script, so can't use econf
|
| 46 |
echoit ./configure --shared --prefix=/usr --libdir=/usr/$(get_libdir) || die
|
| 47 |
emake || die
|
| 48 |
;;
|
| 49 |
esac
|
| 50 |
}
|
| 51 |
|
| 52 |
src_install() {
|
| 53 |
case ${CHOST} in
|
| 54 |
*-mingw*|mingw*)
|
| 55 |
emake -f win32/Makefile.gcc install \
|
| 56 |
BINARY_PATH="${D}/usr/bin" \
|
| 57 |
LIBRARY_PATH="${D}/usr/$(get_libdir)" \
|
| 58 |
INCLUDE_PATH="${D}/usr/include" \
|
| 59 |
SHARED_MODE=1 \
|
| 60 |
|| die
|
| 61 |
insinto /usr/share/pkgconfig
|
| 62 |
doins zlib.pc || die
|
| 63 |
;;
|
| 64 |
|
| 65 |
*)
|
| 66 |
emake install DESTDIR="${D}" LDCONFIG=: || die
|
| 67 |
gen_usr_ldscript -a z
|
| 68 |
;;
|
| 69 |
esac
|
| 70 |
|
| 71 |
dodoc FAQ README ChangeLog doc/*.txt
|
| 72 |
}
|