/[gentoo-x86]/sys-libs/zlib/zlib-1.2.5.1-r2.ebuild
Gentoo

Contents of /sys-libs/zlib/zlib-1.2.5.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sun Jul 8 16:38:55 2012 UTC (2 years ago) by armin76
Branch: MAIN
Changes since 1.10: +2 -2 lines
ia64/m68k/s390/sh/sparc stable wrt #384483

(Portage version: 2.1.11.5/cvs/Linux ia64)

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-libs/zlib/zlib-1.2.5.1-r2.ebuild,v 1.10 2012/05/26 10:11:59 maekke Exp $
4
5 inherit autotools 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="minizip static-libs"
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 EPATCH_OPTS=-p1 epatch "${FILESDIR}"/${PN}-1.2.4-minizip-autotools.patch
30 if use minizip ; then
31 cd contrib/minizip
32 sed -i "s:@ZLIB_VER@:${PV}:" configure.ac || die
33 ln -s ../../minigzip.c || die
34 eautoreconf
35 fi
36 }
37
38 usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }
39 echoit() { echo "$@"; "$@"; }
40 src_compile() {
41 case ${CHOST} in
42 *-mingw*|mingw*)
43 emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}- || die
44 sed \
45 -e 's|@prefix@|/usr|g' \
46 -e 's|@exec_prefix@|${prefix}|g' \
47 -e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
48 -e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
49 -e 's|@includedir@|${prefix}/include|g' \
50 -e 's|@VERSION@|'${PV}'|g' \
51 zlib.pc.in > zlib.pc || die
52 ;;
53 *) # not an autoconf script, so can't use econf
54 echoit ./configure --shared --prefix=/usr --libdir=/usr/$(get_libdir) || die
55 emake || die
56 ;;
57 esac
58 if use minizip ; then
59 cd contrib/minizip
60 econf $(use_enable static-libs static)
61 emake || die
62 fi
63 }
64
65 sed_macros() {
66 # clean up namespace a little #383179
67 # we do it here so we only have to tweak 2 files
68 sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "$@" || die
69 }
70 src_install() {
71 case ${CHOST} in
72 *-mingw*|mingw*)
73 emake -f win32/Makefile.gcc install \
74 BINARY_PATH="${D}/usr/bin" \
75 LIBRARY_PATH="${D}/usr/$(get_libdir)" \
76 INCLUDE_PATH="${D}/usr/include" \
77 SHARED_MODE=1 \
78 || die
79 insinto /usr/share/pkgconfig
80 doins zlib.pc || die
81 ;;
82
83 *)
84 emake install DESTDIR="${D}" LDCONFIG=: || die
85 gen_usr_ldscript -a z
86 sed_macros "${D}"/usr/include/*.h
87 ;;
88 esac
89
90 dodoc FAQ README ChangeLog doc/*.txt
91
92 if use minizip ; then
93 cd contrib/minizip
94 emake install DESTDIR="${D}" || die
95 sed_macros "${D}"/usr/include/minizip/*.h
96 dodoc *.txt
97 fi
98
99 use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.{a,la}
100 }

  ViewVC Help
Powered by ViewVC 1.1.20