/[gentoo-x86]/sys-apps/hal/hal-0.5.10.ebuild
Gentoo

Contents of /sys-apps/hal/hal-0.5.10.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Tue May 20 04:30:38 2008 UTC (5 years, 11 months ago) by compnerd
Branch: MAIN
Changes since 1.15: +2 -2 lines
fix a few quoting issues
(Portage version: 2.1.5)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.10.ebuild,v 1.15 2008/04/20 12:50:02 vapier Exp $
4
5 inherit eutils linux-info autotools flag-o-matic
6
7 PATCH_VER="0"
8
9 DESCRIPTION="Hardware Abstraction Layer"
10 HOMEPAGE="http://www.freedesktop.org/Software/hal"
11 SRC_URI="http://hal.freedesktop.org/releases/${P}.tar.gz
12 http://dev.gentoo.org/~compnerd/files/${PN}/${P}-gentoo-patches-${PATCH_VER}.tar.bz2"
13
14 LICENSE="|| ( GPL-2 AFL-2.0 )"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~sparc ~x86"
17
18 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
19 IUSE="acpi apm crypt debug dell disk-partition doc laptop selinux ${KERNEL_IUSE}"
20
21 RDEPEND=">=dev-libs/glib-2.6
22 >=dev-libs/dbus-glib-0.61
23 >=dev-libs/expat-1.95.8
24 >=sys-apps/pciutils-2.2.7-r1
25 >=dev-libs/libusb-0.1.10a
26 >=dev-util/gperf-3.0.3
27 sys-apps/usbutils
28 virtual/eject
29 amd64? ( >=sys-apps/dmidecode-2.7 )
30 dell? ( >=sys-libs/libsmbios-0.13.4 )
31 disk-partition? (
32 || (
33 ~sys-apps/parted-1.7.1
34 ~sys-apps/parted-1.8.6
35 ~sys-apps/parted-1.8.7
36 )
37 )
38 ia64? ( >=sys-apps/dmidecode-2.7 )
39 kernel_linux? (
40 >=sys-fs/udev-111
41 >=sys-apps/util-linux-2.13
42 >=sys-kernel/linux-headers-2.6.19
43 crypt? ( >=sys-fs/cryptsetup-1.0.5 )
44 )
45 kernel_FreeBSD? ( dev-libs/libvolume_id )
46 x86? ( >=sys-apps/dmidecode-2.7 )
47 selinux? ( sys-libs/libselinux sec-policy/selinux-hal )"
48 DEPEND="${RDEPEND}
49 dev-util/pkgconfig
50 >=dev-util/intltool-0.35
51 doc? (
52 app-doc/doxygen
53 app-text/docbook-sgml-utils
54 app-text/xmlto
55 dev-libs/libxml2
56 )"
57 PDEPEND=">=app-misc/hal-info-20071011
58 laptop? ( >=sys-power/pm-utils-0.99.3 )"
59
60 ## HAL Daemon drops privledges so we need group access to read disks
61 HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
62 HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
63
64 function check_hotplug_net() {
65 local CONFIG_CHECK="~HOTPLUG ~NET"
66 local WARNING_HOTPLUG="CONFIG_HOTPLUG:\tis not set (required for HAL)
67 "
68 local WARNING_NET="CONFIG_NET:\tis not set (required for HAL)\n"
69 check_extra_config
70 }
71
72 function check_inotify() {
73 local CONFIG_CHECK="~INOTIFY_USER"
74 local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)\n"
75 check_extra_config
76 }
77
78 function check_acpi_proc() {
79 local CONFIG_CHECK="~ACPI_PROCFS ~ACPI_PROC_EVENT"
80 local WARNING_ACPI_PROCFS="CONFIG_ACPI_PROCFS:\tis not set (required for HAL)\n"
81 local WARNING_ACPI_PROC_EVENT="CONFIG_ACPI_PROC_EVENT:\tis not set (required for HAL)\n"
82 check_extra_config
83 }
84
85 pkg_setup() {
86 if use kernel_linux ; then
87 if [ -e "${ROOT}/usr/src/linux/.config" ] ; then
88 kernel_is ge 2 6 19 || \
89 ewarn "HAL requires a kernel version 2.6.19 or newer"
90 if kernel_is lt 2 6 23 && use acpi ; then
91 check_acpi_proc
92 fi
93 fi
94
95 check_hotplug_net
96 check_inotify
97 fi
98
99 # http://devmanual.gentoo.org/ebuild-writing/functions/
100 # http://bugs.gentoo.org/show_bug.cgi?id=191605
101
102 # Create groups for hotplugging and HAL
103 enewgroup haldaemon || die "Problem adding haldaemon group"
104 enewgroup plugdev || die "Problem adding plugdev group"
105
106 # HAL drops priviledges by default now ...
107 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
108 if use kernel_linux; then
109 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
110 || die "Problem adding haldaemon user"
111 elif use kernel_FreeBSD; then
112 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
113 || die "Problem addding haldaemon user"
114 fi
115
116 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
117 # If users have a problem with this, let them file a bug
118 if [[ ${ROOT} == / ]] ; then
119 if use kernel_linux; then
120 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
121 elif use kernel_FreeBSD; then
122 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
123 fi
124 fi
125 }
126
127 src_unpack() {
128 unpack ${A}
129 cd "${S}"
130
131 EPATCH_MULTI_MSG="Applying Gentoo Patchset ..." \
132 EPATCH_SUFFIX="patch" \
133 EPATCH_SOURCE="${WORKDIR}/hal-0.5.10-patches/" \
134 EPATCH_FORCE="yes" \
135 epatch
136
137 epatch "${FILESDIR}"/${P}-autotools.patch #212772
138
139 # Hide recovery partitions
140 epatch "${FILESDIR}/hal-0.5.9-hide-recovery-partitions.patch"
141
142 # Enable plugdev support
143 epatch "${FILESDIR}/96_plugdev_allow_send.patch"
144
145 eautoreconf
146 }
147
148 src_compile() {
149 local acpi="$(use_enable acpi)"
150 local backend=
151 local hardware=
152
153 append-flags -rdynamic
154
155 if use kernel_linux ; then
156 backend="linux"
157 elif use kernel_FreeBSD ; then
158 backend="freebsd"
159 else
160 eerror "Invalid backend"
161 fi
162
163 if use kernel_linux ; then
164 if use acpi ; then
165 # Using IBM ACPI and Toshiba ACPI results in double notification as this
166 # was merged into the Linux Kernel 2.6.22
167 if kernel_is lt 2 6 22 ; then
168 acpi="$acpi --enable-acpi-ibm --enable-acpi-toshiba"
169 else
170 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
171 fi
172
173 acpi="$acpi --enable-acpi-proc --enable-acpi-acpid"
174 else
175 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
176 acpi="$acpi --disable-acpi-proc --disable-acpi-acpid"
177 fi
178
179 hardware="--with-cpufreq --with-usb-csr --with-keymaps"
180 use arm && hardware="$hardware --enable-omap"
181
182 if use dell ; then
183 hardware="$hardware --with-dell-backlight"
184 else
185 hardware="$hardware --without-dell-backlight"
186 fi
187 else
188 hardware="--without-cpufreq --without-usb-csr --without-keymaps"
189 hardware="$hardware --disable-omap"
190 hardware="$hardware --without-dell-backlight"
191 hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
192 fi
193
194 econf --with-backend=${backend} \
195 --with-os-type=gentoo \
196 --with-pid-file=/var/run/hald.pid \
197 --with-hwdata=/usr/share/misc \
198 --with-socket-dir=/var/run/hald \
199 --enable-umount-helper \
200 --enable-man-pages \
201 --disable-policy-kit \
202 --disable-console-kit \
203 --disable-acl-management \
204 --enable-pci \
205 --enable-sonypic \
206 $(use_enable apm) \
207 $(use_enable arm pmu) \
208 $(use_enable arm omap) \
209 $(use_enable debug verbose-mode) \
210 $(use_enable disk-partition parted) \
211 $(use_enable doc docbook-docs) \
212 $(use_enable doc doxygen-docs) \
213 --docdir=/usr/share/doc/${PF} \
214 --localstatedir=/var \
215 ${acpi} ${hardware} \
216 || die "configure failed"
217
218 emake || die "make failed"
219 }
220
221 src_install() {
222 make DESTDIR="${D}" install || die
223 dodoc AUTHORS ChangeLog NEWS README
224
225 # hal umount for unclean unmounts
226 exeinto /lib/udev/
227 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
228
229 # initscript
230 newinitd "${FILESDIR}"/0.5.10-hald.rc hald
231
232 # configuration
233 cp "${FILESDIR}"/0.5.10-hald.conf "${WORKDIR}"/
234
235 if use debug; then
236 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
237 -i "${WORKDIR}"/0.5.10-hald.conf
238 fi
239 newconfd "${WORKDIR}"/0.5.10-hald.conf hald
240
241 # We now create and keep /media here as both gnome-mount and pmount
242 # use these directories, to avoid collision.
243 keepdir /media
244
245 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
246 # or else hal bombs.
247 keepdir /etc/hal/fdi/{information,policy,preprobe}
248
249 # HAL stores it's fdi cache in /var/lib/cache/hald
250 keepdir /var/lib/cache/hald
251
252 # HAL keeps its unix socket here
253 keepdir /var/run/hald
254 keepdir /var/lib/hal
255 }
256
257 pkg_postinst() {
258 # Despite what people keep changing this location. Either one works.. it doesn't matter
259 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
260
261 elog "The HAL daemon needs to be running for certain applications to"
262 elog "work. Suggested is to add the init script to your start-up"
263 elog "scripts, this should be done like this :"
264 elog "\`rc-update add hald default\`"
265 echo
266 elog "Looking for automounting support? Add yourself to the plugdev group"
267
268 elog "IF you have additional applications which consume ACPI events, you"
269 elog "should consider installing acpid to allow applications to share ACPI"
270 elog "events."
271
272 elog "If you wish to use a non US layout, you may do so by executing:"
273 elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
274 elog "Keyboard Layout Settings mechanism."
275 elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
276 elog "it is kxkb."
277 }

  ViewVC Help
Powered by ViewVC 1.1.20