/[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.28 - (hide annotations) (download)
Thu Jun 28 23:19:25 2007 UTC (7 years, 1 month ago) by vapier
Branch: MAIN
Changes since 1.27: +2 -2 lines
arm/sh love
(Portage version: 2.1.3_rc5)

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

  ViewVC Help
Powered by ViewVC 1.1.20