1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
7 inherit eutils python-r1 toolchain-funcs
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"
18 KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86"
19 IUSE="aio glusterfs gnuplot gtk numa rbd rdma static zlib"
21 DEPEND="aio? ( dev-libs/libaio )
22 glusterfs? ( !arm? ( sys-cluster/glusterfs ) )
27 numa? ( sys-process/numactl )
28 rbd? ( sys-cluster/ceph )
29 zlib? ( sys-libs/zlib )"
32 sci-visualization/gnuplot
36 S="${WORKDIR}/${MY_P}"
39 sed -i '/^DEBUGFLAGS/s: -D_FORTIFY_SOURCE=2::g' Makefile || die
40 epatch "${FILESDIR}"/${P}-atomic-sync.patch
43 # Many checks don't have configure flags.
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:" \
53 # not a real configure script
55 --extra-cflags="${CFLAGS} ${CPPFLAGS}" \
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'
70 emake install DESTDIR="${D}" prefix="${EPREFIX}/usr" mandir="${EPREFIX}/usr/share/man"
73 python_replicate_script "${ED}/usr/bin/fio2gnuplot"
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
81 # This tool has security/parallel issues -- it hardcodes /tmp/template.fio.
82 rm "${ED}"/usr/bin/genfio || die
84 dodoc README REPORTING-BUGS HOWTO