Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-laptop/hdapsd/
Date: Tue, 30 Mar 2021 02:07:00
Message-Id: 1617069536.71580a91595621ef900222f8e8bd5db6e3cc94ad.mjo@gentoo
1 commit: 71580a91595621ef900222f8e8bd5db6e3cc94ad
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 29 23:18:49 2021 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 30 01:58:56 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71580a91
7
8 app-laptop/hdapsd: new EAPI=7 revision.
9
10 This is a no-op, but will eventually let us remove the EAPI=5 ebuild.
11
12 Closes: https://bugs.gentoo.org/778701
13 Package-Manager: Portage-3.0.13, Repoman-3.0.2
14 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
15
16 app-laptop/hdapsd/hdapsd-20141203-r2.ebuild | 73 +++++++++++++++++++++++++++++
17 1 file changed, 73 insertions(+)
18
19 diff --git a/app-laptop/hdapsd/hdapsd-20141203-r2.ebuild b/app-laptop/hdapsd/hdapsd-20141203-r2.ebuild
20 new file mode 100644
21 index 00000000000..490a8b858c1
22 --- /dev/null
23 +++ b/app-laptop/hdapsd/hdapsd-20141203-r2.ebuild
24 @@ -0,0 +1,73 @@
25 +# Copyright 1999-2021 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +inherit linux-info readme.gentoo-r1 systemd
30 +
31 +DESCRIPTION="IBM ThinkPad Hard Drive Active Protection System (HDAPS) daemon"
32 +HOMEPAGE="https://github.com/evgeni/hdapsd/"
33 +SRC_URI="https://github.com/evgeni/${PN}/releases/download/${PV}/${P}.tar.gz"
34 +
35 +LICENSE="GPL-2"
36 +SLOT="0"
37 +KEYWORDS="~amd64 ~x86"
38 +IUSE="libconfig"
39 +
40 +BDEPEND=""
41 +DEPEND="libconfig? ( dev-libs/libconfig:= )"
42 +RDEPEND="${DEPEND}"
43 +
44 +pkg_setup() {
45 + # We require the hdaps module which can either come from either the
46 + # kernel itself (CONFIG_SENSORS_HDAPS) or from the tp_smapi package.
47 + if ! has_version app-laptop/tp_smapi[hdaps]; then
48 + CONFIG_CHECK="~SENSORS_HDAPS"
49 + ERROR_SENSORS_HDAPS="${P} requires app-laptop/tp_smapi[hdaps] or "
50 + ERROR_SENSORS_HDAPS+="kernel support for CONFIG_SENSORS_HDAPS enabled"
51 + linux-info_pkg_setup
52 + fi
53 +}
54 +
55 +src_configure() {
56 + econf \
57 + $(use_enable libconfig) \
58 + --with-systemdsystemunitdir=$(systemd_get_systemunitdir) \
59 + --docdir="/usr/share/doc/${PF}"
60 +}
61 +
62 +src_install() {
63 + default
64 + newconfd "${FILESDIR}/hdapsd.conf-20141024" hdapsd
65 + newinitd "${FILESDIR}/hdapsd.init-20141024" hdapsd
66 + readme.gentoo_create_doc
67 +}
68 +
69 +pkg_postinst() {
70 + [[ -z $(ls "${ROOT}"sys/block/*/queue/protect 2>/dev/null) ]] && \
71 + [[ -z $(ls "${ROOT}"sys/block/*/device/unload_heads 2>/dev/null) ]] && \
72 + ewarn "Your kernel does NOT support shock protection."
73 +
74 + readme.gentoo_print_elog
75 +}
76 +
77 +DISABLE_AUTOFORMATTING=1
78 +DOC_CONTENTS="
79 +${PN} requires a kernel module to function properly. The recommended
80 +approach is to install app-laptop/tp_smapi[hdaps], but the in-tree
81 +module provided by CONFIG_SENSORS_HDAPS may work as well.
82 +
83 +Common daemon parameters can be set in ${EROOT}etc/conf.d/${PN}. If the
84 +package was installed with USE=libconfig, then the parameters can also
85 +be set in ${EROOT}etc/${PN}.conf, although the former will take
86 +precedence over the latter if both are used.
87 +
88 +You can change the default sampling rate by modifing
89 +
90 + /sys/devices/platform/hdaps/sampling_rate
91 +
92 +and you may need to enable shock protection manually by running
93 +
94 + # echo -1 > /sys/block/<disk>/device/unload_heads
95 +
96 +as root.
97 +"