/[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.9 - (hide annotations) (download)
Sat Apr 7 00:43:57 2007 UTC (7 years, 3 months ago) by cardoe
Branch: MAIN
Changes since 1.8: +2 -4 lines
man page changes for Gentoo. migrate plugdev policy patch to new patchset.
(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.9 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.9.ebuild,v 1.8 2007/04/06 19:13:01 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     >=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 steev 1.1 >=dev-libs/expat-1.95.8
24     >=sys-apps/pciutils-2.2.3
25     >=dev-libs/libusb-0.1.10a
26     virtual/eject
27     amd64? ( >=sys-apps/dmidecode-2.7 )
28     x86? ( >=sys-apps/dmidecode-2.7 )
29     ia64? ( >=sys-apps/dmidecode-2.7 )
30     dell? ( >=sys-libs/libsmbios-0.13.4 )
31     disk-partition? ( >=sys-apps/parted-1.7.1 )
32     crypt? ( >=sys-fs/cryptsetup-luks-1.0.1 )
33 cardoe 1.9 selinux? ( sys-libs/libselinux
34 cardoe 1.8 sec-policy/selinux-hal )
35 cardoe 1.4 pam? ( sys-auth/consolekit )"
36 steev 1.1
37     DEPEND="${RDEPEND}
38     dev-util/pkgconfig
39     >=dev-util/intltool-0.35
40     doc? ( app-doc/doxygen app-text/docbook-sgml-utils )"
41    
42     PDEPEND="app-misc/hal-info"
43    
44     ## HAL Daemon drops privledges so we need group access to read disks
45     HALDAEMON_GROUPS="haldaemon,plugdev,disk,cdrom,cdrw,floppy,usb"
46    
47     function notify_uevent() {
48     ewarn
49     ewarn "You must enable Kernel Userspace Events in your kernel."
50     ewarn "For this you need to enable 'Hotplug' under 'General Setup' and"
51     ewarn "basic networking. They are marked CONFIG_HOTPLUG and CONFIG_NET"
52     ewarn "in the config file."
53     ewarn
54     ebeep 5
55     }
56    
57     function notify_procfs() {
58     ewarn
59     ewarn "You must enable the proc filesystem in your kernel."
60     ewarn "For this you need to enable '/proc file system support' under"
61     ewarn "'Pseudo filesystems' in 'File systems'. It is marked"
62     ewarn "CONFIG_PROC_FS in the config file."
63     ewarn
64     ebeep 5
65     }
66    
67     pkg_setup() {
68     kernel_is ge 2 6 17 || ewarn "HAL requires a kernel version 2.6.17 or newer"
69    
70     if ! ( linux_chkconfig_present HOTPLUG && linux_chkconfig_present NET )
71     then
72     notify_uevent
73     fi
74    
75     if use acpi ; then
76     linux_chkconfig_present PROC_FS || notify_procfs
77     fi
78    
79     if [[ -d ${ROOT}/etc/hal/device.d ]]; then
80     eerror "HAL 0.5.x will not run with the HAL 0.4.x series of"
81     eerror "/etc/hal/device.d/ so please remove this directory"
82     eerror "with rm -rf /etc/hal/device.d/ and then re-emerge."
83     eerror "This is due to configuration protection of /etc/"
84     die "remove /etc/hal/device.d/"
85     fi
86     }
87    
88     src_unpack() {
89     unpack ${A}
90     cd ${S}
91 cardoe 1.2
92     # Gentoo Patch Set
93     EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch ${FILESDIR}/${PV}
94 steev 1.1 }
95    
96     src_compile() {
97 cardoe 1.4 local backend=""
98     local acpi=""
99    
100 steev 1.1 # TODO :: policykit should have a pam useflag
101     append-flags -rdynamic
102    
103 cardoe 1.4 if use kernel_linux ; then
104     backend="linux"
105     elif use kernel_FreeBSD ; then
106     backend="freebsd"
107     else
108     eerror "Invalid backend"
109     fi
110    
111     if use acpi ; then
112     acpi="--enable-acpi-toshiba --enable-acpi-ibm"
113     else
114     acpi="--disable-acpi-proc --disable-acpi-acpid"
115     fi
116    
117 steev 1.1 econf --disable-policy-kit \
118     --with-doc-dir=/usr/share/doc/${PF} \
119     --with-os-type=gentoo \
120     --with-pid-file=/var/run/hald.pid \
121     --with-hwdata=/usr/share/misc \
122     --enable-hotplug-map \
123 cardoe 1.4 --enable-man-pages \
124     --with-backend=${backend} \
125 steev 1.1 $(use_enable debug verbose-mode) \
126 cardoe 1.5 $(use_with dell dell-backlight) \
127 steev 1.1 $(use_enable disk-partition parted) \
128     $(use_enable pcmcia pcmcia-support) \
129     $(use_enable doc docbook-docs) \
130     $(use_enable doc doxygen-docs) \
131     $(use_enable selinux) \
132 cardoe 1.4 $(use_enable pam console-kit) \
133     ${acpi} \
134 steev 1.1 || die "configure failed"
135    
136     emake || die "make failed"
137     }
138    
139     src_install() {
140     make DESTDIR="${D}" install || die
141     dodoc AUTHORS ChangeLog NEWS README
142    
143     # remove dep on gnome-python
144     mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
145    
146     # hal umount for unclean unmounts
147     exeinto /lib/udev/
148     newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
149    
150     # initscript
151 cardoe 1.3 newinitd "${FILESDIR}"/0.5.9-hald.rc hald
152 steev 1.1
153     # We now create and keep /media here as both gnome-mount and pmount
154     # use these directories, to avoid collision.
155     keepdir /media
156 cardoe 1.3
157 steev 1.1 # We also need to create and keep /etc/fdi/{information,policy,preprobe}
158     # or else hal bombs.
159     keepdir /etc/hal/fdi/{information,policy,preprobe}
160 cardoe 1.3
161     # HAL stores it's fdi cache in /var/lib/cache/hald
162     keepdir /var/lib/cache/hald
163 steev 1.1 }
164    
165     pkg_postinst() {
166     # Despite what people keep changing this location. Either one works.. it doesn't matter
167     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
168    
169     # Create groups for hotplugging and HAL
170     enewgroup haldaemon || die "Problem adding haldaemon group"
171     enewgroup plugdev || die "Problem adding plugdev group"
172    
173     # HAL drops priviledges by default now ...
174     # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
175     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS} || die "Problem adding haldaemon user"
176    
177     # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
178     # If users have a problem with this, let them file a bug
179     usermod -G ${HALDAEMON_GROUPS} haldaemon
180    
181     elog "The HAL daemon needs to be running for certain applications to"
182     elog "work. Suggested is to add the init script to your start-up"
183     elog "scripts, this should be done like this :"
184     elog "\`rc-update add hald default\`"
185     echo
186     elog "Looking for automounting support? Add yourself to the plugdev group"
187     }

  ViewVC Help
Powered by ViewVC 1.1.20