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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download)
Wed Feb 20 02:49:13 2008 UTC (6 years, 9 months ago) by wolf31o2
Branch: MAIN
Changes since 1.11: +9 -8 lines
I hate blank spaces in output for no reason, so switching from using echo to using an extra \n at the end of the line.
(Portage version: 2.1.4.4)

1 wolf31o2 1.11 # Copyright 1999-2008 Gentoo Foundation
2 gustavoz 1.1 # Distributed under the terms of the GNU General Public License v2
3 wolf31o2 1.12 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.9.1-r1.ebuild,v 1.11 2008/02/08 20:11:00 wolf31o2 Exp $
4 gustavoz 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 jer 1.8 KEYWORDS="alpha ~amd64 ~arm hppa ~ia64 -mips ~ppc -ppc64 ~sh sparc ~x86 ~x86-fbsd"
14 gustavoz 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     sys-apps/usbutils
28     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.9 disk-partition? ( <=sys-apps/parted-1.8.7 )
34 strerror 1.7 kernel_linux? ( crypt? ( || ( >=sys-fs/cryptsetup-1.0.5
35     >=sys-fs/cryptsetup-luks-1.0.1 ) ) )
36 gustavoz 1.1 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 wolf31o2 1.11 function check_hotplug_net() {
54     local CONFIG_CHECK="~HOTPLUG ~NET"
55 wolf31o2 1.12 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 wolf31o2 1.11 check_extra_config
60     }
61    
62     function check_inotify() {
63     local CONFIG_CHECK="~INOTIFY_USER"
64 wolf31o2 1.12 local WARNING_INOTIFY_USER="CONFIG_INOTIFY_USER:\tis not set (required for HAL)
65     "
66 wolf31o2 1.11 check_extra_config
67     }
68    
69     function check_procfs() {
70     local CONFIG_CHECK="~PROC_FS"
71 wolf31o2 1.12 local WARNING_PROC_FS="CONFIG_PROC_FS:\tis not set (required for HAL)
72     "
73 wolf31o2 1.11 check_extra_config
74 gustavoz 1.1 }
75    
76     pkg_setup() {
77 wolf31o2 1.11 if ! built_with_use --missing true sys-apps/pciutils hal ; then
78 vapier 1.4 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 gustavoz 1.1 fi
82    
83 wolf31o2 1.11 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 gustavoz 1.1 fi
88    
89 wolf31o2 1.11 check_hotplug_net
90     check_inotify
91     use acpi && check_procfs
92 gustavoz 1.1 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 compnerd 1.10 cd "${S}"
106 gustavoz 1.1
107     # Gentoo patchset
108 compnerd 1.10 epatch "${FILESDIR}/0.5.9/07_malloc_h_for_stdlib_h.patch"
109     epatch "${FILESDIR}/0.5.9/23_runner_64bit_values.patch"
110     epatch "${FILESDIR}/0.5.9/24_libparted_1_8_7.patch"
111 gustavoz 1.1 #epatch ${FILESDIR}/0.5.9/95_gentoo_man_page.patch
112 compnerd 1.10 epatch "${FILESDIR}/0.5.9/96_plugdev_allow_send.patch"
113     epatch "${FILESDIR}/0.5.9/97_ignore_fixed_drives.patch"
114     epatch "${FILESDIR}/0.5.9/98_hald_cache_test_path.patch"
115     epatch "${FILESDIR}/0.5.9/99_sun_disklabel_ignore.patch"
116 gustavoz 1.1
117     eautoreconf
118     }
119    
120     src_compile() {
121     local backend=""
122     local acpi=""
123    
124     # TODO :: policykit should have a pam useflag
125     append-flags -rdynamic
126    
127     if use kernel_linux ; then
128     backend="linux"
129     use acpi && acpi="--enable-acpi-toshiba --enable-acpi-ibm"
130     elif use kernel_FreeBSD ; then
131     backend="freebsd"
132     else
133     eerror "Invalid backend"
134     fi
135    
136     if ! use acpi ; then
137     acpi="--disable-acpi-proc --disable-acpi-acpid"
138     fi
139    
140     econf --disable-policy-kit \
141     --docdir=/usr/share/doc/${PF} \
142     --with-os-type=gentoo \
143     --with-pid-file=/var/run/hald.pid \
144     --with-socket-dir=/var/run/hald \
145     --with-hwdata=/usr/share/misc \
146     --enable-hotplug-map \
147     --enable-man-pages \
148     --with-backend=${backend} \
149     $(use_enable debug verbose-mode) \
150     $(use_with dell dell-backlight) \
151     $(use_enable disk-partition parted) \
152     $(use_enable pcmcia pcmcia-support) \
153     $(use_enable doc docbook-docs) \
154     $(use_enable doc doxygen-docs) \
155     $(use_enable selinux) \
156     --disable-console-kit \
157     ${acpi} \
158     || die "configure failed"
159     #$(use_enable pam console-kit)
160    
161     emake || die "make failed"
162     }
163    
164     src_install() {
165     make DESTDIR="${D}" install || die
166     dodoc AUTHORS ChangeLog NEWS README
167    
168     # remove dep on gnome-python
169     mv "${D}"/usr/bin/hal-device-manager "${D}"/usr/share/hal/device-manager/
170    
171     # hal umount for unclean unmounts
172     exeinto /lib/udev/
173     newexe "${FILESDIR}"/hal-unmount.dev hal_unmount
174    
175     # initscript
176     newinitd "${FILESDIR}"/0.5.9-hald.rc hald
177     cp "${FILESDIR}"/0.5.9-hald.conf "${WORKDIR}"/
178     # if use pam; then
179     # sed -e 's:RC_NEED="":RC_NEED="consolekit":' -i "${WORKDIR}"/0.5.9-hald.conf
180     # fi
181     if use debug; then
182     sed -e 's:HALD_VERBOSE="no":HALD_VERBOSE="yes":' \
183     -i "${WORKDIR}"/0.5.9-hald.conf
184     fi
185     newconfd "${WORKDIR}"/0.5.9-hald.conf hald
186    
187     # We now create and keep /media here as both gnome-mount and pmount
188     # use these directories, to avoid collision.
189     keepdir /media
190    
191     # We also need to create and keep /etc/fdi/{information,policy,preprobe}
192     # or else hal bombs.
193     keepdir /etc/hal/fdi/{information,policy,preprobe}
194    
195     # HAL stores it's fdi cache in /var/lib/cache/hald
196     keepdir /var/lib/cache/hald
197    
198     # HAL keeps its unix socket here
199     keepdir /var/run/hald
200     }
201    
202     pkg_postinst() {
203     # Despite what people keep changing this location. Either one works.. it doesn't matter
204     # http://dev.gentoo.org/~plasmaroo/devmanual/ebuild-writing/functions/
205    
206     # Create groups for hotplugging and HAL
207     enewgroup haldaemon || die "Problem adding haldaemon group"
208     enewgroup plugdev || die "Problem adding plugdev group"
209    
210     # HAL drops priviledges by default now ...
211     # ... so we must make sure it can read disk/cdrom info (ie. be in ${HALDAEMON_GROUPS} groups)
212     if use kernel_linux; then
213     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_LINUX} \
214     || die "Problem adding haldaemon user"
215     elif use kernel_FreeBSD; then
216     enewuser haldaemon -1 "-1" /dev/null ${HALDAEMON_GROUPS_FREEBSD} \
217     || die "Problem addding haldaemon user"
218     fi
219    
220     # Make sure that the haldaemon user is in the ${HALDAEMON_GROUPS}
221     # If users have a problem with this, let them file a bug
222     if [[ ${ROOT} == / ]] ; then
223     if use kernel_linux; then
224     usermod -G ${HALDAEMON_GROUPS_LINUX} haldaemon
225     elif use kernel_FreeBSD; then
226     pw usermod haldaemon -G ${HALDAEMON_GROUPS_FREEBSD}
227     fi
228     fi
229    
230     elog "The HAL daemon needs to be running for certain applications to"
231     elog "work. Suggested is to add the init script to your start-up"
232     elog "scripts, this should be done like this :"
233     elog "\`rc-update add hald default\`"
234     echo
235     elog "Looking for automounting support? Add yourself to the plugdev group"
236     }

  ViewVC Help
Powered by ViewVC 1.1.20