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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20