freeipmi-1.4.8.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. #AUTOTOOLS_AUTORECONF=1
  5. AT_M4DIR="config"
  6. inherit eutils multilib autotools-utils
  7. DESCRIPTION="Provides Remote-Console and System Management Software as per IPMI v1.5/2.0"
  8. HOMEPAGE="https://www.gnu.org/software/freeipmi/"
  9. MY_P="${P/_/.}"
  10. S="${WORKDIR}"/${MY_P}
  11. [[ ${MY_P} == *.beta* ]] && ALPHA="-alpha"
  12. SRC_URI="mirror://gnu${ALPHA}/${PN}/${MY_P}.tar.gz"
  13. LICENSE="GPL-3"
  14. SLOT="0"
  15. KEYWORDS="~amd64 ~x86"
  16. IUSE="debug nagios"
  17. RDEPEND="dev-libs/libgcrypt:0"
  18. DEPEND="${RDEPEND}
  19. virtual/os-headers"
  20. RDEPEND="${RDEPEND}
  21. nagios? (
  22. || ( net-analyzer/icinga net-analyzer/nagios )
  23. dev-lang/perl
  24. )
  25. sys-apps/openrc"
  26. src_configure() {
  27. local myeconfargs=(
  28. $(use_enable debug)
  29. --disable-static
  30. --disable-init-scripts
  31. --localstatedir=/var
  32. )
  33. autotools-utils_src_configure
  34. }
  35. # There are no tests
  36. src_test() { :; }
  37. src_install() {
  38. autotools-utils_src_install
  39. # freeipmi by defaults install _all_ commands to /usr/sbin, but
  40. # quite a few can be run remotely as standard user, so move them
  41. # in /usr/bin afterwards.
  42. dodir /usr/bin
  43. for file in ipmi{detect,ping,power,console}; do
  44. mv "${D}"/usr/{s,}bin/${file} || die
  45. # The default install symlinks these commands to add a dash
  46. # after the ipmi prefix; we repeat those after move for
  47. # consistency.
  48. rm "${D}"/usr/sbin/${file/ipmi/ipmi-}
  49. dosym ${file} /usr/bin/${file/ipmi/ipmi-}
  50. done
  51. # Install the nagios plugin in its proper place, if desired
  52. if use nagios; then
  53. dodir /usr/$(get_libdir)/nagios/plugins
  54. mv "${D}"/usr/share/doc/${PF}/contrib/nagios/nagios_ipmi_sensors.pl \
  55. "${D}"/usr/$(get_libdir)/nagios/plugins/ || die
  56. fperms 0755 /usr/$(get_libdir)/nagios/plugins/nagios_ipmi_sensors.pl
  57. insinto /etc/icinga/conf.d
  58. newins "${FILESDIR}"/freeipmi.icinga freeipmi-command.cfg
  59. fi
  60. dodoc AUTHORS ChangeLog* DISCLAIMER* NEWS README* TODO doc/*.txt
  61. keepdir \
  62. /var/cache/ipmimonitoringsdrcache \
  63. /var/lib/freeipmi \
  64. /var/log/ipmiconsole
  65. # starting from version 1.2.0 the two daemons are similar enough
  66. newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmidetectd
  67. newconfd "${FILESDIR}"/ipmidetectd.confd ipmidetectd
  68. newinitd "${FILESDIR}"/bmc-watchdog.initd.4 bmc-watchdog
  69. newconfd "${FILESDIR}"/bmc-watchdog.confd bmc-watchdog
  70. newinitd "${FILESDIR}"/bmc-watchdog.initd.4 ipmiseld
  71. newconfd "${FILESDIR}"/ipmiseld.confd ipmiseld
  72. }