2013-01-23 22:42:58 +04:00
|
|
|
# Copyright 1999-2013 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2013-09-27 20:51:19 +04:00
|
|
|
# $Header: /var/cvsroot/gentoo-x86/sys-power/cpupower/cpupower-3.11.ebuild,v 1.1 2013/09/27 11:31:48 ssuominen Exp $
|
2013-01-23 22:42:58 +04:00
|
|
|
|
|
|
|
EAPI=5
|
|
|
|
inherit multilib toolchain-funcs
|
|
|
|
|
|
|
|
DESCRIPTION="Shows and sets processor power related values"
|
|
|
|
HOMEPAGE="http://www.kernel.org/"
|
2013-04-24 10:05:57 +04:00
|
|
|
SRC_URI="mirror://kernel/linux/kernel/v3.x/linux-${PV}.tar.xz"
|
2013-01-23 22:42:58 +04:00
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
IUSE="cpufreq_bench debug nls"
|
|
|
|
|
|
|
|
# cpupower should be a USE flag in linux-misc-apps (ditto for usbip!)
|
|
|
|
# but only if the maintainer doesn't agree to drop it completely from
|
|
|
|
# there in favour of this one which i'll push to users are replacement
|
|
|
|
# for the dead cpufreq tools in tree
|
|
|
|
# !sys-apps/linux-misc-apps[cpupower]
|
2013-04-24 10:05:57 +04:00
|
|
|
|
|
|
|
# header collision with cpufrequtils
|
2013-01-24 23:53:53 +04:00
|
|
|
RDEPEND="sys-apps/pciutils
|
2013-04-24 10:05:57 +04:00
|
|
|
!sys-apps/linux-misc-apps
|
|
|
|
!sys-power/cpufrequtils"
|
2013-01-23 22:42:58 +04:00
|
|
|
DEPEND="${RDEPEND}
|
2013-01-24 23:53:53 +04:00
|
|
|
virtual/os-headers
|
2013-09-27 20:51:19 +04:00
|
|
|
virtual/pkgconfig
|
2013-01-23 22:42:58 +04:00
|
|
|
nls? ( sys-devel/gettext )"
|
|
|
|
|
2013-04-24 10:05:57 +04:00
|
|
|
S=${WORKDIR}/linux-${PV}/tools/power/${PN}
|
2013-01-23 22:42:58 +04:00
|
|
|
|
|
|
|
pkg_setup() {
|
|
|
|
myemakeargs=(
|
|
|
|
DEBUG=$(usex debug true false)
|
|
|
|
V=1
|
|
|
|
CPUFREQ_BENCH=$(usex cpufreq_bench true false)
|
|
|
|
NLS=$(usex nls true false)
|
|
|
|
docdir=/usr/share/doc/${PF}/${PN}
|
|
|
|
mandir=/usr/share/man
|
|
|
|
libdir=/usr/$(get_libdir)
|
|
|
|
AR="$(tc-getAR)"
|
|
|
|
CC="$(tc-getCC)"
|
|
|
|
LD="$(tc-getCC)"
|
|
|
|
STRIP=true
|
|
|
|
LDFLAGS="${LDFLAGS}"
|
|
|
|
OPTIMIZATION="${CFLAGS}"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
# -Wl,--as-needed compat
|
2013-09-27 20:51:19 +04:00
|
|
|
local libs="-lcpupower -lrt $($(tc-getPKG_CONFIG) --libs-only-l libpci)"
|
2013-01-23 22:42:58 +04:00
|
|
|
sed -i \
|
|
|
|
-e "/$libs/{ s,${libs},,g; s,\$, ${libs},g;}" \
|
|
|
|
-e "s:-O1 -g::" \
|
|
|
|
Makefile || die
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
emake "${myemakeargs[@]}"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
emake DESTDIR="${D}" "${myemakeargs[@]}" install
|
|
|
|
dodoc README ToDo
|
2013-04-24 10:05:57 +04:00
|
|
|
|
2013-09-27 20:51:19 +04:00
|
|
|
newconfd "${FILESDIR}"/conf.d-r2 ${PN}
|
|
|
|
newinitd "${FILESDIR}"/init.d-r2 ${PN}
|
2013-01-23 22:42:58 +04:00
|
|
|
}
|