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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri May 25 23:10:31 2001 UTC (18 years, 10 months ago) by pete
Branch: MAIN
added linux-2.4.4-r5 stuff

1 pete 1.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     # /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp
5    
6     #OKV=original kernel version, KV=patched kernel version
7     OKV=2.4.4
8     KV=${OKV}
9     if [ "${PN}" = "linux-extras" ]
10     then
11     S=/usr/src/linux-${KV}
12     else
13     S=${WORKDIR}/linux-${KV}
14     fi
15    
16     # Versions of LVM
17     LVMV=0.9.1_beta7
18    
19     LVMVARC=0.9.1_beta7
20     # Versions of alsa
21     AV=0.5.11
22    
23     # Versionos of jfs
24     JFSV=0.2.1
25    
26     # Versions of lm_sensors
27     SENV=2.5.5
28    
29     # Versions of reiserfs
30     RV=20010327
31     KNV="6.g"
32     PIV="1.d"
33    
34     # Versions of xmlprocfs
35     XMLV=0.3
36    
37     # Versions of pcmcia-cs
38     PCV="3.1.25"
39    
40     # Version of XFS
41     XFSV=20010523
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" ]
50     then
51     SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
52     http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-2.4.4/linux-2.4.4-knfsd-6.g.patch.gz
53     http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-2.4.4/linux-2.4.4-procinfo-1.d.patch.gz
54     http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-2.4.4/reiserfs-quota-2.4.4.dif.bz2"
55     # http://www.kernel.org/pub/linux/kernel/people/alan/2.4/patch-${KV}.bz2
56     # http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-${JFSV}-patch.tar.gz
57     # http://download.sourceforge.net/xmlprocfs/linux-2.4-xmlprocfs-${XMLV}.patch.gz
58     # ftp://ftp.reiserfs.com/pub/reiserfs-for-2.4/linux-${OKV}-reiserfs-${RV}.patch.gz
59    
60     if [ "`use lm_sensors`" ]
61     then
62     SRC_URI="${SRC_URI} http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz"
63     fi
64     if [ "`use lvm`" ]
65     then
66     SRC_URI="${SRC_URI} ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz"
67     fi
68     if [ "`use alsa`" ]
69     then
70     SRC_URI="${SRC_URI} ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2"
71     fi
72     if [ "`use pcmcia-cs`" ]
73     then
74     SRC_URI="${SRC_URI} http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz"
75     fi
76     if [ "`use xfs`" ]
77     then
78     SRC_URI="${SRC_URI} ftp://ftp.ibiblio.org/pub/Linux/distributions/gentoo/gentoo-sources/linux-${KV}-xfs-${XFSV}-gentoo.diff.gz"
79     fi
80     fi
81    
82     if [ "${PN}" = "linux-extras" ]
83     then
84     DEPEND=">=sys-kernel/linux-sources-${PVR}"
85     RDEPEND=""
86     if [ "`use xfs`" ]
87     then
88     DEPEND="${DEPEND} >=sys-devel/autoconf-2.13 >=sys-devel/automake-1.4"
89     fi
90     elif [ "${PN}" = "linux" ]
91     then
92     PROVIDE="virtual/kernel"
93     if [ "`use alsa`" ]
94     then
95     PROVIDE="${PROVIDE} virtual/alsa"
96     fi
97     RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1"
98     DEPEND=">=sys-apps/modutils-2.4.2
99     >=sys-devel/flex-2.5.4a-r3
100     >=dev-util/yacc-1.9.1-r1"
101     else
102     if [ "`use alsa`" ]
103     then
104     PROVIDE="${PROVIDE} virtual/alsa"
105     fi
106     fi
107    
108     HOMEPAGE="http://www.kernel.org/
109     http://www.netroedge.com/~lm78/
110     http://www.namesys.com
111     http://www.sistina.com/lvm/
112     http://www.alsa-project.org
113     http://pcmcia-cs.sourceforge.net
114     http://linux-xfs.sgi.com/projects/xfs/"
115    
116     # this is not pretty...
117     LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
118    
119     src_unpack() {
120    
121     # We only need to unpack for linux and linux-sources
122    
123     if [ "${PN}" != "linux-extras" ]
124     then
125    
126     #unpack kernel and apply reiserfs-related patches
127     cd ${WORKDIR}
128     unpack linux-${OKV}.tar.bz2
129     try mv linux linux-${KV}
130     cd ${S}
131    
132     echo "Applying reiserfs-knfsd patch..."
133     try gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1
134     echo "Applying reiserfs-procinfo patch..."
135     try gzip -dc ${DISTDIR}/linux-${OKV}-procinfo-${PIV}.patch.gz | patch -p1
136     echo "Applying reiserfs-quota patch..."
137     try bzip2 -dc ${DISTDIR}/reiserfs-quota-${OKV}.dif.bz2 | patch -p1
138    
139     if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ]
140     then
141     mkdir -p ${S}/extras
142     fi
143    
144     if [ "`use xfs`" ]
145     then
146     cd ${S}
147     echo "Applying xfs patch..."
148     try gzip -dc ${DISTDIR}/linux-${KV}-xfs-${XFSV}-gentoo.diff.gz | patch -p1
149     fi
150    
151     if [ "`use lvm`" ]
152     then
153     #create and apply LVM patch. The tools get built later.
154     cd ${S}/extras
155     echo "Unpacking and applying LVM patch..."
156     unpack lvm_${LVMVARC}.tar.gz
157     try cd 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     cd PATCHES
164     try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
165     cd ${S}
166     # the -l option allows this patch to apply cleanly (ignore whitespace changes)
167     if [ "`use xfs`" ]
168     then
169     try patch -l -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-pre-lvm-gentoo.diff
170     fi
171     try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
172     cd ${S}/drivers/md
173     try patch -p0 < ${FILESDIR}/${PVR}/lvm.c.diff
174     fi
175    
176     if [ "`use alsa`" ]
177     then
178     #unpack alsa drivers
179     echo "Unpacking ALSA drivers..."
180     cd ${S}/extras
181     unpack alsa-driver-${AV}.tar.bz2
182     fi
183    
184     if [ "`use lm_sensors`" ]
185     then
186     #unpack and apply the lm_sensors patch
187     echo "Unpacking and applying lm_sensors patch..."
188     cd ${S}/extras
189     unpack lm_sensors-${SENV}.tar.gz
190     try cd lm_sensors-${SENV}
191     try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch
192     try rmdir src
193     try ln -s ../.. src
194     try cp -a Makefile Makefile.orig
195    
196     cd ${S}
197     try patch -p1 < lm_sensors-patch
198     fi
199    
200     if [ "`use xfs`" ]
201     then
202     echo "Applying xfs cleanup patch..."
203     try patch -p1 < ${FILESDIR}/${PVR}/linux-${KV}-xfs-${XFSV}-cleanup-gentoo.diff
204     fi
205    
206     if [ "`use pcmcia-cs`" ]
207     then
208     echo "Unpacking pcmcia-cs tools..."
209     cd ${S}/extras
210     unpack pcmcia-cs-${PCV}.tar.gz
211     patch -p0 < ${FILESDIR}/${PVR}/pcmcia-cs-${PCV}-gentoo.diff
212     fi
213     #get sources ready for compilation or for sitting at /usr/src/linux
214     echo "Preparing for compilation..."
215    
216     cd ${S}
217     #sometimes we have icky kernel symbols; this seems to get rid of them
218     try make mrproper
219     if [ "${PN}" = "linux" ]
220     then
221     #this is the configuration for the default kernel
222     try cp ${FILESDIR}/${PVR}/config.bootcomp .config
223     try yes \"\" \| make oldconfig
224     echo "Ignore any errors from the yes command above."
225     try make include/linux/version.h
226     fi
227     #fix silly permissions in tarball
228     cd ${WORKDIR}
229     chown -R 0.0 ${S}
230     chmod -R a+r-w+X,u+w ${S}
231     fi
232     }
233    
234     src_compile() {
235    
236     if [ "${PN}" != "linux-sources" ]
237     then
238     if [ "$PN" = "linux" ]
239     then
240     try make symlinks
241     fi
242    
243     if [ "`use lvm`" ]
244     then
245     #LVM tools are included in the linux and linux-extras pakcages
246     cd ${S}/extras/LVM/${LVMV}
247    
248     # This is needed for linux-extras
249     if [ -f "Makefile" ]
250     then
251     try make clean
252     fi
253     # I had to hack this in so that LVM will look in the current linux
254     # source directory instead of /usr/src/linux for stuff - pete
255     try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
256    
257     try make
258     fi
259    
260     if [ "`use lm_sensors`" ]
261     then
262     cd ${S}/extras/lm_sensors-${SENV}
263     try sed -e \''s:^LINUX=.*:LINUX=src:'\' \
264     -e \''s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/'\' \
265     -e \''s:^I2C_HEADERS.*:I2C_HEADERS=src/include:'\' \
266     -e \'"s#^DESTDIR.*#DESTDIR := ${D}#"\' \
267     -e \''s#^PREFIX.*#PREFIX := /usr#'\' \
268     -e \''s#^MANDIR.*#MANDIR := /usr/share/man#'\' \
269     Makefile.orig > Makefile
270    
271     try make
272     fi
273    
274     if [ "`use xfs`" ]
275     then
276     cd ${S}/extras/xfs-${XFSV}/acl
277     try make \
278     CPPFLAGS=\""-I${S}/include"\" \
279     configure
280     try make \
281     PKG_SBIN_DIR=/sbin \
282     PKG_INC_DIR=/usr/include/acl \
283     PKG_LIB_DIR=/usr/lib \
284     PKG_MAN_DIR=/usr/share/man \
285     CC=\""gcc -I${S}/include"\" \
286     OPTIMIZER=\""${CFLAGS}"\" \
287     DEBUG=\"\"
288    
289     cd ${S}/extras/xfs-${XFSV}/attr
290     try make \
291     CPPFLAGS=\""-I${S}/include"\" \
292     configure
293     try make \
294     PKG_SBIN_DIR=/bin \
295     PKG_INC_DIR=/usr/include/acl \
296     PKG_LIB_DIR=/usr/lib \
297     PKG_MAN_DIR=/usr/share/man \
298     CC=\""gcc -I${S}/include"\" \
299     OPTIMIZER=\""${CFLAGS}"\" \
300     DEBUG=\"\"
301    
302     cd ${S}/extras/xfs-${XFSV}/xfsprogs
303     try make \
304     CPPFLAGS=\""-I${S}/include"\" \
305     configure
306     try make \
307     PKG_SBIN_DIR=/sbin \
308     PKG_BIN_DIR=/usr/sbin \
309     PKG_INC_DIR=/usr/include/xfs \
310     PKG_LIB_DIR=/usr/lib \
311     PKG_MAN_DIR=/usr/share/man \
312     CC=\""gcc -I${S}/include"\" \
313     OPTIMIZER=\""${CFLAGS}"\" \
314     DEBUG=\"\"
315    
316     # dmapi and xfsdump must be built last, cuz they depend on libattr (in attr) and libxfs (in xfsprogs)
317     cd ${S}/extras/xfs-${XFSV}/dmapi
318     ln -sf ../../xfsprogs/include include/xfs
319     try make \
320     CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/dmapi/include"\" \
321     configure
322     try make \
323     PKG_INC_DIR=/usr/include/dmapi \
324     PKG_LIB_DIR=/usr/lib \
325     PKG_MAN_DIR=/usr/share/man \
326     CC=\""gcc -I${S}/include"\" \
327     OPTIMIZER=\""${CFLAGS}"\" \
328     DEBUG=\"\"
329    
330     cd ${S}/extras/xfs-${XFSV}/xfsdump
331     ln -sf ../../xfsprogs/include include/xfs
332     ln -sf ../../attr/include include/attr
333     try make \
334     CPPFLAGS=\""-I${S}/include -I${S}/extras/xfs-${XFSV}/xfsdump/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \
335     LDFLAGS=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\" \
336     configure
337     try make \
338     PKG_BIN_DIR=/usr/sbin \
339     PKG_LIB_DIR=/usr/lib \
340     PKG_MAN_DIR=/usr/share/man \
341     CC=\""gcc -I${S}/include -I${S}/extras/xfs-${XFSV}/xfsprogs/include -I${S}/extras/xfs-${XFSV}/attr/include"\" \
342     OPTIMIZER=\""${CFLAGS}"\" \
343     DEBUG=\"\" \
344     LIBATTR=\""-L${S}/extras/xfs-${XFSV}/attr/libattr -lattr"\" \
345     LIBXFS=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libxfs -lxfs"\" \
346     LIBHANDLE=\""-L${S}/extras/xfs-${XFSV}/xfsprogs/libhandle -lhandle"\"
347    
348     fi
349    
350     cd ${S}
351    
352     if [ "${PN}" == "linux" ]
353     then
354     try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
355     try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage
356     #LEX=\""flex -l"\" bzImage
357     try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules
358     #LEX=\""flex -l"\" modules
359     fi
360    
361     # This must come after the kernel compilation in linux
362     if [ "`use alsa`" ]
363     then
364     cd ${S}/extras/alsa-driver-${AV}
365     # This is needed for linux-extras
366     if [ -f "Makefile.conf" ]
367     then
368     try make clean
369     fi
370     try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
371     try make
372     fi
373     if [ "`use pcmcia-cs`" ]
374     then
375     cd ${S}/extras/pcmcia-cs-${PCV}
376     # This is needed for linux-extras
377     if [ -f "Makefile" ]
378     then
379     try make clean
380     fi
381     try ./Configure -n --kernel=${S} --moddir=/lib/modules/${KV} \
382     --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
383     try make all
384     fi
385     fi
386     }
387    
388     src_install() {
389    
390     # We install the alsa headers in all three packages
391     if [ "`use alsa`" ]
392     then
393     # get alsa includes
394     cd ${S}/extras/alsa-driver-${AV}
395     insinto /usr/src/linux-${KV}/include/linux
396     cd include
397     doins asound.h asoundid.h asequencer.h ainstr_*.h
398     fi
399    
400     if [ "${PN}" != "linux-sources" ]
401     then
402     dodir /usr/lib
403    
404     if [ "`use lvm`" ]
405     then
406     cd ${S}/extras/LVM/${LVMV}/tools
407    
408     try CFLAGS=\""${CFLAGS} -I${S}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \
409     sbindir=${D}/sbin libdir=${D}/lib
410     #no need for a static library in /lib
411     mv ${D}/lib/*.a ${D}/usr/lib
412     fi
413    
414     if [ "`use lm_sensors`" ]
415     then
416     echo "Install sensor tools..."
417     #install sensors tools
418     cd ${S}/extras/lm_sensors-${SENV}
419     make install
420     fi
421    
422     if [ "`use xfs`" ]
423     then
424     cd ${S}/extras/xfs-${XFSV}/acl
425     chmod +x install.sh
426     try make \
427     PKG_SBIN_DIR=${D}/sbin \
428     PKG_INC_DIR=${D}/usr/include/acl \
429     PKG_LIB_DIR=${D}/usr/lib \
430     PKG_MAN_DIR=${D}/usr/share/man \
431     install install-dev
432     rm -rf ${D}/usr/share/doc/acl
433     docinto xfs-${XFSV}/acl
434     dodoc README doc/CHANGES doc/COPYING doc/PORTING
435    
436     cd ${S}/extras/xfs-${XFSV}/attr
437     chmod +x install.sh
438     try make \
439     PKG_SBIN_DIR=${D}/bin \
440     PKG_INC_DIR=${D}/usr/include/acl \
441     PKG_LIB_DIR=${D}/usr/lib \
442     PKG_MAN_DIR=${D}/usr/share/man \
443     install install-dev
444     rm -rf ${D}/usr/share/doc/attr
445     docinto xfs-${XFSV}/attr
446     dodoc README doc/CHANGES doc/COPYING doc/PORTING
447    
448     cd ${S}/extras/xfs-${XFSV}/xfsprogs
449     chmod +x install.sh
450     try make \
451     PKG_SBIN_DIR=${D}/sbin \
452     PKG_BIN_DIR=${D}/usr/sbin \
453     PKG_INC_DIR=${D}/usr/include/xfs \
454     PKG_LIB_DIR=${D}/usr/lib \
455     PKG_MAN_DIR=${D}/usr/share/man \
456     install install-dev
457     rm -rf ${D}/usr/share/doc/xfsprogs
458     docinto xfs-${XFSV}/xfsprogs
459     dodoc README doc/CHANGES doc/COPYING docs/CREDITS doc/PORTING doc/README.LVM doc/README.quota
460    
461     cd ${S}/extras/xfs-${XFSV}/dmapi
462     chmod +x install.sh
463     try make \
464     PKG_INC_DIR=${D}/usr/include/dmapi \
465     PKG_LIB_DIR=${D}/usr/lib \
466     PKG_MAN_DIR=${D}/usr/share/man \
467     install install-dev
468     rm -rf ${D}/usr/share/doc/dmapi
469     docinto xfs-${XFSV}/dmapi
470     dodoc README doc/CHANGES doc/COPYING doc/PORTING
471    
472     cd ${S}/extras/xfs-${XFSV}/xfsdump
473     chmod +x install.sh
474     try make \
475     PKG_BIN_DIR=${D}/usr/sbin \
476     PKG_LIB_DIR=${D}/usr/lib \
477     PKG_MAN_DIR=${D}/usr/share/man \
478     install install-dev
479     rm -rf ${D}/usr/share/doc/xfsprogs
480     docinto xfs-${XFSV}/xfsprogs
481     dodoc README doc/CHANGES doc/COPYING doc/PORTING doc/README.xfsdump
482     fi
483    
484     if [ "${PN}" = "linux" ]
485     then
486     dodir /usr/src
487    
488     dodir /usr/src/linux-${KV}
489     cd ${D}/usr/src
490     #grab includes and documentation only
491     echo ">>> Copying includes and documentation..."
492     cp -ax ${S}/include ${D}/usr/src/linux-${KV}
493     cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
494    
495     #grab compiled kernel
496     dodir /boot/boot
497     insinto /boot/boot
498     cd ${S}
499     doins arch/i386/boot/bzImage
500    
501     #grab modules
502     # Do we have a bug in modutils ?
503     # Meanwhile we use this quick fix (achim)
504    
505     install -d ${D}/lib/modules/`uname -r`
506     try make INSTALL_MOD_PATH=${D} modules_install
507    
508     depmod -b ${D} -F ${S}/System.map ${KV}
509     # rm -rf ${D}/lib/modules/`uname -r`
510     #fix symlink
511     cd ${D}/lib/modules/${KV}
512     rm build
513     ln -sf /usr/src/linux-${KV} build
514     fi
515    
516     if [ "`use alsa`" ]
517     then
518     #install ALSA modules
519     cd ${S}/extras/alsa-driver-${AV}
520     dodoc INSTALL FAQ
521     dodir /lib/modules/${KV}/misc
522     cp modules/*.o ${D}/lib/modules/${KV}/misc
523     fi
524     if [ "`use pcmcia-cs`" ]
525     then
526     #install PCMCIA modules and utilities
527     cd ${S}/extras/pcmcia-cs-${PCV}
528     try make PREFIX=${D} install
529     rm -rf ${D}/etc/rc.d
530     exeinto /etc/rc.d/init.d
531     doexe ${FILESDIR}/${PVR}/pcmcia
532     fi
533    
534     else
535     dodir /usr/src
536    
537     cd ${S}
538     make mrproper
539    
540     echo ">>> Copying sources..."
541     cp -ax ${S} ${D}/usr/src
542    
543     #don't overwrite existing .config if present
544     cd ${D}/usr/src/linux-${KV}
545     if [ -e .config ]
546     then
547     cp -a .config .config.eg
548     fi
549     fi
550     }
551    
552     pkg_postinst() {
553     if [ "${PN}" != "linux-extras" ]
554     then
555     rm -f ${ROOT}/usr/src/linux
556     ln -sf linux-${KV} ${ROOT}/usr/src/linux
557     fi
558    
559     #copy over our .config if one isn't already present
560     cd ${ROOT}/usr/src/linux-${KV}
561     if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
562     then
563     cp -a .config.eg .config
564     fi
565     }
566    
567     #pkg_postrm() {
568     #
569     # rm -f ${ROOT}/usr/src/linux
570     # rm -rf ${ROOT}/usr/src/linux-${KV}
571     #}

  ViewVC Help
Powered by ViewVC 1.1.20