# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 ETYPE="sources" K_WANT_GENPATCHES="base extras" K_GENPATCHES_VER="3" inherit eutils kernel-2 detect_version detect_arch DESCRIPTION="Software Suspend 2 + Gentoo patchset + Libata Hotplug by tj patches (USE piix_hotplug) + IBM_ACPI fix for sata attached UltraBay patched (USE t60) sources" HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.suspend2.net http://home-tj.org/wiki/index.php/Libata-tj-stable" IUSE="t60 hdaps piix_hotplug ultra1" SUSPEND2_VERSION="2.2.7.1" SUSPEND2_TARGET="2.6.17" PIIX_VER="2.6.17.4-20060710" SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.tar.bz2" PIIX_URI="http://home-tj.org/files/libata-tj-stable/libata-tj-${PIIX_VER}.tar.bz2" HDAPS_VERSION="20060430" HDAPS_TARGET="2.6.17" HDAPS_PIIX_URI="http://whoopie.gmxhome.de/tmp/hdaps_protect-${HDAPS_VERSION}-for-${HDAPS_TARGET}-tj.patch" #HDAPS_URI="http://www.zen24593.zen.co.uk/hdaps/hdaps_protect.${HDAPS_VERSION}.patch" T60_UB_PATCH="ibm_acpi-t60-ultrabay.patch" T60_UB_PATCH_URI="http://whoopie.gmxhome.de/tmp/${T60_UB_PATCH}" UNIPATCH_LIST="${DISTDIR}/${SUSPEND2_SRC}.tar.bz2" if use hdaps; then # if use piix_hotplug; then UNIPATCH_LIST="${DISTDIR}/hdaps_protect-${HDAPS_VERSION}-for-${HDAPS_TARGET}-tj.patch ${UNIPATCH_LIST}" # else # UNIPATCH_LIST="${DISTDIR}/hdaps_protect.${HDAPS_VERSION}.patch ${UNIPATCH_LIST}" # fi fi if use piix_hotplug; then UNIPATCH_LIST="${DISTDIR}/libata-tj-${PIIX_VER}.tar.bz2 ${UNIPATCH_LIST}" fi if use t60; then UNIPATCH_LIST="${UNIPATCH_LIST} ${DISTDIR}/${T60_UB_PATCH}" fi UNIPATCH_STRICTORDER="yes" UNIPATCH_DOCS="${WORKDIR}/patches/${SUSPEND2_SRC}/Changelog.txt ${WORKDIR}/patches/${SUSPEND2_SRC}/ToDo" SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI}" SRC_URI="${SRC_URI} t60? ( ${T60_UB_PATCH_URI} )" SRC_URI="${SRC_URI} piix_hotplug? ( ${PIIX_URI} )" #SRC_URI="${SRC_URI} hdaps? ( piix_hotplug? ( ${HDAPS_PIIX_URI} ) !piix_hotplug? (${HDAPS_URI}) )" SRC_URI="${SRC_URI} hdaps? ( piix_hotplug? ( ${HDAPS_PIIX_URI} ) )" KEYWORDS="~amd64 ~x86" RDEPEND="${RDEPEND} >=sys-apps/suspend2-userui-0.6.1 >=sys-power/hibernate-script-1.12" K_EXTRAEINFO="If there are issues with this kernel, please direct any queries to the suspend2-users mailing list: http://lists.suspend2.net/mailman/listinfo/suspend2-users/" pkg_setup() { if use piix_hotplug; then UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 2.6.17/41??_*.patch combined.patch" fi if use hdaps; then if use !piix_hotplug; then # UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 2.6.17/41??_*.patch" einfo "currently hdaps only works with piix_hotplug enabled," einfo "you can safely enable it, even if your tp doesn't use sata" einfo "(just forget the sata piix stuff when you configure your kernel)" die fi fi if use sparc; then # hme lockup hack on ultra1 use ultra1 || UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 1705_sparc-U1-hme-lockup.patch" fi } 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 }