sysstat-11.4.2.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit 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. PATCHES=(
  30. "${FILESDIR}"/${PN}-10.0.4-flags.patch
  31. "${FILESDIR}"/${PN}-11.0.4-cron.patch
  32. )
  33. SYSSTAT_FAKE_RC_DIR=Gentoo-does-not-use-rc.d
  34. src_prepare() {
  35. if use nls; then
  36. strip-linguas -i nls/
  37. local lingua pofile
  38. for pofile in nls/*.po; do
  39. lingua=${pofile/nls\/}
  40. lingua=${lingua/.po}
  41. if ! has ${lingua} ${LINGUAS}; then
  42. rm "nls/${lingua}.po" || die
  43. fi
  44. done
  45. fi
  46. default
  47. }
  48. src_configure() {
  49. tc-export AR
  50. use static && append-ldflags -static
  51. sa_lib_dir=/usr/$(get_libdir)/sa \
  52. conf_dir=/etc \
  53. rcdir=${SYSSTAT_FAKE_RC_DIR} \
  54. econf \
  55. $(use_enable debug debuginfo) \
  56. $(use_enable isag install-isag) \
  57. $(use_enable lm_sensors sensors) \
  58. $(use_enable nls) \
  59. --enable-copy-only \
  60. --enable-documentation \
  61. --enable-install-cron \
  62. --with-systemdsystemunitdir=$(systemd_get_systemunitdir)
  63. }
  64. src_compile() {
  65. emake LFLAGS="${LDFLAGS}"
  66. }
  67. src_install() {
  68. keepdir /var/log/sa
  69. emake \
  70. CHOWN=true \
  71. DESTDIR="${D}" \
  72. DOC_DIR=/usr/share/doc/${PF} \
  73. MANGRPARG='' \
  74. install
  75. dodoc contrib/sargraph/sargraph
  76. rm -r "${D}/${SYSSTAT_FAKE_RC_DIR}" || die
  77. newinitd "${FILESDIR}"/${PN}.init.d ${PN}
  78. systemd_dounit ${PN}.service
  79. rm -f "${D}"usr/share/doc/${PF}/COPYING
  80. }