freeipmi-1.4.3.ebuild 2.5 KB

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