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