/[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.18 - (show annotations) (download)
Fri Dec 19 17:37:01 2008 UTC (6 years ago) by pva
Branch: MAIN
Changes since 1.17: +5 -7 lines
Removed || die after enewuser/enewgroup, bug #237286.
(Portage version: 2.2_rc17/cvs/Linux 2.6.26-openvz.git-89451f9 i686)

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.17 2008/06/01 10:57:15 nixnut 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 ~ppc ~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
104 enewgroup plugdev
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 elif use kernel_FreeBSD; then
111 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD}
112 fi
113
114 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
115 # If users have a problem with this, let them file a bug
116 if [[ ${ROOT} == / ]] ; then
117 if use kernel_linux; then
118 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
119 elif use kernel_FreeBSD; then
120 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
121 fi
122 fi
123 }
124
125 src_unpack() {
126 unpack ${A}
127 cd "${S}"
128
129 EPATCH_MULTI_MSG="Applying Gentoo Patchset ..." \
130 EPATCH_SUFFIX="patch" \
131 EPATCH_SOURCE="${WORKDIR}/hal-0.5.10-patches/" \
132 EPATCH_FORCE="yes" \
133 epatch
134
135 epatch "${FILESDIR}"/${P}-autotools.patch #212772
136
137 # Hide recovery partitions
138 epatch "${FILESDIR}/hal-0.5.9-hide-recovery-partitions.patch"
139
140 # Enable plugdev support
141 epatch "${FILESDIR}/96_plugdev_allow_send.patch"
142
143 eautoreconf
144 }
145
146 src_compile() {
147 local acpi="$(use_enable acpi)"
148 local backend=
149 local hardware=
150
151 append-flags -rdynamic
152
153 if use kernel_linux ; then
154 backend="linux"
155 elif use kernel_FreeBSD ; then
156 backend="freebsd"
157 else
158 eerror "Invalid backend"
159 fi
160
161 if use kernel_linux ; then
162 if use acpi ; then
163 # Using IBM ACPI and Toshiba ACPI results in double notification as this
164 # was merged into the Linux Kernel 2.6.22
165 if kernel_is lt 2 6 22 ; then
166 acpi="$acpi --enable-acpi-ibm --enable-acpi-toshiba"
167 else
168 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
169 fi
170
171 acpi="$acpi --enable-acpi-proc --enable-acpi-acpid"
172 else
173 acpi="$acpi --disable-acpi-ibm --disable-acpi-toshiba"
174 acpi="$acpi --disable-acpi-proc --disable-acpi-acpid"
175 fi
176
177 hardware="--with-cpufreq --with-usb-csr --with-keymaps"
178 use arm && hardware="$hardware --enable-omap"
179
180 if use dell ; then
181 hardware="$hardware --with-dell-backlight"
182 else
183 hardware="$hardware --without-dell-backlight"
184 fi
185 else
186 hardware="--without-cpufreq --without-usb-csr --without-keymaps"
187 hardware="$hardware --disable-omap"
188 hardware="$hardware --without-dell-backlight"
189 hardware="$hardware --enable-acpi-ibm --enable-acpi-toshiba"
190 fi
191
192 econf --with-backend=${backend} \
193 --with-os-type=gentoo \
194 --with-pid-file=/var/run/hald.pid \
195 --with-hwdata=/usr/share/misc \
196 --with-socket-dir=/var/run/hald \
197 --enable-umount-helper \
198 --enable-man-pages \
199 --disable-policy-kit \
200 --disable-console-kit \
201 --disable-acl-management \
202 --enable-pci \
203 --enable-sonypic \
204 $(use_enable apm) \
205 $(use_enable arm pmu) \
206 $(use_enable arm omap) \
207 $(use_enable debug verbose-mode) \
208 $(use_enable disk-partition parted) \
209 $(use_enable doc docbook-docs) \
210 $(use_enable doc doxygen-docs) \
211 --docdir=/usr/share/doc/${PF} \
212 --localstatedir=/var \
213 ${acpi} ${hardware} \
214 || die "configure failed"
215
216 emake || die "make failed"
217 }
218
219 src_install() {
220 make DESTDIR="${D}" install || die
221 dodoc AUTHORS ChangeLog NEWS README
222
223 # hal umount for unclean unmounts
224 exeinto /lib/udev/
225 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
226
227 # initscript
228 newinitd "${FILESDIR}"/0.5.10-hald.rc hald
229
230 # configuration
231 cp "${FILESDIR}"/0.5.10-hald.conf "${WORKDIR}"/
232
233 if use debug; then
234 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
235 -i "${WORKDIR}"/0.5.10-hald.conf
236 fi
237 newconfd "${WORKDIR}"/0.5.10-hald.conf hald
238
239 # We now create and keep /media here as both gnome-mount and pmount
240 # use these directories, to avoid collision.
241 keepdir /media
242
243 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
244 # or else hal bombs.
245 keepdir /etc/hal/fdi/{information,policy,preprobe}
246
247 # HAL stores it's fdi cache in /var/lib/cache/hald
248 keepdir /var/lib/cache/hald
249
250 # HAL keeps its unix socket here
251 keepdir /var/run/hald
252 keepdir /var/lib/hal
253 }
254
255 pkg_postinst() {
256 # Despite what people keep changing this location. Either one works.. it doesn't matter
257 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
258
259 elog "The HAL daemon needs to be running for certain applications to"
260 elog "work. Suggested is to add the init script to your start-up"
261 elog "scripts, this should be done like this :"
262 elog "\`rc-update add hald default\`"
263 echo
264 elog "Looking for automounting support? Add yourself to the plugdev group"
265
266 elog "IF you have additional applications which consume ACPI events, you"
267 elog "should consider installing acpid to allow applications to share ACPI"
268 elog "events."
269
270 elog "If you wish to use a non US layout, you may do so by executing:"
271 elog "setxkbmap <layout> or by utilizing your Desktop Environment's"
272 elog "Keyboard Layout Settings mechanism."
273 elog "Under GNOME, this is gnome-keyboard-properties, and under KDE"
274 elog "it is kxkb."
275 }

  ViewVC Help
Powered by ViewVC 1.1.20