/[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.23 - (hide annotations) (download)
Tue Apr 17 16:26:30 2007 UTC (7 years, 4 months ago) by cardoe
Branch: MAIN
Changes since 1.22: +6 -4 lines
Clean up init script. Add HALD_VERBOSE to conf.d script. Add some proposed patches to fix volume label segfault as experienced on sparc. Removed old patches.
(Portage version: 2.1.2.4)

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

  ViewVC Help
Powered by ViewVC 1.1.20