app-laptop/laptop-mode-tools: eapi bump
[gentoo.git] / app-laptop / mbpfan / mbpfan-2.1.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit linux-info systemd toolchain-funcs
7
8 DESCRIPTION="A simple daemon to control fan speed on all Macbook/Macbook Pros"
9 HOMEPAGE="https://github.com/dgraziotin/mbpfan"
10 LICENSE="GPL-3+"
11 SLOT="0"
12 RESTRICT="test" # will fail if the hardware is unavailable, not useful
13
14 if [[ "${PV}" = 9999 ]]; then
15         inherit git-r3
16         EGIT_REPO_URI="https://github.com/dgraziotin/${PN}.git"
17         KEYWORDS=""
18 else
19         SRC_URI="https://github.com/dgraziotin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
20         KEYWORDS="~amd64"
21 fi
22
23 CONFIG_CHECK="~SENSORS_APPLESMC ~SENSORS_CORETEMP"
24
25 src_compile() {
26         emake CC="$(tc-getCC)"
27 }
28
29 src_install() {
30         emake DESTDIR="${ED}" install
31
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}
39
40         # make install doesn't install the docs in the right place
41         rm -rf "${ED%/}/usr/share/doc/${PN}" || die
42
43         einstalldocs
44 }