diff options
Diffstat (limited to 'app-laptop/pbbuttonsd')
-rw-r--r-- | app-laptop/pbbuttonsd/Manifest | 11 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-cpufreq.patch | 20 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-fnmode.patch | 23 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-g++.patch | 11 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-laptopmode.sh.patch | 29 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-lm.patch | 11 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-lz.patch | 25 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/pbbuttonsd.rc6 | 19 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/files/wireless | 7 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/metadata.xml | 15 | ||||
-rw-r--r-- | app-laptop/pbbuttonsd/pbbuttonsd-0.8.1a.ebuild | 137 |
11 files changed, 308 insertions, 0 deletions
diff --git a/app-laptop/pbbuttonsd/Manifest b/app-laptop/pbbuttonsd/Manifest new file mode 100644 index 000000000000..8dec472ebd03 --- /dev/null +++ b/app-laptop/pbbuttonsd/Manifest @@ -0,0 +1,11 @@ +AUX pbbuttonsd-0.8.1-cpufreq.patch 757 BLAKE2B 1095205cc20461b49161e7071daa2654b675447574de5575e6d623d920cc8ea827f593bca03692ee5defd61cbfc8261646a1e321a9924f331dd6cd05d18722c4 SHA512 b458ddbcbe8e20fdb316d436f3c3f6c7668ce02cabd2d25d7ed731ad14b431a3f1eb67185d3d5bec26921db1343d5996541c248b7bfeaf1117d469aa4f2a7bad +AUX pbbuttonsd-0.8.1-fnmode.patch 850 BLAKE2B 91190aced95ce4e3d9e0266074f0dcdd2037d3a3f8bfad90c6f44d04187f9f837da61b34420bb0a70f14aa5802499b039dee9ea3373889b0f9f454016bcb78e9 SHA512 00ed4dd0c0e9e7e92078275fc9fb71c5dd1afd78796cf644f091e32d8d97d7e6f2dce31cf01664f40c51e8ecbfcfe200b09c626c898dfb002426bc2e59ef1609 +AUX pbbuttonsd-0.8.1-g++.patch 431 BLAKE2B c63ff011777c4fc35c3c96985727f07967fbdb9eca66362447030adca13b0922dd5a9ffa0a3b5f2ada9d734af5a256c6be175b33566911e2d212d6063a83cd1b SHA512 01597510267ea52816bbe7e90e6ac1f872265b77f689387557b8263e5631e1ebfba09af2fc27a1034f2cde7164801c284e1b565064675dd598cc0aa82bd64073 +AUX pbbuttonsd-0.8.1-laptopmode.sh.patch 827 BLAKE2B c5153225d8c8f0dfdc380ea8a7030fb994f9893a201ee83692ef712d3ab345f4f5eca4057a36e9b45394f49d89a4a400e91fc4dd7ddb425ddbfe8243e6d49b7f SHA512 3ab0e2ce5b3fa050d7cc27c7e9d90fb3e7fdca46ba2de8e34cfd0a6338b5ba27dcb07204827ccaa8b228f37ae5941e5829b3cfe1a9c4aa3cc50754c7fcedc307 +AUX pbbuttonsd-0.8.1-lm.patch 419 BLAKE2B 2f982fb58e97f8a26970dae583c0c90e6b7be03d9fda2081a64db0f4e41e31f44e425403ccb81e4e2e17a236ac6171a7189a77fa7579752bddeaab97abc56598 SHA512 1ce79d85f9119d0d94b789557f8dc41ddcd8ca030c8b03c2399035e21115e2ff3bfb7c4284750450733ac5ad305fa2513041e65feeecd7dca81db4a23ae53e34 +AUX pbbuttonsd-0.8.1-lz.patch 920 BLAKE2B ab9a5cdf4b9ac2b1dd55229ab7dcfcf65bf4ff3b526f52705c366ec364131fcea31222837a910b37f5507600de6ed4e278bcf0f52cc96bfc5aae8a747cf69359 SHA512 17546f9b7e8b488a2ace5cab29da3738ff59c708aeaae1ef58e6240dba0876254f83f5df358d76af271c636d64c512d7d9fa550e377d4e57d92851a720441dea +AUX pbbuttonsd.rc6 355 BLAKE2B 41e646f547b684930949669760ffd7e09c6ef4591e6183b12d555dba45d100414cc5daa54ef26e2bba491841553961955cb0a29c9c5d6b37d4e13f9a3117a9fb SHA512 93165ce1d1c757e58b407656bf86084bb3fcfe0c55897fbb382f107ff9b3d69559255a11ac3017cf5741eb2923d753f5cc3f1b495e31e16b18b16757accfbdfb +AUX wireless 235 BLAKE2B 1fdc5401c1bcc927cad521bb7e6d502fd072c6aae119e59d92c19431985cccaecad5ba55a27af888e63881d0305ee732dce9b1e777e4b2322a98efaad13de310 SHA512 58cbfb80ec32ba6868fea500bcf58bf649a0f468a017ec8c200fe0edd0fd7f1fe17efaafca3e67c20df9fc5a6c80b2941237a375f6e73349a83593dcfacf2816 +DIST pbbuttonsd-0.8.1a.tar.gz 589747 BLAKE2B a0410b7f165e8a0f5b6efa8fa86cc32a84e62da08141d285442d48f0e541d4d6d063e61a7e48aa7901135c4fc9640a7968be821619b3741ce30ba1497015aad4 SHA512 4aaf674872982925f7aa8e06a363f50830f13d9491f4a3b850c1852a8a6d4b2c72164f839c482eed059703dd25d900fe3bb774f78e7039ac2464ea7a1837bf99 +EBUILD pbbuttonsd-0.8.1a.ebuild 3251 BLAKE2B f671bdbfde56131bd0fe73cb8fa6398c6479c7fa2697815ed0c116945f96aec4f0274e251781efee8c8c692505f85d55ae3b414d2d547fb1c64b25a5e20559d0 SHA512 05df1091b4f54a8797a756d87549a4a88075993a5f8f4027127041209b3f65956f457fa9e682b914b6565c47ba19994af1adb81a76ca8f5944e7317cfe161cb1 +MISC metadata.xml 511 BLAKE2B 74e7a1939ef37f6fb312232b3df04de1ba6b0bb2e8bd476c0ebdeb2d7efcda0015204e4c003388194ac481f3fcb551949b4dba5515b770cd2d6ab78dd43ab72b SHA512 5a56b1fe175cd76fa23d90e4499f0a6bacfacdb9cb2fd647dbabec42030021c0b4f27eb04b523b9ae7bc44706ee9404abdf5ff16aa92655fab5d00ac187eca5b diff --git a/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-cpufreq.patch b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-cpufreq.patch new file mode 100644 index 000000000000..89ab72a8947f --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-cpufreq.patch @@ -0,0 +1,20 @@ +--- a/scripts/scripts.d/cpufreq ++++ b/scripts/scripts.d/cpufreq +@@ -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/pbbuttonsd-0.8.1-fnmode.patch b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-fnmode.patch new file mode 100644 index 000000000000..3c4ed71cb367 --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-fnmode.patch @@ -0,0 +1,23 @@ +--- a/src/module_pmac.c ++++ b/src/module_pmac.c +@@ -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/pbbuttonsd-0.8.1-g++.patch b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-g++.patch new file mode 100644 index 000000000000..de43b800128f --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-g++.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -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/pbbuttonsd-0.8.1-laptopmode.sh.patch b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-laptopmode.sh.patch new file mode 100644 index 000000000000..c29efe3122ac --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-laptopmode.sh.patch @@ -0,0 +1,29 @@ +--- a/scripts/scripts.d/laptopmode.sh ++++ b/scripts/scripts.d/laptopmode.sh +@@ -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/pbbuttonsd-0.8.1-lm.patch b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-lm.patch new file mode 100644 index 000000000000..794de96244cb --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-lm.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -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/pbbuttonsd-0.8.1-lz.patch b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-lz.patch new file mode 100644 index 000000000000..93cebe1d5c6e --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd-0.8.1-lz.patch @@ -0,0 +1,25 @@ +--- a/configure.in ++++ b/configure.in +@@ -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..ba5e167790d0 --- /dev/null +++ b/app-laptop/pbbuttonsd/files/pbbuttonsd.rc6 @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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/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..c123825ee27e --- /dev/null +++ b/app-laptop/pbbuttonsd/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ppc@gentoo.org</email> + <name>Gentoo Linux PowerPC Development</name> + </maintainer> + <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.1a.ebuild b/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1a.ebuild new file mode 100644 index 000000000000..8a17130c0544 --- /dev/null +++ b/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1a.ebuild @@ -0,0 +1,137 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools flag-o-matic + +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 doc ibam macbook oss static-libs" + +RDEPEND=" + >=dev-libs/glib-2.6 + alsa? ( >=media-libs/alsa-lib-1.0 ) + macbook? ( + sys-apps/pciutils + sys-libs/libsmbios + ) +" +DEPEND=" + ${RDEPEND} + doc? ( app-doc/doxygen ) +" +PATCHES=( + "${FILESDIR}/${PN}-0.8.1-cpufreq.patch" + "${FILESDIR}/${PN}-0.8.1-fnmode.patch" + "${FILESDIR}/${PN}-0.8.1-laptopmode.sh.patch" + "${FILESDIR}/${PN}-0.8.1-lm.patch" + "${FILESDIR}/${PN}-0.8.1-lz.patch" +) + +src_prepare() { + ### Don't link with g++ if we don't use ibam + if ! use ibam; then + eapply "${FILESDIR}/${PN}-0.8.1-g++.patch" + fi + + default + + eautoconf +} + +src_configure() { + # 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 + + laptop=$laptop \ + econf \ + $(use_with alsa) \ + $(use_with doc doxygen_docs) \ + $(use_with ibam) \ + $(use_with oss) + +} + +src_compile() { + # Thanks to Stefan Bruda for this workaround + # Using -j1 fixes a parallel build issue with the docs + if use doc; then + emake -j1 + else + emake + fi +} + +src_install() { + dodir /etc/power + use ibam && dodir /var/lib/ibam + + default + + use static-libs || rm "${D}"/usr/$(get_libdir)/libpbb.a + + newinitd "${FILESDIR}/pbbuttonsd.rc6" pbbuttonsd + dodoc README + use doc && dodoc -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." + ewarn + 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" + +} |