/[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.20 - (show annotations) (download)
Tue Dec 23 21:04:59 2008 UTC (5 years, 11 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +1 -1 lines
FILE REMOVED
remove old versions that are no longer supported
(Portage version: 2.1.6.1/cvs/Linux 2.6.27-gentoo-r7 x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20