summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-laptop/pbbuttonsd
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-laptop/pbbuttonsd')
-rw-r--r--app-laptop/pbbuttonsd/Manifest1
-rw-r--r--app-laptop/pbbuttonsd/files/cpufreq.patch20
-rw-r--r--app-laptop/pbbuttonsd/files/fnmode.patch23
-rw-r--r--app-laptop/pbbuttonsd/files/g++.patch11
-rw-r--r--app-laptop/pbbuttonsd/files/laptopmode.sh.patch29
-rw-r--r--app-laptop/pbbuttonsd/files/lm.patch11
-rw-r--r--app-laptop/pbbuttonsd/files/lz.patch25
-rw-r--r--app-laptop/pbbuttonsd/files/pbbuttonsd.rc620
-rw-r--r--app-laptop/pbbuttonsd/files/pmcs.patch21
-rw-r--r--app-laptop/pbbuttonsd/files/wireless7
-rw-r--r--app-laptop/pbbuttonsd/metadata.xml12
-rw-r--r--app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r3.ebuild125
-rw-r--r--app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r4.ebuild129
13 files changed, 434 insertions, 0 deletions
diff --git a/app-laptop/pbbuttonsd/Manifest b/app-laptop/pbbuttonsd/Manifest
new file mode 100644
index 000000000000..d48ac50bb5bc
--- /dev/null
+++ b/app-laptop/pbbuttonsd/Manifest
@@ -0,0 +1 @@
+DIST pbbuttonsd-0.8.1.tar.gz 589630 SHA256 b391fd98ed263f355d7e7addc6566959e986627c87dcfdaa1da15310ad70bffa SHA512 856f8533c1f6489986c232baa8b8002a01d009ed3728ee35bc723aece91ba626ce961119c0d424f40c2f9289827f317c56d70fe8f0e035cbd9f08d7701316ac3 WHIRLPOOL 21a18a9f6a204156beb7373f89c6477c68ef90d8d9fe15cb7322b811b15856fd38bca7705860584716b00cd29378b85d0f2ac7624f00fe50ec44ac83033c073b
diff --git a/app-laptop/pbbuttonsd/files/cpufreq.patch b/app-laptop/pbbuttonsd/files/cpufreq.patch
new file mode 100644
index 000000000000..c5a9f963b632
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/cpufreq.patch
@@ -0,0 +1,20 @@
+--- scripts/scripts.d/cpufreq.bak 2012-09-09 12:17:29.842743727 -0400
++++ scripts/scripts.d/cpufreq 2012-09-09 12:18:08.709696894 -0400
+@@ -18,7 +18,7 @@
+ case "$1" in
+ powersave|custom)
+ case "$KVER" in
+- 2.6.*)
++ "2.6."*|"3."*)
+ if [ -d /sys ]; then
+ echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+@@ -41,7 +41,7 @@
+ ;;
+ performance)
+ case "$KVER" in
+- 2.6.*)
++ "2.6."*|"3."*)
+ if [ -d /sys ]; then
+ echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
diff --git a/app-laptop/pbbuttonsd/files/fnmode.patch b/app-laptop/pbbuttonsd/files/fnmode.patch
new file mode 100644
index 000000000000..e33019a43694
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/fnmode.patch
@@ -0,0 +1,23 @@
+--- src/module_pmac.c 2007-07-01 07:05:17.000000000 -0400
++++ src/module_pmac.kbdfix.c 2008-12-27 11:46:36.000000000 -0500
+@@ -990,7 +990,9 @@
+ }
+ } else {
+ if ((fd = open ("/sys/module/usbhid/parameters/pb_fnmode", O_RDONLY)) < 0)
+- fd = open ("/sys/module/hid/parameters/pb_fnmode", O_RDONLY);
++ if ((fd = open ("/sys/module/hid/parameters/pb_fnmode", O_RDONLY)) < 0)
++ fd = open("/sys/module/hid_apple/parameters/fnmode", O_RDONLY);
++
+
+ if (fd >= 0) {
+ if ((n = read (fd, ADBBuffer, ADB_BUFSIZE-1)) > 0) {
+@@ -1025,7 +1027,8 @@
+ }
+ } else {
+ if ((fd = open ("/sys/module/usbhid/parameters/pb_fnmode", O_WRONLY)) < 0)
+- fd = open ("/sys/module/hid/parameters/pb_fnmode", O_WRONLY);
++ if ((fd = open ("/sys/module/hid/parameters/pb_fnmode", O_WRONLY)) < 0)
++ fd = open ("/sys/module/hid_apple/parameters/fnmode", O_WRONLY);
+
+ if (fd >= 0) {
+ sprintf ((char*)ADBBuffer, "%d", config);
diff --git a/app-laptop/pbbuttonsd/files/g++.patch b/app-laptop/pbbuttonsd/files/g++.patch
new file mode 100644
index 000000000000..5743bf0aa5df
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/g++.patch
@@ -0,0 +1,11 @@
+--- src/Makefile.tmp 2007-11-29 20:42:38.000000000 -0500
++++ src/Makefile.in 2007-11-29 20:47:23.000000000 -0500
+@@ -319,7 +319,7 @@
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+ pbbuttonsd$(EXEEXT): $(pbbuttonsd_OBJECTS) $(pbbuttonsd_DEPENDENCIES)
+ @rm -f pbbuttonsd$(EXEEXT)
+- $(CXXLINK) $(pbbuttonsd_LDFLAGS) $(pbbuttonsd_OBJECTS) $(pbbuttonsd_LDADD) $(LIBS)
++ $(LINK) $(pbbuttonsd_LDFLAGS) $(pbbuttonsd_OBJECTS) $(pbbuttonsd_LDADD) $(LIBS)
+
+ mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
diff --git a/app-laptop/pbbuttonsd/files/laptopmode.sh.patch b/app-laptop/pbbuttonsd/files/laptopmode.sh.patch
new file mode 100644
index 000000000000..b3eac6da0464
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/laptopmode.sh.patch
@@ -0,0 +1,29 @@
+--- scripts/scripts.d/laptopmode.sh.bak 2012-09-09 12:15:45.632869735 -0400
++++ scripts/scripts.d/laptopmode.sh 2012-09-09 12:16:23.157824284 -0400
+@@ -122,7 +122,7 @@
+ )
+ )
+ case "$KLEVEL" in
+- "2.4"|"2.6")
++ "2.4"|"2.6"|"3."*)
+ true
+ ;;
+ *)
+@@ -222,7 +222,7 @@
+ echo "1" > /proc/sys/vm/laptop_mode
+ echo "30 500 0 0 $AGE $AGE 60 20 0" > /proc/sys/vm/bdflush
+ ;;
+- "2.6")
++ "2.6"|"3."*)
+ echo "5" > /proc/sys/vm/laptop_mode
+ echo "$AGE" > /proc/sys/vm/dirty_writeback_centisecs
+ echo "$AGE" > /proc/sys/vm/dirty_expire_centisecs
+@@ -268,7 +268,7 @@
+ "2.4")
+ echo "30 500 0 0 $U_AGE $B_AGE 60 20 0" > /proc/sys/vm/bdflush
+ ;;
+- "2.6")
++ "2.6"|"3."*)
+ echo "$U_AGE" > /proc/sys/vm/dirty_writeback_centisecs
+ echo "$B_AGE" > /proc/sys/vm/dirty_expire_centisecs
+ echo "$DEF_DIRTY_RATIO" > /proc/sys/vm/dirty_ratio
diff --git a/app-laptop/pbbuttonsd/files/lm.patch b/app-laptop/pbbuttonsd/files/lm.patch
new file mode 100644
index 000000000000..feb7620ea97b
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/lm.patch
@@ -0,0 +1,11 @@
+--- src/Makefile.in.bak 2008-01-11 14:48:19.000000000 -0500
++++ src/Makefile.in 2008-01-11 14:46:01.000000000 -0500
+@@ -255,7 +255,7 @@
+ module_peep.c module_peep.h debug.h \
+ tcp.c tcp.h
+
+-pbbuttonsd_LDADD = -lpbb $(INTLLIBS) $(PB_OBJECTS) $(PB_LIBS) @PACKAGE_LIBS@
++pbbuttonsd_LDADD = -lpbb -lm $(INTLLIBS) $(PB_OBJECTS) $(PB_LIBS) @PACKAGE_LIBS@
+ pbbuttonsd_LDFLAGS = -L$(top_srcdir)/libpbbipc
+ pbbuttonsd_DEPENDENCIES = $(PB_OBJECTS)
+ @DEBUG_TRUE@AM_CFLAGS1 = -DDEBUG
diff --git a/app-laptop/pbbuttonsd/files/lz.patch b/app-laptop/pbbuttonsd/files/lz.patch
new file mode 100644
index 000000000000..d648754e3ef3
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/lz.patch
@@ -0,0 +1,25 @@
+--- configure.in.bak 2007-12-01 11:45:51.000000000 -0500
++++ configure.in 2007-12-01 11:46:42.000000000 -0500
+@@ -33,6 +33,9 @@
+ PB_OBJECTS=
+ PB_LIBS=
+
++### Setup PKG_CONFIG
++PKG_PROG_PKG_CONFIG
++
+ if test "x$laptop" != "x"; then
+ ac_laptop=$laptop
+ elif test "x$LAPTOP" != "x"; then
+@@ -59,10 +62,9 @@
+ AC_CHECK_HEADERS([smbios/SystemInfo.h],
+ AC_DEFINE_UNQUOTED(WITH_SMBIOS, 1, [SMBIOS available]),
+ AC_MSG_ERROR([SMBios library not available. Please install development files for libsmbios.]), [/* dummy */])
+- AC_CHECK_HEADERS([pci/pci.h sys/io.h], ac_macbook=yes,
+- AC_MSG_ERROR([Please install development files for libpci and direct I/O.]), [/* dummy */])
++ PKG_CHECK_MODULES(LIBPCI, libpci)
+ PB_OBJECTS+=" driver_backlight_x1600.$OBJEXT driver_backlight_gma950.$OBJEXT module_acpi.$OBJEXT module_imac.$OBJEXT"
+- PB_LIBS+=" -lpci -lsmbios"
++ PB_LIBS+=" -lsmbios $LIBPCI_LIBS"
+ LCD_FADINGSPEED="448"
+ LCD_AUTOADJMODE="linear"
+ LCD_AUTOADJPARMBAT="0,10,80,30"
diff --git a/app-laptop/pbbuttonsd/files/pbbuttonsd.rc6 b/app-laptop/pbbuttonsd/files/pbbuttonsd.rc6
new file mode 100644
index 000000000000..f56c1465acdf
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/pbbuttonsd.rc6
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use alsasound
+}
+
+start() {
+ ebegin "Starting pbbuttonsd"
+ /usr/bin/pbbuttonsd -d > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping pbbuttonsd"
+ start-stop-daemon --stop --quiet --exec /usr/bin/pbbuttonsd
+ eend $?
+}
diff --git a/app-laptop/pbbuttonsd/files/pmcs.patch b/app-laptop/pbbuttonsd/files/pmcs.patch
new file mode 100644
index 000000000000..21dd23831a36
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/pmcs.patch
@@ -0,0 +1,21 @@
+--- scripts/pmcs-config.bak 2007-07-07 13:52:25.000000000 -0400
++++ scripts/pmcs-config 2007-07-18 21:29:27.000000000 -0400
+@@ -11,15 +11,15 @@
+
+ # Section for power policy 'performance'
+ performance_HDTimeOff=0 # hdsetup - timeout in seconds
+-performance_HDOptions="-p" # hdsetup
++performance_HDOptions="" # hdsetup
+ performance_LaptopMode="stop" # bdflush
+
+ # Section for power policy 'custom'
+ custom_HDTimeOff=60 # hdsetup - timeout in seconds
+-custom_HDOptions="-p" # hdsetup
++custom_HDOptions="" # hdsetup
+ custom_LaptopMode="start" # bdflush
+
+ # Section for power policy 'powersave'
+ powersave_HDTimeOff=60 # hdsetup - timeout in seconds
+-powersave_HDOptions="-p" # hdsetup
++powersave_HDOptions="" # hdsetup
+ powersave_LaptopMode="start" # bdflush
diff --git a/app-laptop/pbbuttonsd/files/wireless b/app-laptop/pbbuttonsd/files/wireless
new file mode 100644
index 000000000000..b110b3819a68
--- /dev/null
+++ b/app-laptop/pbbuttonsd/files/wireless
@@ -0,0 +1,7 @@
+#!/bin/sh
+### Restart the wireless device on Gentoo
+### Useful for bcm43xx/b43 which doesn't reconnect on resume
+
+### Uncomment the line below and properly set the device variable
+WIRELESS="net.wlan0"
+# /etc/init.d/${WIRELESS} restart
diff --git a/app-laptop/pbbuttonsd/metadata.xml b/app-laptop/pbbuttonsd/metadata.xml
new file mode 100644
index 000000000000..1a1b5460d183
--- /dev/null
+++ b/app-laptop/pbbuttonsd/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ppc</herd>
+ <use>
+ <flag name="ibam">Enable support for Intelligent Battery Monitoring</flag>
+ <flag name="macbook">Enable support for the Macbook and Macbook Pro</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">pbbuttons</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r3.ebuild b/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r3.ebuild
new file mode 100644
index 000000000000..08fb920a2ffa
--- /dev/null
+++ b/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r3.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit autotools flag-o-matic eutils
+
+DESCRIPTION="Handles power management and special keys on laptops"
+HOMEPAGE="http://pbbuttons.berlios.de"
+SRC_URI="mirror://sourceforge/pbbuttons/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ppc ~x86"
+IUSE="acpi alsa debug doc ibam macbook oss"
+
+DEPEND="macbook? (
+ sys-libs/libsmbios
+ sys-apps/pciutils
+ )
+ >=dev-libs/glib-2.6
+ doc? ( app-doc/doxygen )"
+RDEPEND="alsa? ( >=media-libs/alsa-lib-1.0 )
+ >=dev-libs/glib-2.6"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/pmcs.patch"
+ ### Don't link with g++ if we don't use ibam
+ if ! use ibam; then
+ epatch "${FILESDIR}/g++.patch"
+ fi
+ ### Fix macbook -lz issue
+ epatch "${FILESDIR}/lz.patch"
+ epatch "${FILESDIR}/lm.patch"
+ ### Fix new apple hid fnmode issue
+ epatch "${FILESDIR}/fnmode.patch"
+ eautoconf
+}
+
+src_compile() {
+ # Fix crash bug on some systems
+ replace-flags -O? -O1
+
+ if use macbook; then
+ laptop=macbook
+ elif use x86 || use amd64; then
+ if use acpi; then
+ laptop=acpi
+ else
+ laptop=i386
+ fi
+ # Default to PowerBook
+ else
+ laptop=powerbook
+ fi
+
+ econf laptop=$laptop \
+ $(use_enable debug) \
+ $(use_with doc doxygen_docs) \
+ $(use_with alsa) \
+ $(use_with oss) \
+ $(use_with ibam) \
+ || die "Sorry, failed to configure pbbuttonsd"
+
+ # Thanks to Stefan Bruda for this workaround
+ # Using -j1 fixes a parallel build issue with the docs
+ if use doc; then
+ emake -j1 || die "Sorry, failed to compile pbbuttonsd"
+ else
+ emake || die "Sorry, failed to compile pbbuttonsd"
+ fi
+}
+
+src_install() {
+ dodir /etc/power
+ use ibam && dodir /var/lib/ibam
+ make DESTDIR="${D}" install || die "failed to install"
+ newinitd "${FILESDIR}/pbbuttonsd.rc6" pbbuttonsd
+ dodoc README
+ use doc && dohtml -r doc/*
+
+ dodir /etc/power/resume.d
+ dodir /etc/power/suspend.d
+ dodir /etc/power/scripts.d
+ exeinto "/etc/power/scripts.d"
+ doexe "${FILESDIR}/wireless"
+ ln -s "${D}/etc/power/scripts.d/wireless" "${D}/etc/power/resume.d/wireless"
+}
+
+pkg_postinst() {
+ if [ -e /etc/pbbuttonsd.conf ]; then
+ ewarn "The pbbuttonsd.cnf file replaces /etc/pbuttonsd.conf with a new"
+ ewarn "file (/etc/pbbuttonsd.conf) and a new format. Please check the"
+ ewarn "manual page with 'man pbbuttonsd.cnf' for details."
+ ewarn
+ fi
+
+ if use macbook; then
+ ewarn "Macbook and Macbook Pro users should make sure to have applesmc"
+ ewarn "loaded before starting pbbuttonsdm otherwise auto-adjustments"
+ ewarn "will not work and pbbuttonsd may segfault."
+ fi
+
+ ewarn "Ensure that the evdev kernel module is loaded otherwise"
+ ewarn "pbbuttonsd won't work. SysV IPC is also required."
+ ewarn
+ ewarn "If you need extra security, you can tell pbbuttonsd to only accept"
+ ewarn "input from one user. You can set the userallowed option in"
+ ewarn "/etc/pbbuttonsd.cnf to limit access."
+ ewarn
+
+ if use ibam; then
+ elog "To properly initialize the IBaM battery database, you will"
+ elog "need to perform a full discharge/charge cycle. For more"
+ elog "details, please see the pbbuttonsd man page."
+ elog
+ fi
+
+ elog "A script is now available to reset your wirless connection on resume."
+ elog "Simply uncomment the commented command and set the correct device to"
+ elog "use it. You can find the script in /etc/power/resume.d/wireless"
+
+}
diff --git a/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r4.ebuild b/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r4.ebuild
new file mode 100644
index 000000000000..27bdd3d92dcd
--- /dev/null
+++ b/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r4.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit autotools flag-o-matic eutils
+
+DESCRIPTION="Handles power management and special keys on laptops"
+HOMEPAGE="http://pbbuttons.berlios.de"
+SRC_URI="mirror://sourceforge/pbbuttons/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="acpi alsa debug doc ibam macbook oss"
+
+DEPEND="macbook? (
+ sys-libs/libsmbios
+ sys-apps/pciutils
+ )
+ >=dev-libs/glib-2.6
+ doc? ( app-doc/doxygen )"
+RDEPEND="alsa? ( >=media-libs/alsa-lib-1.0 )
+ >=dev-libs/glib-2.6"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/pmcs.patch"
+ ### Don't link with g++ if we don't use ibam
+ if ! use ibam; then
+ epatch "${FILESDIR}/g++.patch"
+ fi
+ ### Fix macbook -lz issue
+ epatch "${FILESDIR}/lz.patch"
+ epatch "${FILESDIR}/lm.patch"
+ ### Fix new apple hid fnmode issue
+ epatch "${FILESDIR}/fnmode.patch"
+ ### Add kernel 2.6.x stuff for 3.x as well
+ epatch "${FILESDIR}/laptopmode.sh.patch"
+ epatch "${FILESDIR}/cpufreq.patch"
+
+ eautoconf
+}
+
+src_compile() {
+ # Fix crash bug on some systems
+ replace-flags -O? -O1
+
+ if use macbook; then
+ laptop=macbook
+ elif use x86 || use amd64; then
+ if use acpi; then
+ laptop=acpi
+ else
+ laptop=i386
+ fi
+ # Default to PowerBook
+ else
+ laptop=powerbook
+ fi
+
+ econf laptop=$laptop \
+ $(use_enable debug) \
+ $(use_with doc doxygen_docs) \
+ $(use_with alsa) \
+ $(use_with oss) \
+ $(use_with ibam) \
+ || die "Sorry, failed to configure pbbuttonsd"
+
+ # Thanks to Stefan Bruda for this workaround
+ # Using -j1 fixes a parallel build issue with the docs
+ if use doc; then
+ emake -j1 || die "Sorry, failed to compile pbbuttonsd"
+ else
+ emake || die "Sorry, failed to compile pbbuttonsd"
+ fi
+}
+
+src_install() {
+ dodir /etc/power
+ use ibam && dodir /var/lib/ibam
+ make DESTDIR="${D}" install || die "failed to install"
+ newinitd "${FILESDIR}/pbbuttonsd.rc6" pbbuttonsd
+ dodoc README
+ use doc && dohtml -r doc/*
+
+ dodir /etc/power/resume.d
+ dodir /etc/power/suspend.d
+ dodir /etc/power/scripts.d
+ exeinto "/etc/power/scripts.d"
+ doexe "${FILESDIR}/wireless"
+ ln -s "${D}/etc/power/scripts.d/wireless" "${D}/etc/power/resume.d/wireless"
+}
+
+pkg_postinst() {
+ if [ -e /etc/pbbuttonsd.conf ]; then
+ ewarn "The pbbuttonsd.cnf file replaces /etc/pbuttonsd.conf with a new"
+ ewarn "file (/etc/pbbuttonsd.conf) and a new format. Please check the"
+ ewarn "manual page with 'man pbbuttonsd.cnf' for details."
+ ewarn
+ fi
+
+ if use macbook; then
+ ewarn "Macbook and Macbook Pro users should make sure to have applesmc"
+ ewarn "loaded before starting pbbuttonsdm otherwise auto-adjustments"
+ ewarn "will not work and pbbuttonsd may segfault."
+ fi
+
+ ewarn "Ensure that the evdev kernel module is loaded otherwise"
+ ewarn "pbbuttonsd won't work. SysV IPC is also required."
+ ewarn
+ ewarn "If you need extra security, you can tell pbbuttonsd to only accept"
+ ewarn "input from one user. You can set the userallowed option in"
+ ewarn "/etc/pbbuttonsd.cnf to limit access."
+ ewarn
+
+ if use ibam; then
+ elog "To properly initialize the IBaM battery database, you will"
+ elog "need to perform a full discharge/charge cycle. For more"
+ elog "details, please see the pbbuttonsd man page."
+ elog
+ fi
+
+ elog "A script is now available to reset your wirless connection on resume."
+ elog "Simply uncomment the commented command and set the correct device to"
+ elog "use it. You can find the script in /etc/power/resume.d/wireless"
+
+}