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

Contents of /sys-kernel/linux-extras/linux-extras-2.4.8.8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Oct 12 03:59:47 2001 UTC (18 years, 5 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
massive cleanup

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.8.8.ebuild,v 1.3 2001/08/29 16:04:19 drobbins Exp $
5
6 #OKV=original kernel version, KV=patched kernel version
7
8 OKV=2.4.8
9 KV=2.4.8-ac8
10 S=${WORKDIR}/linux-${KV}
11 S2=${WORKDIR}/linux-${KV}-extras
12 if [ $PN = "linux-extras" ]
13 then
14 KS=${ROOT}usr/src/linux-${KV}
15 KS2=${ROOT}usr/src/linux-${KV}-extras
16 else
17 KS=${S}
18 KS2=${S2}
19 fi
20
21 # Kernel Features Enabled USE Variable Status
22 #
23 # Reiserfs Y - Production-ready
24 # JFS N jfs Testing-only (commented out for now)
25 # LVM Y lvm almost production-ready (still has race conditions during pvmove)
26 # ext3 Y ext3 Production-ready
27 # MOSIX Y mosix Testing only
28 # XFS N xfs Will add soon
29 # PCMCIA-CS N pcmcia Need to move this to its own ebuild
30 # lm-sensors N lm_sensors Need to move this to its own ebuild
31
32 LVMV=1.0.1-rc1
33 #EXT3V=2.4-0.9.2-246
34 #MOSV=1.1.2
35 CLOOPV=0.61
36 CLOOPAV=0.61-1
37 # AV=0.5.11
38 #JFSV=1.0.0
39 #KNV="6.g"
40 #PIV="1.d"
41 #PCV="3.1.27"
42
43 [ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
44 [ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
45 [ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
46
47 # We use build in /usr/src/linux in case of linux-extras
48 # so we need no sources
49 if [ ! "${PN}" = "linux-extras" ] ; then
50 SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
51 http://www.kernel.org/pub/linux/kernel/people/alan/linux-2.4/${OKV}/patch-${KV}.bz2
52 ftp://ftp.sistina.com/pub/LVM/1.0/lvm_${LVMV}.tar.gz
53 http://www.knopper.net/download/knoppix/cloop_${CLOOPAV}.tar.gz
54 http://www.ibiblio.org/gentoo/distfiles/lvm-1.0.1-rc1-2.4.8-ac8.patch.bz2
55 http://www.ibiblio.org/gentoo/distfiles/lvm_perl_to_bash.patch.bz2"
56 fi
57 # http://www.zip.com.au/~akpm/ext3-${EXT3V}.gz
58 # http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-1.0.0-patch.tar.gz
59 # ftp://ftp.cs.huji.ac.il/users/mosix/MOSIX-${MOSV}.tar.gz
60 # http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz
61 # http://www.netroedge.com/~lm78/archive/i2c-${SENV}.tar.gz
62 # http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz
63
64 if [ "$PN" != "linux-extras" ]
65 then
66 PROVIDE="virtual/kernel"
67 fi
68
69 HOMEPAGE="http://www.kernel.org/
70 http://www.namesys.com
71 http://www.sistina.com/lvm/"
72
73 DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
74 #these deps are messed up; fix 'em and add ncurses (required my mosix compile, menuconfig)
75 if [ $PN = "linux" ]
76 then
77 # RDEPEND="mosix? ( ~sys-apps/mosix-user-${MOSV} ) >=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
78 RDEPEND=">=sys-apps/e2fsprogs-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
79 elif [ $PN = "linux-sources" ]
80 then
81 if [ "`use build`" ]
82 then
83 DEPEND=""
84 RDEPEND=""
85 else
86 #ncurses is required for "make menuconfig"
87 RDEPEND=">=sys-libs/ncurses-5.2"
88 fi
89 elif [ $PN = "linux-extras" ]
90 then
91 #linux-extras/headers requires a rev of the current kernel sources to be installed
92 RDEPEND="~sys-kernel/linux-sources-${PV}"
93 elif [ $PN = "linux-headers" ]
94 then
95 DEPEND=""
96 RDEPEND=""
97 fi
98
99 # this is not pretty...
100 LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${KS}/include"
101
102 src_unpack() {
103 if [ "$PN" = "linux-extras" ]
104 then
105 return
106 fi
107
108 mkdir ${S2}
109
110 #unpack kernel and apply reiserfs-related patches
111 cd ${WORKDIR}
112 unpack linux-${OKV}.tar.bz2
113 try mv linux linux-${KV}
114 cd ${S}
115 if [ "$KV" != "$OKV" ]
116 then
117 echo "Applying ${KV} patch..."
118 bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1 || die
119 fi
120 dodir /usr/src/linux-${KV}-extras
121
122 #### Mosix
123 # if [ "`use mosix`" ]
124 # then
125 # echo "Applying MOSIX patch..."
126 # cd ${S2}
127 # mkdir MOSIX-${MOSV}
128 # cd MOSIX-${MOSV}
129 # tar xzf MOSIX-${MOSV}.tar.gz patches.${OKV} kernel.new.${OKV}.tar
130 # cd ${S}
131 # try cat ${S2}/MOSIX-${MOSV}/patches.${KV} | patch -p0
132 # tar -x --no-same-owner -vf ${S2}/MOSIX-${MOSV}/kernel.new.${KV}.tar
133 # fi
134 #### Mosix
135 if [ "`use lvm`" ]
136 then
137 #create and apply LVM patch. The tools get built later.
138 cd ${S2}
139 echo "Unpacking and applying LVM patch..."
140 unpack lvm_${LVMV}.tar.gz
141 #cd LVM/${LVMV}
142 #We need to convert those 1.0.1-rc1 perl scripts to bash; This'll be fixed in 1.0.1 final. Thanks AJ :)
143 #cat ${DISTDIR}/lvm_perl_to_bash.patch.bz2 | bzip2 -d | patch -p1 || die
144
145 # I had to hack this in so that LVM will look in the current linux
146 # source directory instead of /usr/src/linux for stuff - pete
147 #CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}" || die
148 #cd PATCHES
149 #make KERNEL_VERSION=${KV} KERNEL_DIR=${S} || die
150 #cd ${S}
151 # the -l option allows this patch to apply cleanly (ignore whitespace changes)
152 # the -N option is an "auto no" to previously applied stuff. Needed for 2.4.8-ac8
153
154 #patch -N -l -p1 < ${S2}/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
155 cd ${S}
156 cat ${DISTDIR}/lvm-1.0.1-rc1-2.4.8-ac8.patch.bz2 | bzip2 -d | patch -N -l -p1
157 #|| die
158 #we removed || die because any stuff that hits -N causes an error code of 1
159 fi
160
161 # if [ "`use lm_sensors`" ]
162 # then
163 # #unpack and apply the lm_sensors patch
164 # echo "Unpacking and applying lm_sensors patch..."
165 # cd ${S}/extras
166 # unpack lm_sensors-${SENV}.tar.gz
167 # unpack i2c-${SENV}.tar.gz
168 # cd i2c-${SENV}
169 # try rmdir src
170 # try ln -s ../.. src
171 # try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
172 # cp Makefile Makefile.orig
173 # try sed -e \"s:^LINUX=.*:LINUX=src:\" \
174 # -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
175 # -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
176 # -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
177 # -e \"s#^PREFIX.*#PREFIX := /usr#\" \
178 # -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
179 # Makefile.orig > Makefile
180 # cd ${S}/extras/lm_sensors-${SENV}
181 # try rmdir src
182 # try ln -s ../.. src
183 # try ln -s ../i2c-${SENV} i2c-src
184 # try mkpatch/mkpatch.pl . /usr/src/linux | patch -p1 -E -d /usr/src/linux
185 # try sed -e \"s:^LINUX=.*:LINUX=src:\" \
186 # -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 2/\" \
187 # -e \"s:^I2C_HEADERS.*:I2C_HEADERS=.i2c-src/kernel:\" \
188 # -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
189 # -e \"s#^PREFIX.*#PREFIX := /usr#\" \
190 # -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
191 # Makefile.orig > Makefile
192 # fi
193 # if [ "`use pcmcia-cs`" ]
194 # then
195 # echo "Unpacking pcmcia-cs tools..."
196 # cd ${S2}
197 # unpack pcmcia-cs-${PCV}.tar.gz
198 # patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff
199 # fi
200
201 #JFS patch works; commented out because it's not ready for production use
202 #if [ "`use jfs`" ]
203 #then
204 # echo "Applying JFS patch..."
205 # cd ${WORKDIR}
206 # unpack jfs-${JFSV}-patch.tar.gz
207 # cd ${S}
208 # patch -p1 < ${WORKDIR}/jfs-common-v1.0.0-patch
209 # patch -p1 < ${WORKDIR}/jfs-2.4.5-v1.0.0-patch
210 #fi
211
212 # if [ "`use ext3`" ]
213 # then
214 # echo "Applying ext3 patch..."
215 ### Mosix
216 # if [ "`use mosix`" ]
217 # then
218 # echo
219 # echo "There will be one reject; we will fix it. (no worries)"
220 # echo
221 # fi
222 ### Mosix
223 # cd ${S}
224 # gzip -dc ${DISTDIR}/ext3-${EXT3V}.gz | patch -l -p1
225 ### Mosix
226 # if [ "`use mosix`" ]
227 # then
228 # echo
229 # echo "Fixing reject in include/linux/sched.h..."
230 # echo
231 # cp ${FILESDIR}/${PVR}/sched.h include/linux
232 # fi
233 ### Mosix
234 # fi
235
236 cd ${S2}
237 unpack cloop_${CLOOPAV}.tar.gz
238
239 #get sources ready for compilation or for sitting at /usr/src/linux
240 echo "Preparing for compilation..."
241 cd ${S}
242 #sometimes we have icky kernel symbols; this seems to get rid of them
243 try make mrproper
244
245 #linux-sources needs to be fully configured, too. Not just linux
246 #this is the configuration for the default kernel
247 try cp ${FILESDIR}/${PVR}/config.bootcd .config
248 yes "" | make oldconfig
249 echo "Ignore any errors from the yes command above."
250
251 #fix silly permissions in tarball
252 cd ${WORKDIR}
253 chown -R 0.0 *
254 chmod -R a+r-w+X,u+w *
255 }
256
257 src_compile() {
258 if [ "${PN}" = "linux-sources" ] || [ "${PN}" = "linux-headers" ]
259 then
260 cd ${KS}
261 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep || die
262 else
263 if [ $PN = "linux" ]
264 then
265 cd ${KS}
266 make symlinks || die
267 fi
268 if [ "`use lvm`" ]
269 then
270 #LVM tools are included in the linux and linux-extras pakcages
271 cd ${KS2}/LVM/${LVMV}
272
273 # This is needed for linux-extras
274 if [ -f "Makefile" ]
275 then
276 make clean || die
277 fi
278 # I had to hack this in so that LVM will look in the current linux
279 # source directory instead of /usr/src/linux for stuff - pete
280 CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}" || die
281 make || die
282 fi
283
284 # if [ "`use lm_sensors`" ]
285 # then
286 # cd ${KS}/extras/lm_sensors-${SENV}
287 # try make
288 # fi
289
290 # Works, just commented out because JFS isn't ready to be used by non-developers
291 # if [ "`use jfs`" ]
292 # then
293 # cd ${S}/fs/jfs/utils
294 # try make
295 # cd output
296 # into /
297 # dosbin *
298 # doman `find -iname *.8`
299 # fi
300
301 if [ "$PN" == "linux" ]
302 then
303 cd ${KS}
304 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep || die
305 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" bzImage || die
306 make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" LEX="flex -l" modules || die
307 fi
308
309 # if [ "`use pcmcia-cs`" ]
310 # then
311 # cd ${KS2}/pcmcia-cs-${PCV}
312 # # This is needed for linux-extras
313 # if [ -f "Makefile" ]
314 # then
315 # try make clean
316 # fi
317 # try ./Configure -n --kernel=${KS} --moddir=/lib/modules/${KV} \
318 # --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
319 # try make all
320 # fi
321
322 cd ${KS2}/cloop-${CLOOPV}
323 make KERNEL_DIR=${KS}
324 fi
325 }
326
327 src_install() {
328 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
329 then
330 dodir /usr/lib
331
332 if [ "`use lvm`" ]
333 then
334 cd ${KS2}/LVM/${LVMV}/tools
335
336 CFLAGS="${CFLAGS} -I${KS}/include" try make install -e prefix=${D} mandir=${D}/usr/share/man \
337 sbindir=${D}/sbin libdir=${D}/lib
338 #no need for a static library in /lib
339 mv ${D}/lib/*.a ${D}/usr/lib
340 fi
341
342 # if [ "`use lm_sensors`" ]
343 # then
344 # echo "Install sensor tools..."
345 # #install sensors tools
346 # cd ${KS}/extras/lm_sensors-${SENV}
347 # make install
348 # fi
349
350 if [ "${PN}" = "linux" ]
351 then
352 dodir /usr/src/linux-${KV}
353 cd ${D}/usr/src
354 #grab includes and documentation only
355 echo ">>> Copying includes and documentation..."
356 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
357 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
358
359 #grab compiled kernel
360 dodir /boot/boot
361 insinto /boot/boot
362 cd ${S}
363 doins arch/i386/boot/bzImage
364
365 #grab modules
366 # Do we have a bug in modutils ?
367 # Meanwhile we use this quick fix (achim)
368
369 install -d ${D}/lib/modules/`uname -r`
370 try make INSTALL_MOD_PATH=${D} modules_install
371
372 cd ${S}
373 depmod -b ${D} -F ${S}/System.map ${KV}
374 #rm -rf ${D}/lib/modules/`uname -r`
375 #fix symlink
376 cd ${D}/lib/modules/${KV}
377 rm build
378 ln -sf /usr/src/linux-${KV} build
379 fi
380
381 # if [ "`use pcmcia-cs`" ]
382 # then
383 # #install PCMCIA modules and utilities
384 # cd ${KS2}/pcmcia-cs-${PCV}
385 # try make PREFIX=${D} MANDIR=${D}/usr/share/man install
386 # rm -rf ${D}/etc/rc.d
387 # exeinto /etc/rc.d/init.d
388 # doexe ${FILESDIR}/${KV}/pcmcia
389 # fi
390
391 cd ${KS2}/cloop-${CLOOPV}
392 insinto /lib/modules/${KV}/kernel/drivers/block
393 doins cloop.o
394 into /usr
395 dobin create_compressed_fs extract_compressed_fs
396
397 if [ "`use bootcd`" ]
398 then
399 rm -rf ${D}/usr/include ${D}/usr/lib/lib*.a ${D}/usr/src
400 fi
401
402 elif [ "$PN" = "linux-sources" ]
403 then
404 dodir /usr/src
405 cd ${S}
406 echo ">>> Copying sources..."
407 cp -ax ${WORKDIR}/* ${D}/usr/src
408 elif [ "$PN" = "linux-headers" ]
409 then
410 dodir /usr/include/linux
411 cp -ax ${KS}/include/linux/* ${D}/usr/include/linux
412 dodir /usr/include/asm
413 cp -ax ${KS}/include/asm-i386/* ${D}/usr/include/asm
414 fi
415 if [ -d ${D}/usr/src/linux-${KV} ]
416 then
417 #don't overwrite existing .config if present
418 cd ${D}/usr/src/linux-${KV}
419 if [ -e .config ]
420 then
421 cp -a .config .config.eg
422 fi
423 fi
424 }
425
426 pkg_preinst() {
427 if [ "$PN" = "linux-headers" ]
428 then
429 if [ -L ${ROOT}usr/include/linux ]
430 then
431 rm ${ROOT}usr/include/linux
432 fi
433 if [ -L ${ROOT}usr/include/asm ]
434 then
435 rm ${ROOT}usr/include/asm
436 fi
437 fi
438 }
439
440 pkg_postinst() {
441 if [ "$PN" = "linux-extras" ] || [ "$PN" = "linux-headers" ]
442 then
443 return
444 fi
445 rm -f ${ROOT}/usr/src/linux
446 ln -sf linux-${KV} ${ROOT}/usr/src/linux
447
448 #copy over our .config if one isn't already present
449 cd ${ROOT}/usr/src/linux-${KV}
450 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
451 then
452 cp -a .config.eg .config
453 fi
454 }

  ViewVC Help
Powered by ViewVC 1.1.20