d114b72afb16211e827d9df4e9919afabb4549e1
[gentoo.git] / app-laptop / thinkfan / thinkfan-1.0.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils readme.gentoo-r1
7
8 DESCRIPTION="simple fan control program for thinkpads"
9 HOMEPAGE="http://thinkfan.sourceforge.net"
10 SRC_URI="https://github.com/vmatare/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="atasmart nvidia +yaml"
16
17 DEPEND="atasmart? ( dev-libs/libatasmart )
18         yaml? ( dev-cpp/yaml-cpp )"
19 RDEPEND="${DEPEND}
20         nvidia? ( x11-drivers/nvidia-drivers )"
21
22 src_prepare() {
23         cmake-utils_src_prepare
24
25         sed -e "s:share/doc/${PN}:share/doc/${PF}:" \
26                 -i CMakeLists.txt || die "sed failed"
27 }
28
29 src_configure() {
30         local mycmakeargs+=(
31                 -DUSE_NVML="$(usex nvidia)"
32                 -DUSE_ATASMART="$(usex atasmart)"
33                 -DUSE_YAML="$(usex yaml)"
34         )
35
36         cmake-utils_src_configure
37 }
38
39 src_install() {
40         cmake-utils_src_install
41         readme.gentoo_create_doc
42 }
43
44 DOC_CONTENTS="Please read the documentation and copy an
45 appropriate file to /etc/thinkfan.conf."