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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (hide annotations) (download)
Mon Apr 14 18:36:31 2008 UTC (6 years, 6 months ago) by cardoe
Branch: MAIN
Changes since 1.20: +2 -3 lines
cryptsetup-luks -> cryptsetup
(Portage version: 2.1.5_rc3)

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

  ViewVC Help
Powered by ViewVC 1.1.20