/[gentoo-x86]/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r4.ebuild
Gentoo

Contents of /app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Sep 9 16:21:48 2012 UTC (2 years, 10 months ago) by josejx
Branch: MAIN
Removed old version, added patches from Massimo Burcheri (bug #429306).

(Portage version: 2.1.11.13/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-laptop/pbbuttonsd/pbbuttonsd-0.8.1-r3.ebuild,v 1.2 2010/01/14 02:02:32 josejx Exp $
4
5 inherit autotools flag-o-matic eutils
6
7 DESCRIPTION="Handles power management and special keys on laptops."
8 HOMEPAGE="http://pbbuttons.berlios.de"
9 SRC_URI="mirror://sourceforge/pbbuttons/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~amd64 ~ppc ~x86"
14 IUSE="acpi alsa debug doc ibam macbook oss"
15
16 DEPEND="macbook? (
17 sys-libs/libsmbios
18 sys-apps/pciutils
19 )
20 >=dev-libs/glib-2.6
21 doc? ( app-doc/doxygen )"
22 RDEPEND="alsa? ( >=media-libs/alsa-lib-1.0 )
23 >=dev-libs/glib-2.6"
24
25 src_unpack() {
26 unpack ${A}
27 cd "${S}"
28
29 epatch "${FILESDIR}/pmcs.patch"
30 ### Don't link with g++ if we don't use ibam
31 if ! use ibam; then
32 epatch "${FILESDIR}/g++.patch"
33 fi
34 ### Fix macbook -lz issue
35 epatch "${FILESDIR}/lz.patch"
36 epatch "${FILESDIR}/lm.patch"
37 ### Fix new apple hid fnmode issue
38 epatch "${FILESDIR}/fnmode.patch"
39 ### Add kernel 2.6.x stuff for 3.x as well
40 epatch "${FILESDIR}/laptopmode.sh.patch"
41 epatch "${FILESDIR}/cpufreq.patch"
42
43 eautoconf
44 }
45
46 src_compile() {
47 # Fix crash bug on some systems
48 replace-flags -O? -O1
49
50 if use macbook; then
51 laptop=macbook
52 elif use x86 || use amd64; then
53 if use acpi; then
54 laptop=acpi
55 else
56 laptop=i386
57 fi
58 # Default to PowerBook
59 else
60 laptop=powerbook
61 fi
62
63 econf laptop=$laptop \
64 $(use_enable debug) \
65 $(use_with doc doxygen_docs) \
66 $(use_with alsa) \
67 $(use_with oss) \
68 $(use_with ibam) \
69 || die "Sorry, failed to configure pbbuttonsd"
70
71 # Thanks to Stefan Bruda for this workaround
72 # Using -j1 fixes a parallel build issue with the docs
73 if use doc; then
74 emake -j1 || die "Sorry, failed to compile pbbuttonsd"
75 else
76 emake || die "Sorry, failed to compile pbbuttonsd"
77 fi
78 }
79
80 src_install() {
81 dodir /etc/power
82 use ibam && dodir /var/lib/ibam
83 make DESTDIR="${D}" install || die "failed to install"
84 newinitd "${FILESDIR}/pbbuttonsd.rc6" pbbuttonsd
85 dodoc README
86 use doc && dohtml -r doc/*
87
88 dodir /etc/power/resume.d
89 dodir /etc/power/suspend.d
90 dodir /etc/power/scripts.d
91 exeinto "/etc/power/scripts.d"
92 doexe "${FILESDIR}/wireless"
93 ln -s "${D}/etc/power/scripts.d/wireless" "${D}/etc/power/resume.d/wireless"
94 }
95
96 pkg_postinst() {
97 if [ -e /etc/pbbuttonsd.conf ]; then
98 ewarn "The pbbuttonsd.cnf file replaces /etc/pbuttonsd.conf with a new"
99 ewarn "file (/etc/pbbuttonsd.conf) and a new format. Please check the"
100 ewarn "manual page with 'man pbbuttonsd.cnf' for details."
101 ewarn
102 fi
103
104 if use macbook; then
105 ewarn "Macbook and Macbook Pro users should make sure to have applesmc"
106 ewarn "loaded before starting pbbuttonsdm otherwise auto-adjustments"
107 ewarn "will not work and pbbuttonsd may segfault."
108 fi
109
110 ewarn "Ensure that the evdev kernel module is loaded otherwise"
111 ewarn "pbbuttonsd won't work. SysV IPC is also required."
112 ewarn
113 ewarn "If you need extra security, you can tell pbbuttonsd to only accept"
114 ewarn "input from one user. You can set the userallowed option in"
115 ewarn "/etc/pbbuttonsd.cnf to limit access."
116 ewarn
117
118 if use ibam; then
119 elog "To properly initialize the IBaM battery database, you will"
120 elog "need to perform a full discharge/charge cycle. For more"
121 elog "details, please see the pbbuttonsd man page."
122 elog
123 fi
124
125 elog "A script is now available to reset your wirless connection on resume."
126 elog "Simply uncomment the commented command and set the correct device to"
127 elog "use it. You can find the script in /etc/power/resume.d/wireless"
128
129 }

  ViewVC Help
Powered by ViewVC 1.1.20