summaryrefslogtreecommitdiff
blob: 30751ee478be18a3d3d9dec895f1753728963457 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp

S=${WORKDIR}/linux-${PV}

SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${PV}.tar.bz2"

PROVIDE="virtual/kernel"

HOMEPAGE="http://www.kernel.org/"

DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl" # !!!what's perl for?

# !!! Do we keep these *utils in RDEPEND?
#ncurses is required for "make menuconfig"
RDEPEND=">=sys-apps/e2fsprogs-1.22
	 >=sys-apps/util-linux-2.11f
	 >=sys-apps/reiserfs-utils-3.6.25-r1
	 >=sys-libs/ncurses-5.2"

LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"

src_unpack() {

    cd ${WORKDIR}
    unpack linux-${PV}.tar.bz2
    
    mv linux linux-${PV}

    #fix silly permissions in tarball
    chown -R 0.0 *
    chmod -R a+r-w+X,u+w *
    
}
		
src_compile() {
    
    cd ${S}
    
    # does this have any effect?
    try make mrproper
    
    # create default config
    try yes \"\" \| make config
    echo "Ignore any errors from the yes command above."
    
    cd ${S}
    # try without the hostflags thing
    try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
    try make symlinks
    
}

src_install() {

    cd ${WORKDIR}
    dodir /usr/src
    mv linux-${PV} ${D}/usr/src
    
}

pkg_preinst() {

    if [ -L ${ROOT}usr/include/linux ]
    then
	rm ${ROOT}usr/include/linux
    fi
    
    if [ -L ${ROOT}usr/include/asm ]
    then
	rm ${ROOT}usr/include/asm
    fi

}

pkg_postinst() {

    rm -f ${ROOT}/usr/src/linux
    ln -sf linux-${PV} ${ROOT}/usr/src/linux
    
}