fio-2.15.ebuild 2.6 KB

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