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

Contents of /sys-apps/hal/hal-0.5.9.1-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Wed Feb 20 02:49:13 2008 UTC (10 years, 8 months ago) by wolf31o2
Branch: MAIN
Changes since 1.8: +9 -8 lines
I hate blank spaces in output for no reason, so switching from using echo to using an extra \n at the end of the line.
(Portage version: 2.1.4.4)

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.9.1-r3.ebuild,v 1.8 2008/02/08 20:11:00 wolf31o2 Exp $
4
5 inherit eutils linux-info autotools flag-o-matic
6
7 DESCRIPTION="Hardware Abstraction Layer"
8 HOMEPAGE="http://www.freedesktop.org/Software/hal"
9 SRC_URI="http://people.freedesktop.org/~david/dist/${P}.tar.gz
10 http://dev.gentoo.org/~cardoe/files/hal/${P}-r2.tar.bz2"
11
12 LICENSE="|| ( GPL-2 AFL-2.0 )"
13 SLOT="0"
14 KEYWORDS="alpha amd64 arm hppa ia64 -mips ppc -ppc64 sh sparc x86 ~x86-fbsd"
15
16 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
17 IUSE="acpi crypt debug dell disk-partition doc pcmcia selinux ${KERNEL_IUSE}"
18
19 RDEPEND=">=dev-libs/glib-2.6
20 >=dev-libs/dbus-glib-0.61
21 kernel_linux? ( >=sys-fs/udev-104 )
22 kernel_linux? ( >=sys-apps/util-linux-2.12r-r1 )
23 kernel_linux? ( >=sys-kernel/linux-headers-2.6.17 )
24 kernel_FreeBSD? ( dev-libs/libvolume_id )
25 >=dev-libs/expat-1.95.8
26 >=sys-apps/pciutils-2.2.7-r1
27 >=dev-libs/libusb-0.1.10a
28 sys-apps/usbutils
29 virtual/eject
30 amd64? ( >=sys-apps/dmidecode-2.7 )
31 x86? ( >=sys-apps/dmidecode-2.7 )
32 ia64? ( >=sys-apps/dmidecode-2.7 )
33 dell? ( >=sys-libs/libsmbios-0.13.4 )
34 disk-partition? ( <=sys-apps/parted-1.8.7 )
35 kernel_linux? ( crypt? ( || ( >=sys-fs/cryptsetup-1.0.5
36 >=sys-fs/cryptsetup-luks-1.0.1 ) ) )
37 selinux? ( sys-libs/libselinux
38 sec-policy/selinux-hal )"
39 # pam? ( sys-auth/consolekit )"
40
41 DEPEND="${RDEPEND}
42 dev-util/pkgconfig
43 >=dev-util/intltool-0.35
44 doc? ( app-doc/doxygen
45 app-text/docbook-sgml-utils
46 app-text/xmlto )"
47
48 PDEPEND="app-misc/hal-info"
49
50 ## HAL Daemon drops privledges so we need group access to read disks
51 HALDAEMON_GROUPS_LINUX="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
52 HALDAEMON_GROUPS_FREEBSD="haldaemon,plugdev,operator"
53
54 function check_hotplug_net() {
55 local CONFIG_CHECK="~HOTPLUG ~NET"
56 local WARNING_HOTPLUG="CONFIG_HOTPLUG:\tis not set (required for HAL)
57 "
58 local WARNING_NET="CONFIG_NET:\tis not set (required for HAL)
59 "
60 check_extra_config
61 }
62
63 function check_inotify() {
64 local CONFIG_CHECK="~INOTIFY_USER"
65 local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)
66 "
67 check_extra_config
68 }
69
70 function check_procfs() {
71 local CONFIG_CHECK="~PROC_FS"
72 local WARNING_PROC_FS="CONFIG_PROC_FS:\tis not set (required for HAL)
73 "
74 check_extra_config
75 }
76
77 pkg_setup() {
78 if ! built_with_use --missing true sys-apps/pciutils hal ; then
79 if built_with_use --missing false sys-apps/pciutils zlib ; then
80 die "You MUST build sys-apps/pciutils without the zlib USE flag"
81 fi
82 fi
83
84 if use kernel_linux ; then
85 if [ -e ${ROOT}/usr/src/linux/.config ] ; then
86 kernel_is ge 2 6 17 || \
87 ewarn "HAL requires a kernel version 2.6.17 or newer"
88 fi
89
90 check_hotplug_net
91 check_inotify
92 use acpi && check_procfs
93 fi
94
95 if [[ -d ${ROOT}/etc/hal/device.d ]]; then
96 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
97 eerror "/etc/hal/device.d/ so please remove this directory"
98 eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
99 eerror "This is due to configuration protection of /etc/"
100 die "remove /etc/hal/device.d/"
101 fi
102 }
103
104 src_unpack() {
105 unpack ${A}
106 cd "${S}"
107
108 EPATCH_SUFFIX="patch" \
109 EPATCH_FORCE="yes" \
110 epatch "${WORKDIR}"/hal-patches
111
112 eautoreconf
113 }
114
115 src_compile() {
116 local backend=""
117 local acpi=""
118
119 # TODO :: policykit should have a pam useflag
120 append-flags -rdynamic
121
122 if use kernel_linux ; then
123 backend="linux"
124 use acpi && acpi="--enable-acpi-toshiba --enable-acpi-ibm"
125 elif use kernel_FreeBSD ; then
126 backend="freebsd"
127 else
128 eerror "Invalid backend"
129 fi
130
131 if ! use acpi ; then
132 acpi="--disable-acpi-proc --disable-acpi-acpid"
133 fi
134
135 econf --disable-policy-kit \
136 --docdir=/usr/share/doc/${PF} \
137 --with-os-type=gentoo \
138 --with-pid-file=/var/run/hald.pid \
139 --with-socket-dir=/var/run/hald \
140 --with-hwdata=/usr/share/misc \
141 --enable-hotplug-map \
142 --enable-man-pages \
143 --with-backend=${backend} \
144 $(use_enable debug verbose-mode) \
145 $(use_with dell dell-backlight) \
146 $(use_enable disk-partition parted) \
147 $(use_enable pcmcia pcmcia-support) \
148 $(use_enable doc docbook-docs) \
149 $(use_enable doc doxygen-docs) \
150 $(use_enable selinux) \
151 --disable-console-kit \
152 ${acpi} \
153 || die "configure failed"
154 #$(use_enable pam console-kit)
155
156 emake || die "make failed"
157 }
158
159 src_install() {
160 make DESTDIR="${D}" install || die
161 dodoc AUTHORS ChangeLog NEWS README
162
163 # remove dep on gnome-python
164 mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
165
166 # hal umount for unclean unmounts
167 exeinto /lib/udev/
168 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
169
170 # initscript
171 newinitd "${FILESDIR}"/0.5.9-hald.rc hald
172 cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/
173 # if use pam; then
174 # sed -e 's:RC_NEED="":RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf
175 # fi
176 if use debug; then
177 sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
178 -i "${WORKDIR}"/0.5.9-hald.conf
179 fi
180 newconfd "${WORKDIR}"/0.5.9-hald.conf hald
181
182 # We now create and keep /media here as both gnome-mount and pmount
183 # use these directories, to avoid collision.
184 keepdir /media
185
186 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
187 # or else hal bombs.
188 keepdir /etc/hal/fdi/{information,policy,preprobe}
189
190 # HAL stores it's fdi cache in /var/lib/cache/hald
191 keepdir /var/lib/cache/hald
192
193 # HAL keeps its unix socket here
194 keepdir /var/run/hald
195 }
196
197 pkg_postinst() {
198 # Despite what people keep changing this location. Either one works.. it doesn't matter
199 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
200
201 # Create groups for hotplugging and HAL
202 enewgroup haldaemon || die "Problem adding haldaemon group"
203 enewgroup plugdev || die "Problem adding plugdev group"
204
205 # HAL drops priviledges by default now ...
206 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
207 if use kernel_linux; then
208 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
209 || die "Problem adding haldaemon user"
210 elif use kernel_FreeBSD; then
211 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
212 || die "Problem addding haldaemon user"
213 fi
214
215 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
216 # If users have a problem with this, let them file a bug
217 if [[ ${ROOT} == / ]] ; then
218 if use kernel_linux; then
219 usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
220 elif use kernel_FreeBSD; then
221 pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
222 fi
223 fi
224
225 elog "The HAL daemon needs to be running for certain applications to"
226 elog "work. Suggested is to add the init script to your start-up"
227 elog "scripts, this should be done like this :"
228 elog "\`rc-update add hald default\`"
229 echo
230 elog "Looking for automounting support? Add yourself to the plugdev group"
231 }

  ViewVC Help
Powered by ViewVC 1.1.20