/[gentoo-x86]/dev-libs/libaio/libaio-0.3.109-r3.ebuild
Gentoo

Contents of /dev-libs/libaio/libaio-0.3.109-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Wed Nov 14 17:19:51 2012 UTC (2 years, 1 month ago) by ago
Branch: MAIN
Changes since 1.8: +2 -2 lines
Stable for x86, wrt bug #397571

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/libaio/libaio-0.3.109-r3.ebuild,v 1.8 2012/11/14 17:18:30 ago Exp $
4
5 EAPI=3
6
7 inherit eutils multilib toolchain-funcs
8
9 DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
10 HOMEPAGE="http://www.kernel.org/pub/linux/kernel/people/andrea/libaio/ http://lse.sourceforge.net/io/aio.html"
11 SRC_URI="mirror://kernel/linux/libs/aio/${P}.tar.bz2"
12
13 LICENSE="LGPL-2"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-linux ~x86-linux"
16 IUSE="multilib static-libs"
17
18 EMULTILIB_PKG="true"
19
20 aio_get_install_abis() {
21 use multilib && get_install_abis || echo ${ABI:-default}
22 }
23
24 src_unpack() {
25 local OABI=${ABI}
26 for ABI in $(aio_get_install_abis)
27 do
28 mkdir -p "${WORKDIR}"/${ABI} || die
29 cd "${WORKDIR}"/${ABI} || die
30 unpack ${A}
31 done
32 ABI=${OABI}
33 }
34
35 src_prepare() {
36 local OABI=${ABI}
37 for ABI in $(aio_get_install_abis)
38 do
39 einfo "Preparing ${ABI} ABI ..."
40 cd "${WORKDIR}"/${ABI}/${P} || die
41
42 # remove stuff provided by man-pages now
43 rm man/{lio_listio,aio_{cancel,error,fsync,init,read,return,suspend,write}}.* || die
44
45 epatch "${FILESDIR}"/${PN}-0.3.109-unify-bits-endian.patch
46 epatch "${FILESDIR}"/${PN}-0.3.109-generic-arch.patch
47 epatch "${FILESDIR}"/${PN}-0.3.106-build.patch
48 epatch "${FILESDIR}"/${PN}-0.3.107-ar-ranlib.patch
49 epatch "${FILESDIR}"/${PN}-0.3.109-install.patch
50 epatch "${FILESDIR}"/${PN}-0.3.109-x32.patch
51 epatch "${FILESDIR}"/${PN}-0.3.109-testcase-8.patch
52 declare -a extra_sed
53 if ! use static-libs; then
54 extra_sed[${#extra_sed[@]}]='-e'
55 extra_sed[${#extra_sed[@]}]='/\tinstall .*\/libaio.a/d'
56 # Tests require the static library to be built.
57 if ! use test; then
58 extra_sed[${#extra_sed[@]}]='-e'
59 extra_sed[${#extra_sed[@]}]='/^all_targets +=/s/ libaio.a//'
60 fi
61 fi
62 sed -i \
63 -e "/^libdir=/s:lib$:$(get_libdir):" \
64 -e "/^prefix=/s:/usr:${EPREFIX}/usr:" \
65 -e '/:=.*strip.*shell.*git/s:=.*:=:' \
66 "${extra_sed[@]}" \
67 src/Makefile Makefile || die
68
69 sed -i -e "s:-Werror::g" harness/Makefile || die
70 done
71 ABI=${OABI}
72 }
73
74 emake_libaio() {
75 # The Makefiles need these environments, but multilib_toolchain_setup()
76 # does not export anything when there is only one default abi available.
77 CC="$(tc-getCC) $(get_abi_CFLAGS)" \
78 AR=$(tc-getAR) \
79 RANLIB=$(tc-getRANLIB) \
80 emake "$@" || die
81 }
82
83 src_compile() {
84 local OABI=${ABI}
85 for ABI in $(aio_get_install_abis)
86 do
87 einfo "Compiling ${ABI} ABI ..."
88 cd "${WORKDIR}"/${ABI}/${P} || die
89 emake_libaio
90 done
91 ABI=${OABI}
92 }
93
94 src_test() {
95 local OABI=${ABI}
96 for ABI in $(aio_get_install_abis)
97 do
98 einfo "Testing ${ABI} ABI ..."
99 cd "${WORKDIR}"/${ABI}/${P}/harness || die
100 mkdir testdir || die
101 # 'make check' breaks with sandbox, 'make partcheck' works
102 emake_libaio partcheck prefix="${S}/src" libdir="${S}/src"
103 done
104 ABI=${OABI}
105 }
106
107 src_install() {
108 local OABI=${ABI}
109 for ABI in $(aio_get_install_abis)
110 do
111 einfo "Installing ${ABI} ABI ..."
112 cd "${WORKDIR}"/${ABI}/${P} || die
113
114 # Don't use ED for emake, src_prepare already inserts EPREFIX in the correct
115 # place
116 emake_libaio install DESTDIR="${D}"
117
118 doman man/*
119 dodoc ChangeLog TODO
120
121 # move crap to / for multipath-tools #325355
122 gen_usr_ldscript -a aio
123 done
124 ABI=${OABI}
125 }

  ViewVC Help
Powered by ViewVC 1.1.20