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

Contents of /eclass/kernel-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (hide annotations) (download)
Sun Jan 25 22:00:52 2004 UTC (15 years, 4 months ago) by johnm
Branch: MAIN
Changes since 1.19: +1 -0 lines
updating comments

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

  ViewVC Help
Powered by ViewVC 1.1.20