1 # Copyright 1999-2018 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 emake DESTDIR="${ED}" install
32 # Remove the empty systemd unit directory
33 # It doesn't actually install the unit file
34 rmdir --ignore-fail-on-non-empty -p "${ED%/}/lib/systemd/system" || die
35 # Actually install the sytstemd unit file
36 systemd_dounit ${PN}.service
37 # Install openrc init file
38 newinitd ${PN}.init.gentoo ${PN}
40 # make install doesn't install the docs in the right place
41 rm -rf "${ED%/}/usr/share/doc/${PN}" || die