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