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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations) (download)
Fri Oct 12 03:59:47 2001 UTC (18 years, 4 months ago) by drobbins
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +0 -0 lines
FILE REMOVED
massive cleanup

1 drobbins 1.7 # 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=2.4.4-ac9
9     S=${WORKDIR}/linux-${KV}
10    
11     # Versions of LVM
12     LVMV=0.9.1_beta7
13    
14     LVMVARC=0.9.1_beta7
15     # Versions of alsa
16     AV=0.5.11
17    
18     # Versionos of jfs
19     JFSV=0.2.1
20    
21     # Versions of lm_sensors
22     SENV=2.5.5
23    
24     # Versions of reiserfs
25     RV=20010327
26     KNV="6.g"
27     PIV="1.d"
28    
29     # Versions of xmlprocfs
30     XMLV=0.3
31    
32     # Versions of pcmcia-cs
33     PCV="3.1.26"
34    
35     [ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
36     [ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
37     [ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
38    
39     # We use build in /usr/src/linux in case of linux-extras
40     # so we need no sources
41     if [ ! "${PN}" = "linux-extras" ] ; then
42     SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
43 drobbins 1.8 http://www.kernel.org/pub/linux/kernel/people/alan/linux-2.4/${OKV}/patch-${KV}.bz2
44 drobbins 1.7 http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-2.4.4/linux-2.4.4-knfsd-6.g.patch.gz
45     http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-2.4.4/linux-2.4.4-procinfo-1.d.patch.gz
46     http://dice.mfa.kfki.hu/download/reiserfs-3.6.25-2.4.4/reiserfs-quota-2.4.4.dif.bz2
47     http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz
48     ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz
49     ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2
50     http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz"
51     fi
52    
53     if [ "$PN" != "linux-extras" ]
54     then
55     PROVIDE="virtual/kernel"
56     fi
57     if [ "$PN" != "linux-sources" ]
58     then
59     if [ "`use alsa`" ]
60     then
61     PROVIDE="$PROVIDE virtual/alsa"
62     fi
63     fi
64    
65     HOMEPAGE="http://www.kernel.org/
66     http://www.netroedge.com/~lm78/
67     http://www.namesys.com
68     http://www.sistina.com/lvm/
69     http://www.alsa-project.org
70     http://pcmcia-cs.sourceforge.net"
71    
72    
73    
74     if [ ! $PN = "linux-extras" ] ; then
75     RDEPEND=">=sys-apps/reiserfs-utils-3.6.25-r1"
76     DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
77     else
78     DEPEND=">=sys-kernel/${PF/extras/sources}"
79     fi
80     if [ "`use build`" ] && [ $PN = "linux-sources" ] ; then
81     DEPEND=""
82     RDEPEND=""
83     fi
84    
85     # this is not pretty...
86     LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
87    
88     src_unpack() {
89    
90     # We only need to unpack for linux and linux-sources
91    
92     if [ ! "$PN" = "linux-extras" ]
93     then
94    
95     #unpack kernel and apply reiserfs-related patches
96     cd ${WORKDIR}
97     unpack linux-${OKV}.tar.bz2
98     try mv linux linux-${KV}
99     cd ${S}
100     echo "Applying ${KV} patch..."
101     bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1 || die
102     # echo "Applying reiserfs-update patch..."
103     # try gzip -dc ${DISTDIR}/linux-2.4.2-reiserfs-${RV}.patch.gz | patch -N -p1
104     # echo "You can ignore the rejects the changes already are in rc11"
105    
106     # echo
107     # echo "Applying xmlprocfs patch..."
108     # try gzip -dc ${DISTDIR}/linux-2.4-xmlprocfs-${XMLV}.patch.gz | patch -p1
109     echo "Applying ac-nfsfh patch..."
110     patch -p0 < ${FILESDIR}/${KV}/nfsfh-ac-fix.diff || die
111     echo "Applying reiserfs-knfsd patch..."
112     gzip -dc ${DISTDIR}/linux-${OKV}-knfsd-${KNV}.patch.gz | patch -p1 || die
113     echo "Applying ac-nfsfh-knfsd patch..."
114     patch -p0 < ${FILESDIR}/${KV}/nfsfh-ac-knfsd.diff || die
115     echo "Applying reiserfs-procinfo patch..."
116     gzip -dc ${DISTDIR}/linux-${OKV}-procinfo-${PIV}.patch.gz | patch -p1 || die
117     # echo "Applying reiserfs-quota patch..."
118     # try bzip2 -dc ${DISTDIR}/reiserfs-quota-${OKV}.dif.bz2 | patch -p1
119    
120     if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ]
121     then
122     mkdir ${S}/extras
123     fi
124    
125     if [ "`use lvm`" ]
126     then
127     #create and apply LVM patch. The tools get built later.
128     cd ${S}/extras
129     echo "Unpacking and applying LVM patch..."
130     unpack lvm_${LVMVARC}.tar.gz
131     try cd LVM/${LVMV}
132    
133     # I had to hack this in so that LVM will look in the current linux
134     # source directory instead of /usr/src/linux for stuff - pete
135     try CFLAGS="${CFLAGS} -I${S}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
136     cd PATCHES
137     try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
138     cd ${S}
139     # the -l option allows this patch to apply cleanly (ignore whitespace changes)
140     try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
141     cd ${S}/drivers/md
142     try patch -p0 < ${FILESDIR}/${KV}/lvm.c.diff
143     fi
144    
145     if [ "`use alsa`" ]
146     then
147     #unpack alsa drivers
148     echo "Unpacking ALSA drivers..."
149     cd ${S}/extras
150     unpack alsa-driver-${AV}.tar.bz2
151     fi
152    
153     if [ "`use lm_sensors`" ]
154     then
155     #unpack and apply the lm_sensors patch
156     echo "Unpacking and applying lm_sensors patch..."
157     cd ${S}/extras
158     unpack lm_sensors-${SENV}.tar.gz
159     try cd lm_sensors-${SENV}
160     try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch
161     try rmdir src
162     try ln -s ../.. src
163     try cp -a Makefile Makefile.orig
164    
165     cd ${S}
166     try patch -p1 < lm_sensors-patch
167     fi
168     if [ "`use pcmcia-cs`" ]
169     then
170     echo "Unpacking pcmcia-cs tools..."
171     cd ${S}/extras
172     unpack pcmcia-cs-${PCV}.tar.gz
173     patch -p0 < ${FILESDIR}/${KV}/pcmcia-cs-${PCV}-gentoo.diff
174     fi
175     #get sources ready for compilation or for sitting at /usr/src/linux
176     echo "Preparing for compilation..."
177     cd ${S}
178     #sometimes we have icky kernel symbols; this seems to get rid of them
179     try make mrproper
180    
181     #linux-sources needs to be fully configured, too. Not just linux
182     if [ "${PN}" != "linux-extras" ]
183     then
184     #this is the configuration for the default kernel
185     try cp ${FILESDIR}/${KV}/config.bootcomp .config
186     try yes "" | make oldconfig
187     echo "Ignore any errors from the yes command above."
188     fi
189    
190     #fix silly permissions in tarball
191     cd ${WORKDIR}
192     chown -R 0.0 ${S}
193     chmod -R a+r-w+X,u+w ${S}
194    
195     fi
196     }
197    
198     src_compile() {
199    
200     if [ "${PN}" != "linux-sources" ]
201     then
202     if [ $PN = "linux-extras" ]
203     then
204     KS=/usr/src/linux
205     else
206     KS=${S}
207     fi
208     if [ $PN = "linux" ]
209     then
210     try make symlinks
211     fi
212     if [ "`use lvm`" ]
213     then
214     #LVM tools are included in the linux and linux-extras pakcages
215     cd ${KS}/extras/LVM/${LVMV}
216    
217     # This is needed for linux-extras
218     if [ -f "Makefile" ]
219     then
220     try make clean
221     fi
222     # I had to hack this in so that LVM will look in the current linux
223     # source directory instead of /usr/src/linux for stuff - pete
224     try CFLAGS="${CFLAGS} -I${KS}/include" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}"
225     try make
226     fi
227    
228     if [ "`use lm_sensors`" ]
229     then
230     cd ${KS}/extras/lm_sensors-${SENV}
231     try sed -e "s:^LINUX=.*:LINUX=src:" \
232     -e "s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/" \
233     -e "s:^I2C_HEADERS.*:I2C_HEADERS=src/include:" \
234     -e "s#^DESTDIR.*#DESTDIR := ${D}#" \
235     -e "s#^PREFIX.*#PREFIX := /usr#" \
236     -e "s#^MANDIR.*#MANDIR := /usr/share/man#" \
237     Makefile.orig > Makefile
238    
239     try make
240     fi
241    
242     cd ${S}
243    
244     if [ "$PN" == "linux" ]
245     then
246     try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep
247     try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" bzImage
248     #LEX=\""flex -l"\" bzImage
249     try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" modules
250     #LEX=\""flex -l"\" modules
251     fi
252    
253     # This must come after the kernel compilation in linux
254     if [ "`use alsa`" ]
255     then
256     cd ${KS}/extras/alsa-driver-${AV}
257     # This is needed for linux-extras
258     if [ -f "Makefile.conf" ]
259     then
260     try make clean
261     fi
262     try ./configure --with-kernel="${KS}" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
263     try make
264     fi
265     if [ "`use pcmcia-cs`" ]
266     then
267     cd ${KS}/extras/pcmcia-cs-${PCV}
268     # This is needed for linux-extras
269     if [ -f "Makefile" ]
270     then
271     try make clean
272     fi
273     try ./Configure -n --kernel=${KS} --moddir=/lib/modules/${KV} \
274     --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
275     try make all
276     fi
277     else
278     #linux-sources
279     try make HOSTCFLAGS="${LINUX_HOSTCFLAGS}" dep
280     fi
281     }
282    
283     src_install() {
284    
285     if [ $PN = "linux-extras" ] ; then
286     KS=/usr/src/linux
287     else
288     KS=${S}
289     fi
290     # We install the alsa headers in all three packages
291     if [ "`use alsa`" ]
292     then
293     #i get alsa includes
294     cd ${KS}/extras/alsa-driver-${AV}
295     insinto /usr/src/linux-${KV}/include/linux
296     cd include
297     doins asound.h asoundid.h asequencer.h ainstr_*.h
298     fi
299    
300     if [ ! "${PN}" = "linux-sources" ]
301     then
302     if [ $PN = "linux" ]
303     then
304     KS=${S}
305     else
306     KS=/usr/src/linux
307     fi
308     dodir /usr/lib
309    
310     if [ "`use lvm`" ]
311     then
312     cd ${KS}/extras/LVM/${LVMV}/tools
313    
314     try CFLAGS="${CFLAGS} -I${KS}/include" make install -e prefix=${D} mandir=${D}/usr/share/man \
315     sbindir=${D}/sbin libdir=${D}/lib
316     #no need for a static library in /lib
317     mv ${D}/lib/*.a ${D}/usr/lib
318     fi
319    
320     if [ "`use lm_sensors`" ]
321     then
322     echo "Install sensor tools..."
323     #install sensors tools
324     cd ${KS}/extras/lm_sensors-${SENV}
325     make install
326     fi
327     if [ "${PN}" = "linux" ]
328     then
329     dodir /usr/src
330     dodir /usr/src/linux-${KV}
331     cd ${D}/usr/src
332     #grab includes and documentation only
333     echo ">>> Copying includes and documentation..."
334     cp -ax ${S}/include ${D}/usr/src/linux-${KV}
335     cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
336    
337     #grab compiled kernel
338     dodir /boot/boot
339     insinto /boot/boot
340     cd ${S}
341     doins arch/i386/boot/bzImage
342    
343     #grab modules
344     # Do we have a bug in modutils ?
345     # Meanwhile we use this quick fix (achim)
346    
347     install -d ${D}/lib/modules/`uname -r`
348     try make INSTALL_MOD_PATH=${D} modules_install
349    
350     depmod -b ${D} -F ${S}/System.map ${KV}
351     #rm -rf ${D}/lib/modules/`uname -r`
352     #fix symlink
353     cd ${D}/lib/modules/${KV}
354     rm build
355     ln -sf /usr/src/linux-${KV} build
356     fi
357    
358     if [ "`use alsa`" ]
359     then
360     #install ALSA modules
361     cd ${KS}/extras/alsa-driver-${AV}
362     dodoc INSTALL FAQ
363     dodir /lib/modules/${KV}/misc
364     cp modules/*.o ${D}/lib/modules/${KV}/misc
365     fi
366     if [ "`use pcmcia-cs`" ]
367     then
368     #install PCMCIA modules and utilities
369     cd ${KS}/extras/pcmcia-cs-${PCV}
370     try make PREFIX=${D} MANDIR=${D}/usr/share/man install
371     rm -rf ${D}/etc/rc.d
372     exeinto /etc/rc.d/init.d
373     doexe ${FILESDIR}/${KV}/pcmcia
374     fi
375     else
376     dodir /usr/src
377     cd ${S}
378     #make mrproper
379    
380     if [ "`use build`" ] ; then
381     dodir /usr/src/linux-${KV}
382     #grab includes and documentation only
383     echo ">>> Copying includes..."
384     cp -ax ${S}/include ${D}/usr/src/linux-${KV}
385     else
386     echo ">>> Copying sources..."
387     cp -ax ${S} ${D}/usr/src
388     fi
389     fi
390     if [ "$PN" != "linux-extras" ]
391     then
392     #don't overwrite existing .config if present
393     cd ${D}/usr/src/linux-${KV}
394     if [ -e .config ]
395     then
396     cp -a .config .config.eg
397     fi
398     fi
399     }
400    
401     pkg_postinst() {
402     rm -f ${ROOT}/usr/src/linux
403     ln -sf linux-${KV} ${ROOT}/usr/src/linux
404    
405     #copy over our .config if one isn't already present
406     cd ${ROOT}/usr/src/linux-${KV}
407     if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
408     then
409     cp -a .config.eg .config
410     fi
411     }

  ViewVC Help
Powered by ViewVC 1.1.20