--- acpi4asus-0.41.ebuild 2007-07-15 09:35:27.000000000 +0200 +++ acpi4asus-0.41.ebuild 2008-01-12 12:55:50.000000000 +0100 @@ -11,52 +11,64 @@ SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="" -MODULE_NAMES="asus-laptop(acpi:${S}/driver)" -BUILD_TARGETS=" " + RDEPEND="sys-power/acpid" -CONFIG_CHECK="LEDS_CLASS" pkg_setup() { - linux-mod_pkg_setup - BUILD_PARAMS="KDIR=${KV_DIR}" + if kernel_is lt 2 6 23 ; then + CONFIG_CHECK="LEDS_CLASS" + MODULE_NAMES="asus-laptop(acpi:${S}/driver)" + BUILD_TARGETS=" " + linux-mod_pkg_setup + BUILD_PARAMS="KDIR=${KV_DIR}" + else + CONFIG_CHECK="~ASUS_LAPTOP" + ERROR_ASUS_LAPTOP="Enable CONFIG_ASUS_LAPTOP under Device drivers - Misc Devices - Asus Laptop Extras (EXPERIMENTAL)." + einfo "Required kernel module is already included with 2.6.23 kernels, we will not compile it." + linux-mod_pkg_setup + fi } src_unpack() { unpack ${A} - - if kernel_is ge 2 6 21 ; then - epatch ${FILESDIR}/cvs.patch + if kernel_is ge 2 6 21 && kernel_is lt 2 6 23 ; then + epatch "${FILESDIR}"/cvs.patch fi } src_compile() { - linux-mod_src_compile + kernel_is lt 2 6 23 && linux-mod_src_compile emake -C asus_acpid } src_install() { - linux-mod_src_install + kernel_is lt 2 6 23 && linux-mod_src_install dobin asus_acpid/asus_acpid doman asus_acpid/asus_acpid.8 dodoc README Changelog - dodir /usr/share/${PN}/samples - - dodir /usr/share/${PN}/samples/actions insinto /usr/share/${PN}/samples/actions doins samples/actions/*.sh - dodir /usr/share/${PN}/samples/events insinto /usr/share/${PN}/samples/events doins samples/events/* } +pkg_preinst() { + kernel_is lt 2 6 23 && linux-mod_pkg_preinst +} + + pkg_postinst() { - linux-mod_pkg_postinst - einfo - einfo "Don't forget to create your ~/.asus_acpi," - einfo "see /usr/share/doc/${PF}/README.gz for details" - einfo + kernel_is lt 2 6 23 && linux-mod_pkg_postinst + elog + elog "Don't forget to create your ~/.asus_acpi," + elog "see README in /usr/share/doc/${PF} for details" + elog +} + +pkg_postrm() { + kernel_is lt 2 6 23 && linux-mod_pkg_postrm }