sysstat-11.4.0.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic multilib systemd toolchain-funcs
  5. DESCRIPTION="System performance tools for Linux"
  6. HOMEPAGE="http://pagesperso-orange.fr/sebastien.godard/"
  7. SRC_URI="${HOMEPAGE}${P}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 ~arm ~arm64 hppa ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
  11. IUSE="debug isag nls lm_sensors selinux static"
  12. CDEPEND="
  13. isag? (
  14. dev-lang/tk:0
  15. dev-vcs/rcs
  16. sci-visualization/gnuplot
  17. )
  18. nls? ( virtual/libintl )
  19. lm_sensors? ( sys-apps/lm_sensors )
  20. "
  21. DEPEND="
  22. ${CDEPEND}
  23. nls? ( sys-devel/gettext )
  24. "
  25. RDEPEND="
  26. ${CDEPEND}
  27. selinux? ( sec-policy/selinux-sysstat )
  28. "
  29. SYSSTAT_FAKE_RC_DIR=Gentoo-does-not-use-rc.d
  30. src_prepare() {
  31. if use nls; then
  32. strip-linguas -i nls/
  33. local lingua pofile
  34. for pofile in nls/*.po; do
  35. lingua=${pofile/nls\/}
  36. lingua=${lingua/.po}
  37. if ! has ${lingua} ${LINGUAS}; then
  38. rm "nls/${lingua}.po" || die
  39. fi
  40. done
  41. fi
  42. epatch \
  43. "${FILESDIR}"/${PN}-10.0.4-flags.patch \
  44. "${FILESDIR}"/${PN}-11.0.4-cron.patch
  45. }
  46. src_configure() {
  47. tc-export AR
  48. use static && append-ldflags -static
  49. sa_lib_dir=/usr/$(get_libdir)/sa \
  50. conf_dir=/etc \
  51. rcdir=${SYSSTAT_FAKE_RC_DIR} \
  52. econf \
  53. $(use_enable debug debuginfo) \
  54. $(use_enable isag install-isag) \
  55. $(use_enable lm_sensors sensors) \
  56. $(use_enable nls) \
  57. --enable-copy-only \
  58. --enable-documentation \
  59. --enable-install-cron \
  60. --with-systemdsystemunitdir=$(systemd_get_unitdir)
  61. }
  62. src_compile() {
  63. emake LFLAGS="${LDFLAGS}"
  64. }
  65. src_install() {
  66. keepdir /var/log/sa
  67. emake \
  68. CHOWN=true \
  69. DESTDIR="${D}" \
  70. DOC_DIR=/usr/share/doc/${PF} \
  71. MANGRPARG='' \
  72. install
  73. dodoc contrib/sargraph/sargraph
  74. rm -r "${D}/${SYSSTAT_FAKE_RC_DIR}" || die
  75. newinitd "${FILESDIR}"/${PN}.init.d ${PN}
  76. systemd_dounit ${PN}.service
  77. rm -f "${D}"usr/share/doc/${PF}/COPYING
  78. }