/[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.15 - (hide annotations) (download)
Wed Apr 11 15:19:58 2007 UTC (7 years, 3 months ago) by cardoe
Branch: MAIN
Changes since 1.14: +2 -2 lines
cryptsetup-luks marked as Linux only
(Portage version: 2.1.2.3)

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

  ViewVC Help
Powered by ViewVC 1.1.20