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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Sep 4 15:50:36 2006 UTC (7 years, 10 months ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Fixing HAL initscript. Removing oldness and some cleaning.
(Portage version: 2.1.1_rc1-r2)
 (Signed Manifest commit)

1 compnerd 1.1 # Copyright 1999-2006 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 cardoe 1.3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.7-r2.ebuild,v 1.2 2006/05/28 06:55:08 cardoe Exp $
4 compnerd 1.1
5     inherit eutils linux-info debug
6    
7     DESCRIPTION="Hardware Abstraction Layer"
8     HOMEPAGE="http://www.freedesktop.org/Software/hal"
9     SRC_URI="http://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 ~ppc ~ppc64 ~sparc ~x86"
14     IUSE="acpi crypt debug doc dmi pcmcia selinux"
15    
16     RDEPEND=">=dev-libs/glib-2.6
17     >=sys-apps/dbus-0.60
18     >=sys-fs/udev-078
19     >=sys-apps/util-linux-2.12r
20     || ( >=sys-kernel/linux-headers-2.6 >=sys-kernel/mips-headers-2.6 )
21     dev-libs/expat
22     sys-libs/libcap
23     sys-apps/pciutils
24     dev-libs/libusb
25     sys-apps/hotplug
26     dmi? ( >=sys-apps/dmidecode-2.7 )
27     crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 )
28     selinux? ( sys-libs/libselinux )"
29    
30     DEPEND="${RDEPEND}
31     dev-util/pkgconfig
32     >=dev-util/intltool-0.29
33     doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
34    
35     ## HAL Daemon drops privledges so we need group access to read disks
36     HALDAEMON_GROUPS="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
37    
38     function notify_uevent() {
39     eerror
40     eerror "You must enable Kernel Userspace Events in your kernel."
41     eerror "This can be set under 'General Setup'. It is marked as"
42     eerror "CONFIG_KOBJECT_UEVENT in the config file."
43     eerror
44     ebeep 5
45     }
46    
47     function notify_uevent_2_6_16() {
48     eerror
49     eerror "You must enable Kernel Userspace Events in your kernel."
50     eerror "For this you need to enable 'Hotplug' under 'General Setup' and"
51     eerror "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
52     eerror "in the config file."
53     eerror
54     ebeep 5
55     }
56    
57     function notify_procfs() {
58     eerror
59     eerror "You must enable the proc filesystem in your kernel."
60     eerror "For this you need to enable '/proc file system support' under"
61     eerror "'Pseudo filesystems' in 'File systems'. It is marked"
62     eerror "CONFIG_PROC_FS in the config file."
63     eerror
64     ebeep 5
65     }
66    
67     pkg_setup() {
68     linux-info_pkg_setup
69    
70     kernel_is ge 2 6 15 || die "HAL requires a kernel version 2.6.15 or newer"
71    
72     if kernel_is lt 2 6 16 ; then
73     linux_chkconfig_present KOBJECT_UEVENT || notify_uevent
74     else
75     (linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET) \
76     || notify_uevent_2_6_16
77     fi
78    
79     if use acpi ; then
80     linux_chkconfig_present PROC_FS || notify_procfs
81     fi
82    
83     if [ -d ${ROOT}/etc/hal/device.d ]; then
84     eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
85     eerror "/etc/hal/device.d/ so please remove this directory"
86     eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
87     eerror "This is due to configuration protection of /etc/"
88     die "remove /etc/hal/device.d/"
89     fi
90     }
91    
92     src_unpack() {
93     unpack ${A}
94     cd "${S}"
95    
96     # sony screen brightness patch
97     # epatch "${FILESDIR}"/${PN}-0.5.7-sony-brightness.patch
98    
99     # handle ignored volumes properly
100     epatch "${FILESDIR}"/${PN}-0.5.7-ignored-volumes.patch
101    
102     # Fix bash in hald scripts
103     epatch "${FILESDIR}"/${PN}-0.5.7-hald-scripts.patch
104    
105     # probe partition table
106     epatch "${FILESDIR}"/${PN}-0.5.7-part-table.patch
107    
108     # fix pmu support crash
109     epatch "${FILESDIR}"/${PN}-0.5.7-pmu-fix.patch
110    
111     # unclean unmount
112     epatch "${FILESDIR}"/${PN}-0.5.7-unclean-unmount-r1.patch
113    
114     # allow plugdev group people to mount
115     epatch "${FILESDIR}"/${PN}-0.5.7-plugdev-allow-send.patch
116    
117     # rescan devices on resume
118     epatch "${FILESDIR}"/${PN}-0.5.7-rescan-on-resume.patch
119     }
120    
121     src_compile() {
122     econf \
123     --with-doc-dir=/usr/share/doc/${PF} \
124     --with-os-type=gentoo \
125     --with-pid-file=/var/run/hald.pid \
126     --enable-hotplug-map \
127     $(use_enable debug verbose-mode) \
128     $(use_enable pcmcia pcmcia-support) \
129     $(use_enable acpi acpi-proc) \
130     $(use_enable doc docbook-docs) \
131     $(use_enable doc doxygen-docs) \
132     $(use_enable selinux) \
133     || die "configure failed"
134    
135     emake || die "make failed"
136     }
137    
138     src_install() {
139     make DESTDIR="${D}" install || die
140     dodoc AUTHORS ChangeLog NEWS README
141    
142     # remove dep on gnome-python
143     mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
144    
145     # hal umount for unclean unmounts
146     exeinto /lib/udev/
147     newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
148    
149     # initscript
150     newinitd "${FILESDIR}"/0.5-hald.rc hald
151    
152     # Script to unmount devices if they are yanked out (from upstream)
153     exeinto /etc/dev.d/default
154     doexe "${FILESDIR}"/hal-unmount.dev
155    
156     # We now create and keep /media here as both gnome-mount and pmount
157     # use these directories, to avoid collision.
158     dodir /media
159     keepdir /media
160     }
161    
162     pkg_postinst() {
163     # Despite what people keep changing this location. Either one works.. it doesn't matter
164     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
165    
166     # Create groups for hotplugging and HAL
167     enewgroup haldaemon || die "Problem adding haldaemon group"
168     enewgroup plugdev || die "Problem adding plugdev group"
169    
170     # HAL drops priviledges by default now ...
171     # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
172     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
173    
174     # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
175     # If users have a problem with this, let them file a bug
176     usermod -G ${HALDAEMON_GROUPS} haldaemon
177    
178     einfo "The HAL daemon needs to be running for certain applications to"
179     einfo "work. Suggested is to add the init script to your start-up"
180     einfo "scripts, this should be done like this :"
181     einfo "\`rc-update add hald default\`"
182 cardoe 1.2 echo
183     einfo "Looking for automounting support? Add yourself to the plugdev group"
184 compnerd 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20