761291b358c5c655bdbe88114d90ab81f70909ae
[gentoo-overlay-ibormuth.git] / sys-kernel / nogo-sources / nogo-sources-2.6.30.4-r1.ebuild
blob761291b358c5c655bdbe88114d90ab81f70909ae
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 ETYPE="sources"
6 inherit kernel-2
7 detect_version
8 detect_arch
10 #------------------------------------------------------------------------
12 K_WANT_GENPATCHES="base extras"
13 K_GENPATCHES_OKV="${OKV}"
14 K_GENPATCHES_VER="6"
16 TUXONICE_OKV="${OKV}"
17 TUXONICE_VER="3.0.1"
18 #TUXONICE_PATCH="tuxonice-${TUXONICE_VER}-for-${TUXONICE_OKV}.patch.bz2"
19 TUXONICE_PATCH="current-tuxonice-for-2.6.30.patch-20090620-v1.bz2"
21 REISER4_OKV="${OKV}"
22 REISER4_VER=""
23 REISER4_PATCH="reiser4-for-${REISER4_OKV}${REISER4_VER}.patch.bz2"
25 ATOP_OKV="2.6.28"
26 ATOP_VER=""
27 ATOP_PATCH="atoppatch-kernel-${ATOP_OKV}${ATOP_VER}.tar.gz"
29 #------------------------------------------------------------------------
31 KEYWORDS="~amd64 ~x86"
33 IUSE="atop currentconfig oneslot reiser4 toshiba-acpi tuxonice"
35 use oneslot && SLOT="0"
37 DESCRIPTION="Kernel, optionally with atop, genpatches, reiser4, tuxonice, toshiba-acpi."
39 HOMEPAGE="http://www.kernel.org
40 ATOP: http://www.atcomputing.nl/Tools/atop
41 GENPATCHES: http://dev.gentoo.org/~dsd/genpatches
42 REISER4: http://www.kernel.org/pub/linux/kernel/people/edward/reiser4
43 TOSHIBA-ACPI: http://memebeam.org/toys/ExperimentalToshibaAcpiDriver
44 TUXONICE: http://www.tuxonice.net"
46 SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}
47 atop? ( http://www.atcomputing.nl/Tools/atop/packages/${ATOP_PATCH} )
48 reiser4? ( mirror://kernel/linux/kernel/people/edward/reiser4/reiser4-for-2.6/${REISER4_PATCH} )
49 tuxonice? ( http://www.tuxonice.net/downloads/all/${TUXONICE_PATCH} )"
51 RDEPEND="${RDEPEND}
52 tuxonice? ( >=sys-apps/tuxonice-userui-0.7.3
53 ( || ( sys-power/hibernate-script sys-power/pm-utils ) ) )
54 reiser4? ( >=sys-fs/reiser4progs-1.0.6 )
55 atop? ( sys-process/atop )"
57 UNIPATCH_STRICTORDER="yes"
58 UNIPATCH_LIST=""
60 if use tuxonice
61 then
62 if [[ ${#TUXONICE_VER} -lt 30 ]] # official or local patch generated from git ?
63 then
64 UNIPATCH_LIST="${UNIPATCH_LIST} ${DISTDIR}/${TUXONICE_PATCH}"
65 else
66 UNIPATCH_LIST="${UNIPATCH_LIST} ${FILESDIR}/${TUXONICE_PATCH}"
67 fi
68 fi
70 if use reiser4
71 then
72 UNIPATCH_LIST="${UNIPATCH_LIST}
73 ${DISTDIR}/${REISER4_PATCH}"
74 fi
76 if use toshiba-acpi
77 then
78 UNIPATCH_LIST="${UNIPATCH_LIST}
79 ${FILESDIR}/linux-2.6.29-toshiba_acpi.patch"
80 fi
82 src_unpack() {
83 kernel-2_src_unpack
84 cd "${S}"
86 # Due to stupid naming atop patches don't work with unipatch
87 if use atop && [ -e "${DISTDIR}/${ATOP_PATCH}" ]
88 then
89 echo "Atop Patch:"
90 ( ( ( tar -xzOf "${DISTDIR}/${ATOP_PATCH}" --exclude "README*" \
91 || die "${ATOP_PATCH} is invalid (not yet available ?)" \
92 ) | patch -p1 \
93 ) || die "${ATOP_PATCH} failed (old version ?)"
94 )
95 echo "Fix Atop:"
96 patch -p1 < "${FILESDIR}/linux-2.6.29-atop_fix.patch" || die "Fix Atop Failed."
98 fi
100 # Copy current config from /proc
101 if use currentconfig ; then
102 if [ -e "/usr/src/linux-${KV_FULL}/.config" ]; then
103 ewarn "Kernel config file already exist."
104 ewarn "I will NOT overwrite that."
105 else
106 echo "Copying kernel config file."
107 zcat /proc/config > .config || ewarn "Can't copy /proc/config"
108 fi
109 fi
112 nogo_info() {
113 if use ${1}
114 then
115 einfo " + ${1} (${2})"
116 else
117 einfo " - ${1}"
118 fi
121 pkg_postinst() {
122 kernel-2_pkg_postinst
123 echo
124 ewarn "========"
125 ewarn "WARNING:"
126 ewarn "========"
127 ewarn
128 ewarn "This is an experimental kernel version."
129 echo
130 einfo "Features:"
131 echo
132 nogo_info atop "${ATOP_PATCH}"
133 nogo_info reiser4 "${REISER4_PATCH}"
134 nogo_info tuxonice "${TUXONICE_PATCH}"
135 nogo_info toshiba-acpi "local"
136 echo
137 ewarn "Do NOT ask for official gentoo support."
138 ewarn "I am BY NO MEANS responsible for breaking your system."
139 ewarn "ALWAYS keep a second stable and bootable kernel apart in your boot manager."