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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Dec 23 21:04:59 2008 UTC (5 years, 8 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
remove old versions that are no longer supported
(Portage version: 2.1.6.1/cvs/Linux 2.6.27-gentoo-r7 x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20