sys-block/fio: fix inverted USE=static logic
[gentoo.git] / sys-block / fio / fio-2.2.9.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 )
7 inherit eutils python-r1 toolchain-funcs
8
9 MY_PV="${PV/_rc/-rc}"
10 MY_P="${PN}-${MY_PV}"
11
12 DESCRIPTION="Jens Axboe's Flexible IO tester"
13 HOMEPAGE="http://brick.kernel.dk/snaps/"
14 SRC_URI="http://brick.kernel.dk/snaps/${MY_P}.tar.bz2"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86"
19 IUSE="aio glusterfs gnuplot gtk numa rbd rdma static zlib"
20
21 DEPEND="aio? ( dev-libs/libaio )
22         glusterfs? ( !arm? ( sys-cluster/glusterfs ) )
23         gtk? (
24                 dev-libs/glib:2
25                 x11-libs/gtk+:2
26         )
27         numa? ( sys-process/numactl )
28         rbd? ( sys-cluster/ceph )
29         zlib? ( sys-libs/zlib )"
30 RDEPEND="${DEPEND}
31         gnuplot? (
32                 sci-visualization/gnuplot
33                 ${PYTHON_DEPS}
34         )"
35
36 S="${WORKDIR}/${MY_P}"
37
38 src_prepare() {
39         sed -i '/^DEBUGFLAGS/s: -D_FORTIFY_SOURCE=2::g' Makefile || die
40         epatch "${FILESDIR}"/${P}-atomic-sync.patch
41         epatch_user
42
43         # Many checks don't have configure flags.
44         sed -i \
45                 -e "s:\<pkg-config\>:$(tc-getPKG_CONFIG):" \
46                 -e '/if compile_prog "" "-lz" "zlib" *; *then/  '"s::if $(usex zlib true false) ; then:" \
47                 -e '/if compile_prog "" "-laio" "libaio" ; then/'"s::if $(usex aio true false) ; then:" \
48                 configure || die
49 }
50
51 src_configure() {
52         chmod g-w "${T}"
53         # not a real configure script
54         ./configure \
55                 --extra-cflags="${CFLAGS} ${CPPFLAGS}" \
56                 --cc="$(tc-getCC)" \
57                 $(usex glusterfs '' '--disable-gfapi') \
58                 $(usex gtk '--enable-gfio' '') \
59                 $(usex numa '' '--disable-numa') \
60                 $(usex rbd '' '--disable-rbd') \
61                 $(usex static '--build-static' '') \
62                 || die 'configure failed'
63 }
64
65 src_compile() {
66         emake V=1 OPTFLAGS=
67 }
68
69 src_install() {
70         emake install DESTDIR="${D}" prefix="${EPREFIX}/usr" mandir="${EPREFIX}/usr/share/man"
71
72         if use gnuplot ; then
73                 python_replicate_script "${ED}/usr/bin/fio2gnuplot"
74         else
75                 rm "${ED}"/usr/bin/{fio2gnuplot,fio_generate_plots} || die
76                 rm "${ED}"/usr/share/man/man1/{fio2gnuplot,fio_generate_plots}.1 || die
77                 rm "${ED}"/usr/share/fio/*.gpm || die
78                 rmdir "${ED}"/usr/share/fio/ 2>/dev/null
79         fi
80
81         # This tool has security/parallel issues -- it hardcodes /tmp/template.fio.
82         rm "${ED}"/usr/bin/genfio || die
83
84         dodoc README REPORTING-BUGS HOWTO
85         docinto examples
86         dodoc examples/*
87 }