summaryrefslogtreecommitdiff
blob: c11c9e98bef52190bf02428bf0a612ff5f1ad9be (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/suspend2-sources/suspend2-sources-2.6.12-r6.ebuild,v 1.2 2005/08/29 11:07:38 brix Exp $

ETYPE="sources"
K_WANT_GENPATCHES="base extras"
K_GENPATCHES_VER="13"

inherit eutils kernel-2
detect_version
detect_arch

DESCRIPTION="Software Suspend 2 + Gentoo patchset sources"
HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.suspend2.net"

SUSPEND2_VERSION="2.1.9.9"
SUSPEND2_TARGET="${PV}"
SUSPEND2_SRC="software-suspend-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}"
SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.tar.bz2"

UNIPATCH_LIST="${FILESDIR}/4306_dm-bbr-create_workqueue.patch
${FILESDIR}/linux-2.6.12-vesafb-tng-suspend2.patch
${FILESDIR}/linux-2.6.12-try_to_freeze.patch
${FILESDIR}/linux-2.6.12-skge-pm_message_t.patch"
UNIPATCH_STRICTORDER="yes"
UNIPATCH_DOCS="${WORKDIR}/${SUSPEND2_SRC}/Changelog
${WORKDIR}/${SUSPEND2_SRC}/ToDo"

SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI}"

KEYWORDS="x86"

IUSE="ultra1"
RDEPEND="${RDEPEND}
		>=sys-apps/suspend2-userui-0.5.0
		>=sys-power/hibernate-script-1.09"

K_EXTRAEINFO="If there are issues with this kernel, please direct any
queries to the suspend2-devel mailing list:
http://lists.suspend2.net/cgi-bin/mailman/listinfo/suspend2-devel"

pkg_setup() {
	if use sparc; then
		# hme lockup hack on ultra1
		use ultra1 || UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 1399_sparc-U1-hme-lockup.patch"
	fi
}

src_unpack() {
	kernel-2_src_unpack

	cd ${WORKDIR}
	unpack ${SUSPEND2_SRC}.tar.bz2

	cd ${S}
	EPATCH_EXCLUDE="apply Changelog unapply ToDo" \
	EPATCH_FORCE="yes" \
	EPATCH_SUFFIX="" \
	EPATCH_OPTS="-p1" \
	epatch ${WORKDIR}/${SUSPEND2_SRC}
}

pkg_postinst() {
	postinst_sources

	echo

	if [ "${ARCH}" = "sparc" ]; then
		if [ x"`cat /proc/openprom/name 2>/dev/null`" \
			 = x"'SUNW,Ultra-1'" ]; then
			einfo "For users with an Enterprise model Ultra 1 using the HME"
			einfo "network interface, please emerge the kernel using the"
			einfo "following command: USE=ultra1 emerge ${PN}"
		fi
	fi
}