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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jan 14 02:02:32 2010 UTC (4 years, 11 months ago) by josejx
Branch: MAIN
Changes since 1.1: +3 -3 lines
Marked ppc stable.
(Portage version: 2.1.6.13/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.1 2008/12/28 02:14:12 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 eautoconf
40 }
41
42 src_compile() {
43 # Fix crash bug on some systems
44 replace-flags -O? -O1
45
46 if use macbook; then
47 laptop=macbook
48 elif use x86 || use amd64; then
49 if use acpi; then
50 laptop=acpi
51 else
52 laptop=i386
53 fi
54 # Default to PowerBook
55 else
56 laptop=powerbook
57 fi
58
59 econf laptop=$laptop \
60 $(use_enable debug) \
61 $(use_with doc doxygen_docs) \
62 $(use_with alsa) \
63 $(use_with oss) \
64 $(use_with ibam) \
65 || die "Sorry, failed to configure pbbuttonsd"
66
67 # Thanks to Stefan Bruda for this workaround
68 # Using -j1 fixes a parallel build issue with the docs
69 if use doc; then
70 emake -j1 || die "Sorry, failed to compile pbbuttonsd"
71 else
72 emake || die "Sorry, failed to compile pbbuttonsd"
73 fi
74 }
75
76 src_install() {
77 dodir /etc/power
78 use ibam && dodir /var/lib/ibam
79 make DESTDIR="${D}" install || die "failed to install"
80 newinitd "${FILESDIR}/pbbuttonsd.rc6" pbbuttonsd
81 dodoc README
82 use doc && dohtml -r doc/*
83
84 dodir /etc/power/resume.d
85 dodir /etc/power/suspend.d
86 dodir /etc/power/scripts.d
87 exeinto "/etc/power/scripts.d"
88 doexe "${FILESDIR}/wireless"
89 ln -s "${D}/etc/power/scripts.d/wireless" "${D}/etc/power/resume.d/wireless"
90 }
91
92 pkg_postinst() {
93 if [ -e /etc/pbbuttonsd.conf ]; then
94 ewarn "The pbbuttonsd.cnf file replaces /etc/pbuttonsd.conf with a new"
95 ewarn "file (/etc/pbbuttonsd.conf) and a new format. Please check the"
96 ewarn "manual page with 'man pbbuttonsd.cnf' for details."
97 ewarn
98 fi
99
100 if use macbook; then
101 ewarn "Macbook and Macbook Pro users should make sure to have applesmc"
102 ewarn "loaded before starting pbbuttonsdm otherwise auto-adjustments"
103 ewarn "will not work and pbbuttonsd may segfault."
104 fi
105
106 ewarn "Ensure that the evdev kernel module is loaded otherwise"
107 ewarn "pbbuttonsd won't work. SysV IPC is also required."
108 ewarn
109 ewarn "If you need extra security, you can tell pbbuttonsd to only accept"
110 ewarn "input from one user. You can set the userallowed option in"
111 ewarn "/etc/pbbuttonsd.cnf to limit access."
112 ewarn
113
114 if use ibam; then
115 elog "To properly initialize the IBaM battery database, you will"
116 elog "need to perform a full discharge/charge cycle. For more"
117 elog "details, please see the pbbuttonsd man page."
118 elog
119 fi
120
121 elog "A script is now available to reset your wirless connection on resume."
122 elog "Simply uncomment the commented command and set the correct device to"
123 elog "use it. You can find the script in /etc/power/resume.d/wireless"
124
125 }

  ViewVC Help
Powered by ViewVC 1.1.20