mbpfan-9999.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit linux-info systemd toolchain-funcs
  5. DESCRIPTION="A simple daemon to control fan speed on all Macbook/Macbook Pros"
  6. HOMEPAGE="https://github.com/dgraziotin/mbpfan"
  7. LICENSE="GPL-3+"
  8. SLOT="0"
  9. RESTRICT="test" # will fail if the hardware is unavailable, not useful
  10. if [[ "${PV}" = 9999 ]]; then
  11. inherit git-r3
  12. EGIT_REPO_URI="git://github.com/dgraziotin/${PN}.git"
  13. KEYWORDS=""
  14. else
  15. SRC_URI="https://github.com/dgraziotin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  16. KEYWORDS="~amd64"
  17. fi
  18. CONFIG_CHECK="~SENSORS_APPLESMC ~SENSORS_CORETEMP"
  19. src_compile() {
  20. emake CC="$(tc-getCC)"
  21. }
  22. src_install() {
  23. # There's a double linking problem in install
  24. emake DESTDIR="${ED}" CC="$(tc-getCC)" install
  25. # Remove the empty systemd unit directory
  26. # It doesn't actually install the unit file
  27. rmdir --ignore-fail-on-non-empty -p "${ED%/}/lib/systemd/system" || die
  28. # Actually install the sytstemd unit file
  29. systemd_dounit ${PN}.service
  30. # Install openrc init file
  31. newinitd ${PN}.init.gentoo ${PN}
  32. # make install doesn't install the docs in the right place
  33. rm -rf "${ED%/}/usr/share/doc/${PN}" || die
  34. einstalldocs
  35. }