freeipmi-1.5.4.ebuild 2.3 KB

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