Gentoo Archives: gentoo-commits

From: "Peter Weller (welp)" <welp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-laptop/hdapsd: ChangeLog hdapsd-20060409-r3.ebuild hdapsd-20060409-r2.ebuild
Date: Mon, 20 Oct 2008 08:45:29
Message-Id: E1KrqOE-0002rd-JZ@stork.gentoo.org
1 welp 08/10/20 08:45:26
2
3 Modified: ChangeLog
4 Added: hdapsd-20060409-r3.ebuild
5 Removed: hdapsd-20060409-r2.ebuild
6 Log:
7 Fix typo in initscript; Bug 196052
8 (Portage version: 2.2_rc12/cvs/Linux 2.6.27-gentoomarx x86_64)
9
10 Revision Changes Path
11 1.10 app-laptop/hdapsd/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/hdapsd/ChangeLog?rev=1.10&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/hdapsd/ChangeLog?rev=1.10&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/hdapsd/ChangeLog?r1=1.9&r2=1.10
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v
20 retrieving revision 1.9
21 retrieving revision 1.10
22 diff -u -r1.9 -r1.10
23 --- ChangeLog 30 Mar 2008 22:29:51 -0000 1.9
24 +++ ChangeLog 20 Oct 2008 08:45:26 -0000 1.10
25 @@ -1,6 +1,12 @@
26 # ChangeLog for app-laptop/hdapsd
27 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.9 2008/03/30 22:29:51 welp Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/ChangeLog,v 1.10 2008/10/20 08:45:26 welp Exp $
30 +
31 +*hdapsd-20060409-r3 (20 Oct 2008)
32 +
33 + 20 Oct 2008; <welp@g.o> files/hdapsd.init,
34 + -hdapsd-20060409-r2.ebuild, +hdapsd-20060409-r3.ebuild:
35 + Fix typo in initscript; Bug 196052
36
37 *hdapsd-20060409-r2 (30 Mar 2008)
38
39
40
41
42 1.1 app-laptop/hdapsd/hdapsd-20060409-r3.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/hdapsd/hdapsd-20060409-r3.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-laptop/hdapsd/hdapsd-20060409-r3.ebuild?rev=1.1&content-type=text/plain
46
47 Index: hdapsd-20060409-r3.ebuild
48 ===================================================================
49 # Copyright 1999-2008 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/app-laptop/hdapsd/hdapsd-20060409-r3.ebuild,v 1.1 2008/10/20 08:45:26 welp Exp $
52
53 inherit eutils linux-info
54
55 PROTECT_VER="2"
56
57 DESCRIPTION="IBM ThinkPad Harddrive Active Protection disk head parking daemon"
58 HOMEPAGE="http://hdaps.sourceforge.net/"
59 SRC_URI="mirror://gentoo/${P}.c.bz2
60 mirror://gentoo/hdaps_protect-patches-${PROTECT_VER}.tar.bz2"
61
62 LICENSE="GPL-2"
63 SLOT="0"
64 KEYWORDS="~x86"
65
66 IUSE=""
67 RDEPEND=""
68
69 S="${WORKDIR}"
70
71 src_compile() {
72 # We require the hdaps module; problem is that it can come from either
73 # kernel sources or from the tp_smapi package. This hack is required because
74 # the linux-info eclass doesn't export any more suitable config checkers.
75 # Here we just skip calling its pkg_setup() in case the module is provided
76 # by the package.
77
78 if ! has_version app-laptop/tp_smapi || ! built_with_use app-laptop/tp_smapi hdaps; then
79 CONFIG_CHECK="SENSORS_HDAPS"
80 ERROR_SENSORS_HDAPS="${P} requires support for HDAPS (CONFIG_SENSORS_HDAPS)"
81 linux-info_pkg_setup
82 fi
83
84 cd "${WORKDIR}"
85 gcc ${CFLAGS} "${P}".c -o hdapsd || die "failed to compile"
86 }
87
88 src_install() {
89 dosbin "${WORKDIR}"/hdapsd
90 newconfd "${FILESDIR}"/hdapsd.conf hdapsd
91 newinitd "${FILESDIR}"/hdapsd.init hdapsd
92
93 # Install our kernel patches
94 dodoc *.patch "${FILESDIR}"/hdaps-Z60m.patch
95 }
96
97 # Yes, this sucks as the source location may change, kernel sources may not be
98 # installed, but we try our best anyway
99 kernel_patched() {
100 get_version
101
102 if grep -qs "blk_protect_register" "${KERNEL_DIR}"/block/ll_rw_blk.c ; then
103 einfo "Your kernel has already been patched for blk_freeze"
104 return 0
105 fi
106
107 return 1
108 }
109
110 pkg_config() {
111 kernel_patched && return 0
112
113 local docdir="${ROOT}/usr/share/doc/${PF}/"
114 local p="hdaps_protect-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.patch.gz"
115
116 # We need to find our FILESDIR as it's now lost
117 if [[ ! -e ${docdir}/${p} ]] ; then
118 eerror "We don't have a patch for kernel ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} yet"
119 return 1
120 fi
121
122 if [[ ! -d ${KERNEL_DIR} ]] ; then
123 eerror "Kernel sources not found!"
124 return 1
125 fi
126
127 cd "${KERNEL_DIR}"
128 epatch "${docdir}/${p}"
129
130 # This is just a nice to have for me as I use a Z60m myself
131 if ! grep -q "Z60m" "${KERNEL_DIR}"/drivers/hwmon/hdaps.c ; then
132 epatch "${docdir}"/hdaps-Z60m.patch.gz
133 fi
134
135 echo
136 einfo "Now you should rebuild your kernel, its modules"
137 einfo "and then install them."
138 }
139
140 pkg_postinst(){
141 [[ -n $(ls "${ROOT}"/sys/block/*/queue/protect 2>/dev/null) ]] && return 0
142
143 if ! kernel_patched ; then
144 ewarn "Your kernel has NOT been patched for blk_freeze"
145 elog "The ebuild can attempt to patch your kernel like so"
146 elog " emerge --config =${PF}"
147 fi
148 }