dmidecode-3.0.ebuild 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit flag-o-matic toolchain-funcs eutils
  5. DESCRIPTION="DMI (Desktop Management Interface) table related utilities"
  6. HOMEPAGE="http://www.nongnu.org/dmidecode/"
  7. SRC_URI="https://savannah.nongnu.org/download/${PN}/${P}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="-* ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-solaris"
  11. IUSE="selinux"
  12. RDEPEND="selinux? ( sec-policy/selinux-dmidecode )"
  13. DEPEND=""
  14. src_prepare() {
  15. sed -i \
  16. -e "/^prefix/s:/usr/local:${EPREFIX}/usr:" \
  17. -e "/^docdir/s:dmidecode:${PF}:" \
  18. -e '/^PROGRAMS !=/d' \
  19. Makefile || die
  20. }
  21. src_compile() {
  22. emake \
  23. CFLAGS="${CFLAGS} ${CPPFLAGS}" \
  24. LDFLAGS="${LDFLAGS}" \
  25. CC="$(tc-getCC)"
  26. }
  27. pkg_postinst() {
  28. if [[ ${CHOST} == *-solaris* ]] ; then
  29. einfo "dmidecode needs root privileges to read /dev/xsvc"
  30. einfo "To make dmidecode useful, either run as root, or chown and setuid the binary."
  31. einfo "Note that /usr/sbin/ptrconf and /usr/sbin/ptrdiag give similar"
  32. einfo "information without requiring root privileges."
  33. fi
  34. }