sysstat-11.5.5.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright 1999-2017 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=""
  11. IUSE="debug nls lm_sensors selinux static"
  12. CDEPEND="
  13. nls? ( virtual/libintl )
  14. lm_sensors? ( sys-apps/lm_sensors )
  15. "
  16. DEPEND="
  17. ${CDEPEND}
  18. nls? ( sys-devel/gettext )
  19. "
  20. RDEPEND="
  21. ${CDEPEND}
  22. selinux? ( sec-policy/selinux-sysstat )
  23. "
  24. PATCHES=(
  25. "${FILESDIR}"/${PN}-10.0.4-flags.patch
  26. "${FILESDIR}"/${PN}-11.0.4-cron.patch
  27. )
  28. SYSSTAT_FAKE_RC_DIR=Gentoo-does-not-use-rc.d
  29. src_prepare() {
  30. if use nls; then
  31. strip-linguas -i nls/
  32. local lingua pofile
  33. for pofile in nls/*.po; do
  34. lingua=${pofile/nls\/}
  35. lingua=${lingua/.po}
  36. if ! has ${lingua} ${LINGUAS}; then
  37. rm "nls/${lingua}.po" || die
  38. fi
  39. done
  40. fi
  41. default
  42. }
  43. src_configure() {
  44. tc-export AR
  45. use static && append-ldflags -static
  46. sa_lib_dir=/usr/$(get_libdir)/sa \
  47. conf_dir=/etc \
  48. rcdir=${SYSSTAT_FAKE_RC_DIR} \
  49. econf \
  50. $(use_enable debug debuginfo) \
  51. $(use_enable lm_sensors sensors) \
  52. $(use_enable nls) \
  53. --enable-copy-only \
  54. --enable-documentation \
  55. --enable-install-cron \
  56. --with-systemdsystemunitdir=$(systemd_get_systemunitdir)
  57. }
  58. src_compile() {
  59. emake LFLAGS="${LDFLAGS}"
  60. }
  61. src_install() {
  62. keepdir /var/log/sa
  63. emake \
  64. CHOWN=true \
  65. DESTDIR="${D}" \
  66. DOC_DIR=/usr/share/doc/${PF} \
  67. MANGRPARG='' \
  68. install
  69. dodoc -r contrib/
  70. rm -r "${D}/${SYSSTAT_FAKE_RC_DIR}" || die
  71. newinitd "${FILESDIR}"/${PN}.init.d ${PN}
  72. systemd_dounit ${PN}.service
  73. rm -f "${D}"usr/share/doc/${PF}/COPYING
  74. }