/[gentoo-x86]/sys-kernel/linux-extras/linux-extras-2.4.4-r1.ebuild
Gentoo

Contents of /sys-kernel/linux-extras/linux-extras-2.4.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jul 17 23:31:35 2001 UTC (18 years, 7 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
removing old kernels

1 # Copyright 1999-2000 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License, v2 or later
3 # Author Daniel Robbins <drobbins@gentoo.org>
4 # $Header: /home/cvsroot/gentoo-x86/sys-kernel/linux-extras/linux-extras-2.4.4-r1.ebuild,v 1.1 2001/04/30 16:29:06 pete Exp $
5
6 #OKV=original kernel version, KV=patched kernel version
7 OKV=2.4.4
8 KV=2.4.4
9 S=${WORKDIR}/linux-${KV}
10 #Versions of LVM, ALSA, JFS and lm-sensors
11 LVMV=0.9.1_beta7
12 LVMVARC=0.9.1_beta7
13 AV=0.5.10b
14 JFSV=0.2.1
15 SENV=2.5.5
16 RV=20010327
17 XMLV=0.3
18 KNV="6.g"
19
20 [ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
21 [ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
22 [ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
23
24 SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2"
25 # http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-${JFSV}-patch.tar.gz
26 # http://download.sourceforge.net/xmlprocfs/linux-2.4-xmlprocfs-${XMLV}.patch.gz
27 # ftp://ftp.reiserfs.com/pub/reiserfs-for-2.4/linux-${OKV}-reiserfs-${RV}.patch.gz
28
29 [ "`use lm_sensors`" ] && SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz"
30 [ "`use lvm`" ] && SRC_URI="${SRC_URI} ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz"
31 [ "`use alsa`" ] && SRC_URI="${SRC_URI} ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2"
32
33 HOMEPAGE="http://www.kernel.org/
34 http://www.netroedge.com/~lm78/
35 http://www.namesys.com
36 http://www.sistina.com/lvm/
37 http://www.alsa-project.org"
38
39 [ "${PN}" = "linux" ] || [ "${PN}" = "linux-sources" ] && PROVIDE="virtual/kernel"
40
41 RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1"
42 DEPEND="dev-util/yacc sys-devel/flex >=sys-apps/modutils-2.4.0"
43
44 # this is not pretty...
45 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
46
47 if [ "`use lvm`" ]
48 then
49 echo '*** AaCCkK!! Right now, LVM is broken with this kernel.'
50 echo '*** If you don't use LVM, remove lvm from your USE variable.'
51 echo '*** If you DO use LVM, don't use this kernel package.'
52 echo '*** AFAIK, This kernel *is* safe to use without LVM.'
53 exit 1
54 fi
55
56 src_unpack() {
57 #unpack kernel and apply reiserfs-related patches
58 cd ${WORKDIR}
59 unpack linux-${OKV}.tar.bz2
60 mv linux linux-${KV}
61 cd ${S}
62
63 # echo "Applying ${KV} patch..."
64 # try bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1
65 # echo "Applying reiserfs-update patch..."
66 # try gzip -dc ${DISTDIR}/linux-2.4.2-reiserfs-${RV}.patch.gz | patch -N -p1
67 # echo "You can ignore the rejects the changes already are in rc11"
68
69 # echo
70 # echo "Applying xmlprocfs patch..."
71 # try gzip -dc ${DISTDIR}/linux-2.4-xmlprocfs-${XMLV}.patch.gz | patch -p1
72 # echo "Applying reiserfs-knfsd patch..."
73 # try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1
74
75 if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use lm_sensors`" ]
76 then
77 mkdir ${S}/extras
78 fi
79
80 if [ "`use lvm`" ]
81 then
82 #create and apply LVM patch. The tools get built later.
83 cd ${S}/extras
84 echo "Unpacking and applying LVM patch..."
85 unpack lvm_${LVMVARC}.tar.gz
86 cd LVM/${LVMV}
87
88 # I had to hack this in so that LVM will look in the current linux
89 # source directory instead of /usr/src/linux for stuff - pete
90 # try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
91
92 cd PATCHES
93 try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
94 cd ${S}
95 # the -l option allows this patch to apply cleanly (ignore whitespace changes)
96 try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
97 fi
98
99 if [ "`use alsa`" ]
100 then
101 #unpack alsa drivers
102 echo "Unpacking ALSA drivers..."
103 cd ${S}/extras
104 unpack alsa-driver-${AV}.tar.bz2
105 fi
106
107 if [ "`use lm_sensors`" ]
108 then
109 #unpack and apply the lm_sensors patch
110 echo "Unpacking and applying lm_sensors patch..."
111 cd ${S}/extras
112 unpack lm_sensors-${SENV}.tar.gz
113 cd lm_sensors-${SENV}
114 mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch
115 rmdir src
116 ln -s ../.. src
117 cp -a Makefile Makefile.orig
118 sed -e "s:^LINUX=.*:LINUX=src:" \
119 -e "s/^COMPILE_KERNEL.*/COMPILE_CERNEL := 0/" \
120 -e "s:^I2C_HEADERS.*:I2C_HEADERS=src/include:" \
121 -e "s#^DESTDIR.*#DESTDIR := ${D}#" \
122 -e "s#^PREFIX.*#PREFIX := /usr#" \
123 -e "s#^MANDIR.*#MANDIR := /usr/share/man#" \
124 Makefile.orig > Makefile
125 cd ${S}
126 patch -p1 < lm_sensors-patch
127 fi
128
129 #get sources ready for compilation or for sitting at /usr/src/linux
130 echo "Preparing for compilation..."
131 cd ${S}
132 #sometimes we have icky kernel symbols; this seems to get rid of them
133 try make mrproper
134 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
135 then
136 #this is the configuration for the default kernel
137 try cp ${FILESDIR}/${PVR}/config.bootcomp .config
138 try yes \"\" \| make oldconfig
139 echo '(Ignore any errors from the yes command above.)'
140 try make include/linux/version.h
141 fi
142 #fix silly permissions in tarball
143 cd ${WORKDIR}
144 chown -R 0.0 ${S}
145 chmod -R a+r-w+X,u+w ${S}
146 }
147
148 src_compile() {
149
150 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
151 then
152 try make symlinks
153
154 if [ "`use lvm`" ]
155 then
156 #LVM tools are included in the linux and linux-extras pakcages
157 cd ${S}/extras/LVM/${LVMV}
158
159 # I had to hack this in so that LVM will look in the current linux
160 # source directory instead of /usr/src/linux for stuff - pete
161 try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
162
163 try make
164 fi
165
166 if [ "`use lm_sensors`" ]
167 then
168 cd ${S}/extras/lm_sensors-${SENV}
169 try make
170 fi
171
172 if [ "`use alsa`" ]
173 then
174 cd ${S}/extras/alsa-driver-${AV}
175 try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
176 fi
177
178 cd ${S}
179
180 if [ "$PN" == "linux" ]
181 then
182 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
183 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage
184 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules
185
186 if [ "`use alsa`" ]
187 then
188 try make
189 fi
190 fi
191 fi
192 }
193
194 src_install() {
195 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
196 then
197 dodir /usr/lib
198
199 if [ "`use lvm`" ]
200 then
201 cd ${S}/extras/LVM/${LVMV}/tools
202
203 try CFLAGS=\"${CFLAGS} -I${S}/include\" make install -e prefix=${D} mandir=${D}/usr/share/man \
204 sbindir=${D}/sbin libdir=${D}/lib
205 #no need for a static library in /lib
206 mv ${D}/lib/*.a ${D}/usr/lib
207 fi
208
209 if [ "`use lm_sensors`" ]
210 then
211 #install sensors tools
212 cd ${S}/extras/lm_sensors-${SENV}
213 make install
214 fi
215
216 if [ "$(use alsa)" ]
217 then
218 #install ALSA progs
219 cd ${S}/extras/alsa-driver-${AV}
220 into /usr
221 dosbin snddevices
222 fi
223
224 if [ "$PN" = "linux" ]
225 then
226 dodir /usr/src
227
228 if [ "`use alsa`" ]
229 then
230 #install ALSA modules
231 cd ${S}/extras/alsa-driver-${AV}
232 dodir /lib/modules/${KV}/misc
233 cp modules/*.o ${D}/lib/modules/${KV}/misc
234
235 fi
236
237 dodir /usr/src/linux-${KV}
238 cd ${D}/usr/src
239 #grab includes and documentation only
240 # dodir /usr/src/linux-${KV}/include/linux
241 # dodir /usr/src/linux-${KV}/include/asm-i386
242 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
243 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
244 # dodir /usr/include
245 # dosym ../src/linux/include/linux /usr/include/linux
246 # dosym ../src/linux/include/asm-i386 /usr/include/asm
247
248 if [ "`use alsa`" ]
249 then
250 # get alsa includes
251 cd ${S}/extras/alsa-driver-${AV}
252 insinto /usr/src/linux-${KV}/include/linux
253 cd include
254 doins asound.h asoundid.h asequencer.h ainstr_*.h
255 fi
256
257 #grab compiled kernel
258 dodir /boot/boot
259 insinto /boot/boot
260 cd ${S}
261 doins arch/i386/boot/bzImage
262
263 #grab modules
264 # Do we have a bug in modutils ?
265 # Meanwhile we use this quick fix (achim)
266
267 install -d ${D}/lib/modules/`uname -r`
268 try make INSTALL_MOD_PATH=${D} modules_install
269 # rm -r ${D}/lib/modules/`uname -r`
270
271 depmod -b ${D} -F ${S}/System.map ${KV}
272
273 #fix symlink
274 cd ${D}/lib/modules/${KV}
275 rm build
276 ln -sf /usr/src/linux-${KV} build
277 fi
278 elif [ "${PN}" = "linux-sources" ]
279 then
280 dodir /usr/src
281
282 cd ${S}
283 make mrproper
284
285 if [ "`use lvm`" ]
286 then
287 cd ${S}/extras/LVM/${LVMV}
288 make distclean
289 fi
290
291 if [ "`use lm_sensors`" ]
292 then
293 cd ${S}/extras/lm_sensors-${SENV}
294 make clean
295 fi
296
297 if [ "`use alsa`" ]
298 then
299 # get alsa includes
300 cd ${S}/extras/alsa-driver-${AV}
301 insinto /usr/src/linux-${KV}/include/linux
302 cd include
303 doins asound.h asoundid.h asequencer.h ainstr_*.h
304 cd ${S}/extras/alsa-driver-${AV}
305 make distclean
306 fi
307
308 cp -ax ${S} ${D}/usr/src
309 fi
310 }
311
312 pkg_postinst() {
313 if [ "${ROOT}" = "/" ]
314 then
315 if [ "`use alsa`" ] ; then
316 echo "Creating sounddevices..."
317 /usr/sbin/snddevices
318 #needs to get fixed for devfs
319 fi
320 fi
321 rm -f ${ROOT}/usr/src/linux
322 ln -sf linux-${KV} ${ROOT}/usr/src/linux
323 }
324
325 pkg_postrm() {
326 rm -f ${ROOT}/usr/src/linux
327 rm -rf ${ROOT}/usr/src/linux-${KV}
328 }

  ViewVC Help
Powered by ViewVC 1.1.20