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

Contents of /sys-kernel/linux-extras/linux-extras-2.4.4-r3.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, 6 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-r3.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 dont use LVM, remove lvm from your USE variable.'
51 echo '*** If you DO use LVM, dont 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 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
150 then
151 try make symlinks
152
153 if [ "`use lvm`" ]
154 then
155 #LVM tools are included in the linux and linux-extras pakcages
156 cd ${S}/extras/LVM/${LVMV}
157
158 # I had to hack this in so that LVM will look in the current linux
159 # source directory instead of /usr/src/linux for stuff - pete
160 try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
161
162 try make
163 fi
164
165 if [ "`use lm_sensors`" ]
166 then
167 cd ${S}/extras/lm_sensors-${SENV}
168 try make
169 fi
170
171 cd ${S}
172
173 if [ "$PN" == "linux" ]
174 then
175 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
176 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" bzImage
177 try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" LEX=\""flex -l"\" modules
178
179 if [ "`use alsa`" ]
180 then
181 cd ${S}/extras/alsa-driver-${AV}
182 try ./configure --with-kernel=\"${S}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
183 try make
184 fi
185 fi
186 fi
187 }
188
189 src_install() {
190 if [ "${PN}" = "linux" ] || [ "${PN}" = "linux-extras" ]
191 then
192 dodir /usr/lib
193
194 if [ "`use lvm`" ]
195 then
196 cd ${S}/extras/LVM/${LVMV}/tools
197
198 try CFLAGS=\""${CFLAGS} -I${S}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \
199 sbindir=${D}/sbin libdir=${D}/lib
200 #no need for a static library in /lib
201 mv ${D}/lib/*.a ${D}/usr/lib
202 fi
203
204 if [ "`use lm_sensors`" ]
205 then
206 #install sensors tools
207 cd ${S}/extras/lm_sensors-${SENV}
208 make install
209 fi
210
211 if [ "${PN}" = "linux" ]
212 then
213 dodir /usr/src
214
215 if [ "`use alsa`" ]
216 then
217 #install ALSA modules
218 cd ${S}/extras/alsa-driver-${AV}
219 dodir /lib/modules/${KV}/misc
220 cp modules/*.o ${D}/lib/modules/${KV}/misc
221
222 fi
223
224 dodir /usr/src/linux-${KV}
225 cd ${D}/usr/src
226 #grab includes and documentation only
227 cp -ax ${S}/include ${D}/usr/src/linux-${KV}
228 cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
229
230 if [ "`use alsa`" ]
231 then
232 # get alsa includes
233 cd ${S}/extras/alsa-driver-${AV}
234 insinto /usr/src/linux-${KV}/include/linux
235 cd include
236 doins asound.h asoundid.h asequencer.h ainstr_*.h
237 fi
238
239 #grab compiled kernel
240 dodir /boot/boot
241 insinto /boot/boot
242 cd ${S}
243 doins arch/i386/boot/bzImage
244
245 #grab modules
246 # Do we have a bug in modutils ?
247 # Meanwhile we use this quick fix (achim)
248
249 install -d ${D}/lib/modules/`uname -r`
250 try make INSTALL_MOD_PATH=${D} modules_install
251
252 depmod -b ${D} -F ${S}/System.map ${KV}
253 rm -rf ${D}/lib/modules/`uname -r`
254
255 #fix symlink
256 cd ${D}/lib/modules/${KV}
257 rm build
258 ln -sf /usr/src/linux-${KV} build
259 fi
260 elif [ "${PN}" = "linux-sources" ]
261 then
262 dodir /usr/src
263
264 cd ${S}
265 make mrproper
266
267 if [ "`use lvm`" ]
268 then
269 cd ${S}/extras/LVM/${LVMV}
270 make distclean
271 fi
272
273 if [ "`use lm_sensors`" ]
274 then
275 cd ${S}/extras/lm_sensors-${SENV}
276 make clean
277 fi
278
279 if [ "`use alsa`" ]
280 then
281 # get alsa includes
282 cd ${S}/extras/alsa-driver-${AV}
283 insinto /usr/src/linux-${KV}/include/linux
284 cd include
285 doins asound.h asoundid.h asequencer.h ainstr_*.h
286 cd ${S}/extras/alsa-driver-${AV}
287 make distclean
288 fi
289
290 cp -ax ${S} ${D}/usr/src
291
292 #don't overwrite existing .config if present
293 cd ${D}/usr/src/linux-${KV}
294 if [ -e .config ]
295 then
296 cp -a .config .config.eg
297 fi
298 fi
299 }
300
301 pkg_postinst() {
302 rm -f ${ROOT}/usr/src/linux
303 ln -sf linux-${KV} ${ROOT}/usr/src/linux
304
305 #copy over our .config if one isn't already present
306 cd ${ROOT}/usr/src/linux-${KV}
307 if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
308 then
309 cp -a .config.eg .config
310 fi
311 }
312
313
314 pkg_postrm() {
315 rm -f ${ROOT}/usr/src/linux
316 rm -rf ${ROOT}/usr/src/linux-${KV}
317 }

  ViewVC Help
Powered by ViewVC 1.1.20