blob: a688722c8bdea475fa946d70cb775b8fdcd0a048 [file] [log] [blame]
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/dmidecode/dmidecode-2.11.ebuild,v 1.15 2013/01/22 17:33:49 ago Exp $
EAPI="3"
inherit flag-o-matic toolchain-funcs
DESCRIPTION="DMI (Desktop Management Interface) table related utilities"
HOMEPAGE="http://www.nongnu.org/dmidecode/"
SRC_URI="http://savannah.nongnu.org/download/${PN}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="*"
IUSE="selinux"
DEPEND="selinux? ( sec-policy/selinux-dmidecode )"
RDEPEND="${DEPEND}"
src_prepare() {
epatch "${FILESDIR}/${P}-smbios_base.patch"
sed -i \
-e "/^prefix/s:/usr/local:${EPREFIX}/usr:" \
-e "/^docdir/s:dmidecode:${PF}:" \
-e '/^PROGRAMS !=/d' \
Makefile || die
}
src_compile() {
emake \
CFLAGS="${CFLAGS} ${CPPFLAGS}" \
LDFLAGS="${LDFLAGS}" \
CC="$(tc-getCC)" \
|| die
}
src_install() {
emake install DESTDIR="${D}" || die
prepalldocs
}
pkg_postinst() {
if [[ ${CHOST} == *-solaris* ]] ; then
einfo "dmidecode needs root privileges to read /dev/xsvc"
einfo "To make dmidecode useful, either run as root, or chown and setuid the binary."
einfo "Note that /usr/sbin/ptrconf and /usr/sbin/ptrdiag give similar"
einfo "information without requiring root privileges."
fi
}