/[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.14 - (hide annotations) (download)
Mon Apr 14 18:36:31 2008 UTC (6 years, 3 months ago) by cardoe
Branch: MAIN
Changes since 1.13: +2 -7 lines
cryptsetup-luks -> cryptsetup
(Portage version: 2.1.5_rc3)

1 compnerd 1.5 # Copyright 1999-2008 Gentoo Foundation
2 compnerd 1.1 # Distributed under the terms of the GNU General Public License v2
3 cardoe 1.14 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.10.ebuild,v 1.13 2008/04/09 17:23:18 armin76 Exp $
4 compnerd 1.1
5     inherit eutils linux-info autotools flag-o-matic
6    
7 compnerd 1.5 PATCH_VER="0"
8 compnerd 1.3
9 compnerd 1.1 DESCRIPTION="Hardware Abstraction Layer"
10     HOMEPAGE="http://www.freedesktop.org/Software/hal"
11 compnerd 1.3 SRC_URI="http://hal.freedesktop.org/releases/${P}.tar.gz
12 compnerd 1.5 http://dev.gentoo.org/~compnerd/files/${PN}/${P}-gentoo-patches-${PATCH_VER}.tar.bz2"
13 compnerd 1.1
14     LICENSE="|| ( GPL-2 AFL-2.0 )"
15     SLOT="0"
16 armin76 1.13 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~sparc ~x86"
17 compnerd 1.1
18     KERNEL_IUSE="kernel_linux kernel_FreeBSD"
19 compnerd 1.6 IUSE="acpi apm crypt debug dell disk-partition doc laptop selinux ${KERNEL_IUSE}"
20 compnerd 1.1
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 cardoe 1.14 crypt? ( >=sys-fs/cryptsetup-1.0.5 )
44 compnerd 1.1 )
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 compnerd 1.6 laptop? ( >=sys-power/pm-utils-0.99.3 )"
59 compnerd 1.1
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 wolf31o2 1.9 function check_hotplug_net() {
65     local CONFIG_CHECK="~HOTPLUG ~NET"
66 wolf31o2 1.10 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 wolf31o2 1.9 check_extra_config
70 compnerd 1.1 }
71    
72 wolf31o2 1.9 function check_inotify() {
73     local CONFIG_CHECK="~INOTIFY_USER"
74 wolf31o2 1.10 local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)\n"
75 wolf31o2 1.9 check_extra_config
76 compnerd 1.1 }
77    
78 wolf31o2 1.9 function check_acpi_proc() {
79     local CONFIG_CHECK="~ACPI_PROCFS ~ACPI_PROC_EVENT"
80 wolf31o2 1.10 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 wolf31o2 1.9 check_extra_config
83 compnerd 1.1 }
84    
85     pkg_setup() {
86 wolf31o2 1.9 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 compnerd 1.1 fi
94    
95 wolf31o2 1.9 check_hotplug_net
96     check_inotify
97 compnerd 1.1 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 compnerd 1.5 EPATCH_MULTI_MSG="Applying Gentoo Patchset ..." \
132 compnerd 1.3 EPATCH_SUFFIX="patch" \
133     EPATCH_SOURCE="${WORKDIR}/hal-0.5.10-patches/" \
134     EPATCH_FORCE="yes" \
135 mr_bones_ 1.4 epatch
136 compnerd 1.3
137 compnerd 1.1 # Hide recovery partitions
138     epatch "${FILESDIR}/hal-0.5.9-hide-recovery-partitions.patch"
139    
140     # Enable plugdev support
141 compnerd 1.3 epatch "${FILESDIR}/96_plugdev_allow_send.patch"
142 compnerd 1.5
143     eautoreconf
144 compnerd 1.1 }
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 compnerd 1.5 --disable-policy-kit \
200     --disable-console-kit \
201     --disable-acl-management \
202 compnerd 1.1 --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 compnerd 1.7
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 compnerd 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20