dmidecode-2.12-r1.ebuild 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="-* amd64 arm 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. epatch "${FILESDIR}/${PV}-supported-smbios-version.patch"
  16. sed -i \
  17. -e "/^prefix/s:/usr/local:${EPREFIX}/usr:" \
  18. -e "/^docdir/s:dmidecode:${PF}:" \
  19. -e '/^PROGRAMS !=/d' \
  20. Makefile || die
  21. }
  22. src_compile() {
  23. emake \
  24. CFLAGS="${CFLAGS} ${CPPFLAGS}" \
  25. LDFLAGS="${LDFLAGS}" \
  26. CC="$(tc-getCC)"
  27. }
  28. pkg_postinst() {
  29. if [[ ${CHOST} == *-solaris* ]] ; then
  30. einfo "dmidecode needs root privileges to read /dev/xsvc"
  31. einfo "To make dmidecode useful, either run as root, or chown and setuid the binary."
  32. einfo "Note that /usr/sbin/ptrconf and /usr/sbin/ptrdiag give similar"
  33. einfo "information without requiring root privileges."
  34. fi
  35. }