/[gentoo-x86]/eclass/kernel-2.eclass
Gentoo

Contents of /eclass/kernel-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.32 - (show annotations) (download)
Sun Mar 14 06:43:16 2004 UTC (15 years, 3 months ago) by seemant
Branch: MAIN
Changes since 1.31: +2 -2 lines
console-tools->kbd

1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.31 2004/02/18 22:33:29 johnm Exp $
4
5 # kernel.eclass rewrite for a clean base regarding the 2.6 series of kernel
6 # with back-compatibility for 2.4
7 #
8 # Author: John Mylchreest <johnm@gentoo.org>
9 # Copyright 2004 Gentoo Linux
10 #
11 # Please direct your bugs to the current eclass maintainer :)
12 # thatll be: johnm
13
14 # added functionality:
15 # unipatch - a flexible, singular method to extract, add and remove patches.
16
17 # A Couple of env vars are available to effect usage of this eclass
18 # These are as follows:
19 #
20 # K_NOSETEXTRAVERSION - if this is set then EXTRAVERSION will not be automatically set within the kernel Makefile
21 # K_NOUSENAME - if this is set then EXTRAVERSION will not include the first part of ${PN} in EXTRAVERSION
22 # K_PREPATCHED - if the patchset is prepatched (ie: mm-sources, ck-sources, ac-sources) it will use PR (ie: -r5) as the patchset version for
23 # - and not use it as a true package revision
24 # K_EXTRAEINFO - this is a new-line seperated list of einfo displays in postinst and can be used to carry additional postinst messages
25 # K_EXTRAEWARN - same as K_EXTRAEINFO except ewarn's instead of einfo's
26
27 # H_SUPPORTEDARCH - this should be a space separated list of ARCH's which can be supported by the headers ebuild
28
29 # UNIPATCH_LIST - space delimetered list of patches to be applied to the kernel
30 # UNIPATCH_EXCLUDE - an addition var to support exlusion based completely on "<passedstring>*" and not "<passedno#>_*"
31 # - this should _NOT_ be used from the ebuild as this is reserved for end users passing excludes from the cli
32 # UNIPATCH_DOCS - space delimemeted list of docs to be installed to the doc dir
33 # UNIPATCH_STRICTORDER - if this is set places patches into directories of order, so they are applied in the order passed
34
35 ECLASS="kernel-2"
36 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_preinst pkg_postinst
37
38 # to prevent errors if theres no sources in /usr/src
39 # we set KV and re-set it later on as well.
40 [ -z "${KV}" ] && KV=${PV}
41
42 HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/"
43 LICENSE="GPL-2"
44 IUSE="${IUSE} build"
45 SLOT="${KV}"
46
47 # Grab kernel version from KV
48 KV_MAJOR=$(echo ${KV} | cut -d. -f1)
49 KV_MINOR=$(echo ${KV} | cut -d. -f2)
50 KV_PATCH=$(echo ${KV} | cut -d. -f3)
51 KV_PATCH=${KV_PATCH/[-_]*/}
52
53 # set LINUX_HOSTCFLAGS if not already set
54 [ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"
55
56
57 #eclass functions only from here onwards.
58 #==============================================================
59 kernel_is_2_4() {
60 [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -eq 4 ] && return 0 || return 1
61 }
62
63 kernel_is_2_6() {
64 [ ${KV_MAJOR} -eq 2 -a ${KV_MINOR} -eq 5 -o ${KV_MINOR} -eq 6 ] && return 0 || return 1
65 }
66
67 # capture the sources type and set depends
68 if [ "${ETYPE}" == "sources" ]
69 then
70 #kbd is needed to solve the loadkeys fiasco; binutils version needed to avoid Athlon/PIII/SSE assembler bugs.
71 DEPEND="!build? ( sys-apps/sed
72 >=sys-devel/binutils-2.11.90.0.31 )"
73
74 RDEPEND="${DEPEND}
75 !build? ( >=sys-libs/ncurses-5.2
76 dev-lang/perl
77 sys-apps/module-init-tools
78 sys-devel/make )"
79
80 [ $(kernel_is_2_4) $? == 0 ] && PROVIDE="virtual/linux-sources" || PROVIDE="virtual/linux-sources virtual/alsa"
81
82 elif [ "${ETYPE}" == "headers" ]
83 then
84 PROVIDE="virtual/kernel virtual/os-headers"
85 else
86 eerror "Unknown ETYPE=\"${ETYPE}\", must be either \"sources\" or \"headers\""
87 die
88 fi
89
90 # Unpack functions
91 #==============================================================
92 unpack_2_4() {
93 cd ${S}
94 # this file is required for other things to build properly,
95 # so we autogenerate it
96 make mrproper || die "make mrproper died"
97 make include/linux/version.h || die "make include/linux/version.h failed"
98 echo ">>> version.h compiled successfully."
99 }
100
101 universal_unpack() {
102 # remove all backup files
103 find . -iname "*~" -exec rm {} \; 2> /dev/null
104
105 if [ -d "${S}/Documentation/DocBook" ]
106 then
107 cd ${S}/Documentation/DocBook
108 sed -e "s:db2:docbook2:g" Makefile > Makefile.new \
109 && mv Makefile.new Makefile
110 cd ${S}
111 fi
112 }
113
114 unpack_set_extraversion() {
115 # Gentoo Linux uses /boot, so fix 'make install' to work properly and fix EXTRAVERSION
116 cd ${S}
117 mv Makefile Makefile.orig
118 sed -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' \
119 -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" \
120 Makefile.orig > Makefile
121 rm Makefile.orig
122 }
123
124 # Compile Functions
125 #==============================================================
126 compile_headers() {
127 local MY_ARCH
128
129 MY_ARCH=${ARCH}
130 unset ${ARCH}
131 yes "" | make oldconfig
132 echo ">>> make oldconfig complete"
133 ARCH=${MY_ARCH}
134 }
135
136 # install functions
137 #==============================================================
138 install_universal() {
139 #fix silly permissions in tarball
140 cd ${WORKDIR}
141 chown -R root:root *
142 chmod -R a+r-w+X,u+w *
143 }
144
145 install_headers() {
146 [ $(kernel_is_2_4) $? == 0 ] && unpack_2_4
147
148 cd ${S}
149 dodir /usr/include/linux
150 ln -sf ${S}/include/asm-${ARCH} ${S}/include/asm
151 cp -ax ${S}/include/linux/* ${D}/usr/include/linux
152 rm -rf ${D}/usr/include/linux/modules
153
154 dodir /usr/include/asm
155 cp -ax ${S}/include/asm/* ${D}/usr/include/asm
156
157 if [ $(kernel_is_2_6) $? == 0 ]
158 then
159 dodir /usr/include/asm-generic
160 cp -ax ${S}/include/asm-generic/* ${D}/usr/include/asm-generic
161 fi
162 }
163
164 install_sources() {
165 local doc
166 local docs
167 local file
168
169 cd ${S}
170 dodir /usr/src
171 echo ">>> Copying sources..."
172 file="$(find ${WORKDIR} -iname "docs" -type d)"
173 if [ -n "${file}" ]
174 then
175 for file in $(find ${file} -type f)
176 do
177 echo "${file/*docs\//}" >> ${S}/patches.txt
178 echo "===================================================" >> ${S}/patches.txt
179 cat ${file} >> ${S}/patches.txt
180 echo "===================================================" >> ${S}/patches.txt
181 echo "" >> ${S}/patches.txt
182 done
183 fi
184
185 if [ ! -f ${S}/patches.txt ]
186 then
187 # patches.txt is empty so lets use our ChangeLog
188 [ -f ${FILESDIR}/../ChangeLog ] && echo "Please check the ebuild ChangeLog for more details." > ${S}/patches.txt
189 fi
190
191 for doc in ${UNIPATCH_DOCS}
192 do
193 [ -f ${doc} ] && docs="${docs} ${doc}"
194 done
195
196 if [ -f ${S}/patches.txt ]; then
197 docs="${docs} ${S}/patches.txt"
198 fi
199
200 dodoc ${docs}
201 mv ${WORKDIR}/linux* ${D}/usr/src
202 }
203
204 # pkg_preinst functions
205 #==============================================================
206 preinst_headers() {
207 [ -L ${ROOT}usr/include/linux ] && rm ${ROOT}usr/include/linux
208 [ -L ${ROOT}usr/include/asm ] && rm ${ROOT}usr/include/asm
209 }
210
211 # pkg_postinst functions
212 #==============================================================
213 postinst_sources() {
214 if [ ! -h ${ROOT}usr/src/linux ]
215 then
216 ln -sf ${ROOT}usr/src/linux-${KV} ${ROOT}usr/src/linux
217 fi
218
219 # Don't forget to make directory for sysfs
220 [ ! -d "${ROOT}/sys" -a $(kernel_is_2_6) $? == 0 ] && mkdir /sys
221
222 echo
223 einfo "After installing a new kernel of any version, it is important"
224 einfo "that you have the appropriate /etc/modules.autoload.d/kernel-X.Y"
225 einfo "created (X.Y is the first 2 parts of your new kernel version)"
226 echo
227 einfo "For example, this kernel will require:"
228 einfo "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
229 echo
230
231 # if K_EXTRAEINFO is set then lets display it now
232 if [ -n "${K_EXTRAEINFO}" ]
233 then
234 echo ${K_EXTRAEINFO} | fmt |
235 while read -s ELINE
236 do
237 einfo "${ELINE}"
238 done
239
240 echo
241 fi
242
243 # if K_EXTRAEWARN is set then lets display it now
244 if [ -n "${K_EXTRAEWARN}" ]
245 then
246 echo ${K_EXTRAEWARN} | fmt |
247 while read -s ELINE
248 do
249 ewarn "${ELINE}"
250 done
251
252 echo
253 fi
254 }
255
256 postinst_headers() {
257 echo
258 einfo "Kernel headers are usually only used when recompiling glibc."
259 einfo "Following the installation of newer headers it is advised that"
260 einfo "you re-merge glibc as follows:"
261 einfo "# emerge glibc"
262 einfo "Failure to do so will cause glibc to not make use of newer"
263 einfo "features present in the updated kernelheaders."
264 echo
265 }
266
267 # pkg_setup functions
268 #==============================================================
269 setup_headers() {
270 ARCH=$(uname -m | sed -e s/[i].86/i386/ -e s/x86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/amd64/x86_64/)
271 [ "$ARCH" == "sparc" -a "$PROFILE_ARCH" == "sparc64" ] && ARCH="sparc64"
272
273 [ -z "${H_SUPPORTEDARCH}" ] && H_SUPPORTEDARCH="${PN/-*/}"
274 for i in ${H_SUPPORTEDARCH}
275 do
276 [ "${ARCH}" == "${i}" ] && H_ACCEPT_ARCH="yes"
277 done
278
279 if [ "${H_ACCEPT_ARCH}" != "yes" ]
280 then
281 echo
282 eerror "This version of ${PN} does not support ${ARCH}."
283 eerror "Please merge the appropriate sources, in most cases"
284 eerror "this will be ${ARCH}-headers."
285 die "incorrect headers"
286 fi
287 }
288
289 # unipatch
290 #==============================================================
291 unipatch() {
292 local i
293 local x
294 local extention
295 local PIPE_CMD
296 local UNIPATCH_DROP
297 local KPATCH_DIR
298 local PATCH_DEPTH
299 local ELINE
300 local STRICT_COUNT
301
302 [ -z "${KPATCH_DIR}" ] && KPATCH_DIR="${WORKDIR}/patches/"
303 [ ! -d ${KPATCH_DIR} ] && mkdir -p ${KPATCH_DIR}
304
305 # This function will unpack all passed tarballs, add any passed patches, and remove any passed patchnumbers
306 # usage can be either via an env var or by params
307 # although due to the nature we pass this within this eclass
308 # it shall be by param only.
309 # -z "${UNIPATCH_LIST}" ] && UNIPATCH_LIST="${@}"
310 UNIPATCH_LIST="${@}"
311
312 #unpack any passed tarballs
313 for i in ${UNIPATCH_LIST}
314 do
315 if [ -n "$(echo ${i} | grep -e "\.tar" -e "\.tbz" -e "\.tgz")" ]
316 then
317 extention=${i/*./}
318 case ${extention} in
319 tbz2) PIPE_CMD="tar -xvjf";;
320 bz2) PIPE_CMD="tar -xvjf";;
321 tgz) PIPE_CMD="tar -xvzf";;
322 gz) PIPE_CMD="tar -xvzf";;
323 *) eerror "Unrecognized tarball compression"
324 die "Unrecognized tarball compression";;
325 esac
326
327 if [ -n "${UNIPATCH_STRICTORDER}" ]
328 then
329 STRICT_COUNT=$((${STRICT_COUNT} + 1))
330 mkdir -p ${KPATCH_DIR}/${STRICT_COUNT}/
331 ${PIPE_CMD} ${i} -C ${KPATCH_DIR}/${STRICT_COUNT}/ 1>/dev/null
332 else
333 ${PIPE_CMD} ${i} -C ${KPATCH_DIR} 1>/dev/null
334 fi
335
336 if [ $? == 0 ]
337 then
338 einfo "${i/*\//} unpacked"
339 else
340 eerror "Failed to unpack ${i}"
341 die "unable to unpack patch tarball"
342 fi
343 else
344 extention=${i/*./}
345 PIPE_CMD=""
346 case ${extention} in
347 bz2) PIPE_CMD="bzip2 -dc";;
348 patch) PIPE_CMD="cat";;
349 diff) PIPE_CMD="cat";;
350 gz|Z|z) PIPE_CMD="gzip -dc";;
351 ZIP|zip) PIPE_CMD="unzip -p";;
352 *) UNIPATCH_DROP="${UNIPATCH_DROP} ${i}";;
353 esac
354 x=${i/*\//}
355 x=${x/\.${extention}/}
356
357 if [ -n "${PIPE_CMD}" ]
358 then
359 if [ ! -r "${i}" ]
360 then
361 echo
362 eerror "FATAL: unable to locate:"
363 eerror "${i}"
364 eerror "for read-only. The file either has incorrect permissions"
365 eerror "or does not exist."
366 die Unable to locate ${i}
367 fi
368
369 if [ -n "${UNIPATCH_STRICTORDER}" ]
370 then
371 STRICT_COUNT=$((${STRICT_COUNT} + 1))
372 mkdir -p ${KPATCH_DIR}/${STRICT_COUNT}/
373 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${STRICT_COUNT}/${x}.patch)
374 else
375 $(${PIPE_CMD} ${i} > ${KPATCH_DIR}/${x}.patch)
376 fi
377 fi
378 fi
379 done
380
381 #populate KPATCH_DIRS so we know where to look to remove the excludes
382 x=${KPATCH_DIR}
383 KPATCH_DIR=""
384 for i in $(find ${x} -type d | sort -n)
385 do
386 KPATCH_DIR="${KPATCH_DIR} ${i}"
387 done
388
389 #so now lets get rid of the patchno's we want to exclude
390 UNIPATCH_DROP="${UNIPATCH_EXCLUDE} ${UNIPATCH_DROP}"
391 for i in ${UNIPATCH_DROP}
392 do
393 for x in ${KPATCH_DIR}
394 do
395 rm ${x}/${i}* 2>/dev/null
396 if [ $? == 0 ]
397 then
398 einfo "Excluding Patch #${i}"
399 einfo "From: ${x/${WORKDIR}/}"
400 fi
401 done
402 done
403
404 # and now, finally, we patch it :)
405 for x in ${KPATCH_DIR}
406 do
407 for i in $(find ${x} -maxdepth 1 -iname "*.patch" -or -iname "*.diff" | sort -n)
408 do
409 STDERR_T="${T}/${i/*\//}"
410 STDERR_T="${STDERR_T/.patch/.err}"
411
412 PATCH_DEPTH=0
413 ebegin "Applying ${i/*\//}"
414 while [ ${PATCH_DEPTH} -lt 5 ]
415 do
416 echo "Attempting Dry-run:" > ${STDERR_T}
417 echo "cmd: patch -p${PATCH_DEPTH} --dry-run -f < ${i}" >> ${STDERR_T}
418 echo "=======================================================" >> ${STDERR_T}
419 if [ $(patch -p${PATCH_DEPTH} --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]
420 then
421 echo "Attempting patch:" > ${STDERR_T}
422 echo "cmd: patch -p${PATCH_DEPTH} -f < ${i}" >> ${STDERR_T}
423 echo "=======================================================" >> ${STDERR_T}
424 if [ $(patch -p${PATCH_DEPTH} -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]
425 then
426 eend 0
427 rm ${STDERR_T}
428 break
429 else
430 eend 1
431 eerror "Failed to apply patch ${i/*\//}"
432 eerror "Please attach ${STDERR_T} to any bug you may post."
433 die "Failed to apply ${i/*\//}"
434 fi
435 else
436 PATCH_DEPTH=$((${PATCH_DEPTH} + 1))
437 fi
438 done
439 if [ ${PATCH_DEPTH} -eq 5 ]
440 then
441 eend 1
442 eerror "Please attach ${STDERR_T} to any bug you may post."
443 die "Unable to dry-run patch."
444 fi
445 done
446 done
447 }
448
449 # custom functions
450 #==============================================================
451 detect_version() {
452 # this function will detect and set
453 # - OKV: Original Kernel Version (2.6.0/2.6.0-test11)
454 # - KV: Kernel Version (2.6.0-gentoo/2.6.0-test11-gentoo-r1)
455 # - EXTRAVERSION: The additional version appended to OKV (-gentoo/-gentoo-r1)
456
457 OKV=${PV/_beta/-test}
458 OKV=${OKV/_rc/-rc}
459 OKV=${OKV/_pre*/}
460 OKV=${OKV/-r*/}
461
462 KV_MAJOR=$(echo ${OKV} | cut -d. -f1)
463 KV_MINOR=$(echo ${OKV} | cut -d. -f2)
464 KV_PATCH=$(echo ${OKV} | cut -d. -f3)
465 KV_PATCH=${KV_PATCH/[-_]*/}
466
467 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
468
469 RELEASE=${PV/${OKV}/}
470 RELEASE=${RELEASE/_beta/}
471 RELEASE=${RELEASE/_rc/-rc}
472 RELEASE=${RELEASE/_pre/-bk}
473 RELEASETYPE=${RELEASE//[0-9]/}
474
475 EXTRAVERSION="${RELEASE}"
476
477 if [ -n "${K_PREPATCHED}" ]
478 then
479 EXTRAVERSION="${EXTRAVERSION}-${PN/-*/}${PR/r/}"
480 else
481 [ -z "${K_NOUSENAME}" ] && EXTRAVERSION="${EXTRAVERSION}-${PN/-*/}"
482 [ "${PR}" != "r0" ] && EXTRAVERSION="${EXTRAVERSION}-${PR}"
483 fi
484
485 KV=${OKV}${EXTRAVERSION}
486
487 # -rcXX-bkXX pulls are *IMPOSSIBLE* to support within the portage naming convention
488 # these cannot be supported, but the code here can handle it up until this point
489 # and theoretically thereafter.
490
491 if [ "${RELEASETYPE}" == "-rc" ]
492 then
493 OKV="${KV_MAJOR}.${KV_MINOR}.$([ $((${KV_PATCH} - 1)) -lt 0 ] && echo ${KV_PATCH} || echo $((${KV_PATCH} - 1)))"
494 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/patch-${PV//_/-}.bz2
495 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
496 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${PV//_/-}.bz2"
497 KV=${PV/[-_]*/}${EXTRAVERSION}
498 fi
499
500 if [ "${RELEASETYPE}" == "-bk" ]
501 then
502 OKV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
503 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2
504 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
505 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2"
506 KV=${PV/[-_]*/}${EXTRAVERSION}
507 fi
508
509 if [ "${RELEASETYPE}" == "-rc-bk" ]
510 then
511 OKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_PATCH} - 1))-${RELEASE/-bk*}"
512 EXTRAVERSION="$([ -n "${RELEASE}" ] && echo ${RELEASE/*-bk/-bk})$([ -n "${K_USENAME}" ] && echo -${PN/-*/})$([ ! "${PR}" == "r0" ] && echo -${PR})"
513
514 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/snapshots/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2
515 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
516 UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2"
517 KV=${PV/[-_]*/}${EXTRAVERSION}
518 fi
519
520 S=${WORKDIR}/linux-${KV}
521 }
522
523
524 detect_arch() {
525 # This function sets ARCH_URI and ARCH_PATCH
526 # with the neccessary info for the arch sepecific compatibility
527 # patchsets.
528
529 local ALL_ARCH
530 local LOOP_ARCH
531 local COMPAT_URI
532
533 ALL_ARCH="X86 PPC PCC64 SPARC MIPS ALPHA ARM HPPA AMD64 IA64 X86OBSD"
534 for LOOP_ARCH in ${ALL_ARCH}
535 do
536 COMPAT_URI="${LOOP_ARCH}_URI"
537 COMPAT_URI="${!COMPAT_URI}"
538 ARCH_URI="${ARCH_URI} $(echo ${LOOP_ARCH} | tr [A-Z] [a-z])? ( ${COMPAT_URI} )"
539
540 [ "${LOOP_ARCH}" == "$(echo ${ARCH} | tr [a-z] [A-Z])" ] && ARCH_PATCH="${DISTDIR}/${COMPAT_URI/*\//}"
541 done
542 }
543
544
545 # common functions
546 #==============================================================
547 src_unpack() {
548 [ -z "${OKV}" ] && OKV="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
549
550 cd ${WORKDIR}
551 unpack linux-${OKV}.tar.bz2
552 if [ "${OKV}" != "${KV}" ]
553 then
554 mv linux-${OKV} linux-${KV} || die "Unable to move source tree to ${KV}."
555 fi
556 cd ${S}
557
558 universal_unpack
559 [ -n "${UNIPATCH_LIST}" -o -n "${UNIPATCH_LIST_DEFAULT}" ] && unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST}"
560 [ -z "${K_NOSETEXTRAVERSION}" ] && unpack_set_extraversion
561 [ $(kernel_is_2_4) $? == 0 ] && unpack_2_4
562 }
563
564 src_compile() {
565 [ "${ETYPE}" == "headers" ] && compile_headers
566 }
567
568 pkg_preinst() {
569 [ "${ETYPE}" == "headers" ] && preinst_headers
570 }
571
572 src_install() {
573 install_universal
574 [ "${ETYPE}" == "headers" ] && install_headers
575 [ "${ETYPE}" == "sources" ] && install_sources
576 }
577
578 pkg_postinst() {
579 [ "${ETYPE}" == "headers" ] && postinst_headers
580 [ "${ETYPE}" == "sources" ] && postinst_sources
581 }
582
583 pkg_setup() {
584 [ "${ETYPE}" == "headers" ] && setup_headers
585
586 # this is to fix some weird portage bug? in stable versions of portage.
587 [ "${ETYPE}" == "sources" ] && echo ">>> Preparing to unpack..."
588 }

  ViewVC Help
Powered by ViewVC 1.1.20