cpupower-3.14.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit multilib toolchain-funcs
  5. DESCRIPTION="Shows and sets processor power related values"
  6. HOMEPAGE="https://www.kernel.org/"
  7. SRC_URI="mirror://kernel/linux/kernel/v3.x/linux-${PV}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~arm ~x86"
  11. IUSE="cpufreq_bench debug nls"
  12. # File collision w/ headers of the deprecated cpufrequtils
  13. RDEPEND="sys-apps/pciutils
  14. !<sys-apps/linux-misc-apps-3.6-r2
  15. !sys-power/cpufrequtils"
  16. DEPEND="${RDEPEND}
  17. virtual/os-headers
  18. virtual/pkgconfig
  19. nls? ( sys-devel/gettext )"
  20. S=${WORKDIR}/linux-${PV}/tools/power/${PN}
  21. pkg_setup() {
  22. myemakeargs=(
  23. DEBUG=$(usex debug true false)
  24. V=1
  25. CPUFREQ_BENCH=$(usex cpufreq_bench true false)
  26. NLS=$(usex nls true false)
  27. docdir=/usr/share/doc/${PF}/${PN}
  28. mandir=/usr/share/man
  29. libdir=/usr/$(get_libdir)
  30. AR="$(tc-getAR)"
  31. CC="$(tc-getCC)"
  32. LD="$(tc-getCC)"
  33. STRIP=true
  34. LDFLAGS="${LDFLAGS}"
  35. OPTIMIZATION="${CFLAGS}"
  36. )
  37. }
  38. src_prepare() {
  39. # -Wl,--as-needed compat
  40. local libs="-lcpupower -lrt $($(tc-getPKG_CONFIG) --libs-only-l libpci)"
  41. sed -i \
  42. -e "/$libs/{ s,${libs},,g; s,\$, ${libs},g;}" \
  43. -e "s:-O1 -g::" \
  44. Makefile || die
  45. }
  46. src_compile() {
  47. emake "${myemakeargs[@]}"
  48. }
  49. src_install() {
  50. emake DESTDIR="${D}" "${myemakeargs[@]}" install
  51. dodoc README ToDo
  52. newconfd "${FILESDIR}"/conf.d-r2 ${PN}
  53. newinitd "${FILESDIR}"/init.d-r4 ${PN}
  54. }