1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit linux-info systemd toolchain-funcs
8 DESCRIPTION="A simple daemon to control fan speed on all Macbook/Macbook Pros"
9 HOMEPAGE="https://github.com/dgraziotin/mbpfan"
12 RESTRICT="test" # will fail if the hardware is unavailable, not useful
14 if [[ "${PV}" = 9999 ]]; then
16 EGIT_REPO_URI="https://github.com/dgraziotin/${PN}.git"
19 SRC_URI="https://github.com/dgraziotin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
23 CONFIG_CHECK="~SENSORS_APPLESMC ~SENSORS_CORETEMP"
26 emake CC="$(tc-getCC)"
30 # There's a double linking problem in install
31 emake DESTDIR="${ED}" CC="$(tc-getCC)" install
33 # Remove the empty systemd unit directory
34 # It doesn't actually install the unit file
35 rmdir --ignore-fail-on-non-empty -p "${ED%/}/lib/systemd/system" || die
36 # Actually install the sytstemd unit file
37 systemd_dounit ${PN}.service
38 # Install openrc init file
39 newinitd ${PN}.init.gentoo ${PN}
41 # make install doesn't install the docs in the right place
42 rm -rf "${ED%/}/usr/share/doc/${PN}" || die