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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Apr 6 01:24:09 2007 UTC (7 years, 8 months ago) by cardoe
Branch: MAIN
Changes since 1.5: +4 -2 lines
Adding kernel_linux and kernel_FreeBSD to IUSE
(Portage version: 2.1.2.3)

1 # Copyright 1999-2007 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.ebuild,v 1.5 2007/04/05 22:00:22 cardoe 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
11 LICENSE="|| ( GPL-2 AFL-2.0 )"
12 SLOT="0"
13 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 -mips ~ppc ~ppc64 ~sh ~sparc ~x86"
14
15 KERNEL_IUSE="kernel_linux kernel_FreeBSD"
16 IUSE="acpi crypt debug dell disk-partition doc pam pcmcia selinux ${KERNEL_IUSE}"
17
18 RDEPEND=">=dev-libs/glib-2.6
19 >=dev-libs/dbus-glib-0.61
20 >=sys-fs/udev-104
21 >=sys-apps/util-linux-2.12r-r1
22 kernel_linux? ( >=sys-kernel/linux-headers-2.6.17 )
23 >=dev-libs/expat-1.95.8
24 >=sys-apps/pciutils-2.2.3
25 >=dev-libs/libusb-0.1.10a
26 virtual/eject
27 amd64? ( >=sys-apps/dmidecode-2.7 )
28 x86? ( >=sys-apps/dmidecode-2.7 )
29 ia64? ( >=sys-apps/dmidecode-2.7 )
30 dell? ( >=sys-libs/libsmbios-0.13.4 )
31 disk-partition? ( >=sys-apps/parted-1.7.1 )
32 crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 )
33 selinux? ( sys-libs/libselinux )
34 pam? ( sys-auth/consolekit )"
35
36 DEPEND="${RDEPEND}
37 dev-util/pkgconfig
38 >=dev-util/intltool-0.35
39 doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
40
41 PDEPEND="app-misc/hal-info"
42
43 ## HAL Daemon drops privledges so we need group access to read disks
44 HALDAEMON_GROUPS="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
45
46 function notify_uevent() {
47 ewarn
48 ewarn "You must enable Kernel Userspace Events in your kernel."
49 ewarn "For this you need to enable 'Hotplug' under 'General Setup' and"
50 ewarn "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
51 ewarn "in the config file."
52 ewarn
53 ebeep 5
54 }
55
56 function notify_procfs() {
57 ewarn
58 ewarn "You must enable the proc filesystem in your kernel."
59 ewarn "For this you need to enable '/proc file system support' under"
60 ewarn "'Pseudo filesystems' in 'File systems'. It is marked"
61 ewarn "CONFIG_PROC_FS in the config file."
62 ewarn
63 ebeep 5
64 }
65
66 pkg_setup() {
67 kernel_is ge 2 6 17 || ewarn "HAL requires a kernel version 2.6.17 or newer"
68
69 if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET )
70 then
71 notify_uevent
72 fi
73
74 if use acpi ; then
75 linux_chkconfig_present PROC_FS || notify_procfs
76 fi
77
78 if [[ -d ${ROOT}/etc/hal/device.d ]]; then
79 eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
80 eerror "/etc/hal/device.d/ so please remove this directory"
81 eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
82 eerror "This is due to configuration protection of /etc/"
83 die "remove /etc/hal/device.d/"
84 fi
85 }
86
87 src_unpack() {
88 unpack ${A}
89 cd ${S}
90
91 # Gentoo Patch Set
92 EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch ${FILESDIR}/${PV}
93
94 epatch ${FILESDIR}/${PN}-0.5.7-plugdev-allow-send.patch
95 }
96
97 src_compile() {
98 local backend=""
99 local acpi=""
100
101 # TODO :: policykit should have a pam useflag
102 append-flags -rdynamic
103
104 if use kernel_linux ; then
105 backend="linux"
106 elif use kernel_FreeBSD ; then
107 backend="freebsd"
108 else
109 eerror "Invalid backend"
110 fi
111
112 if use acpi ; then
113 acpi="--enable-acpi-toshiba --enable-acpi-ibm"
114 else
115 acpi="--disable-acpi-proc --disable-acpi-acpid"
116 fi
117
118 econf --disable-policy-kit \
119 --with-doc-dir=/usr/share/doc/${PF} \
120 --with-os-type=gentoo \
121 --with-pid-file=/var/run/hald.pid \
122 --with-hwdata=/usr/share/misc \
123 --enable-hotplug-map \
124 --enable-man-pages \
125 --with-backend=${backend} \
126 $(use_enable debug verbose-mode) \
127 $(use_with dell dell-backlight) \
128 $(use_enable disk-partition parted) \
129 $(use_enable pcmcia pcmcia-support) \
130 $(use_enable doc docbook-docs) \
131 $(use_enable doc doxygen-docs) \
132 $(use_enable selinux) \
133 $(use_enable pam console-kit) \
134 ${acpi} \
135 || die "configure failed"
136
137 emake || die "make failed"
138 }
139
140 src_install() {
141 make DESTDIR="${D}" install || die
142 dodoc AUTHORS ChangeLog NEWS README
143
144 # remove dep on gnome-python
145 mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
146
147 # hal umount for unclean unmounts
148 exeinto /lib/udev/
149 newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
150
151 # initscript
152 newinitd "${FILESDIR}"/0.5.9-hald.rc hald
153
154 # We now create and keep /media here as both gnome-mount and pmount
155 # use these directories, to avoid collision.
156 keepdir /media
157
158 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
159 # or else hal bombs.
160 keepdir /etc/hal/fdi/{information,policy,preprobe}
161
162 # HAL stores it's fdi cache in /var/lib/cache/hald
163 keepdir /var/lib/cache/hald
164 }
165
166 pkg_postinst() {
167 # Despite what people keep changing this location. Either one works.. it doesn't matter
168 # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
169
170 # Create groups for hotplugging and HAL
171 enewgroup haldaemon || die "Problem adding haldaemon group"
172 enewgroup plugdev || die "Problem adding plugdev group"
173
174 # HAL drops priviledges by default now ...
175 # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
176 enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
177
178 # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
179 # If users have a problem with this, let them file a bug
180 usermod -G ${HALDAEMON_GROUPS} haldaemon
181
182 elog "The HAL daemon needs to be running for certain applications to"
183 elog "work. Suggested is to add the init script to your start-up"
184 elog "scripts, this should be done like this :"
185 elog "\`rc-update add hald default\`"
186 echo
187 elog "Looking for automounting support? Add yourself to the plugdev group"
188 }

  ViewVC Help
Powered by ViewVC 1.1.20