hal/hal.inc : change hardcoded etc to ${sysconfdir} and remove bogus directory
[vuplus_openembedded] / recipes / hal / hal.inc
1 DESCRIPTION = "Hardware Abstraction Layer"
2 HOMEPAGE = "http://freedesktop.org/Software/hal"
3 SECTION = "unknown"
4 LICENSE = "GPL LGPL AFL"
5
6 SRC_URI = "http://hal.freedesktop.org/releases/hal-${PV}.tar.gz"
7
8 S = "${WORKDIR}/hal-${PV}"
9
10 inherit autotools pkgconfig
11
12 DEPENDS = "virtual/kernel dbus-glib udev intltool intltool-native expat libusb gperf-native"
13 RDEPENDS += "hal-info udev-utils"
14
15 SRC_URI += "file://99_hal \
16             file://20hal \
17            "
18
19 LEAD_SONAME = "libhal.so"
20
21 # machines with pci and acpi get a machine dependant hal
22 EXTRA_OECONF = "--with-hwdata=${datadir}/hwdata \
23                 --with-expat=${STAGING_LIBDIR}/.. \
24                 --with-dbus-sys=${sysconfdir}/dbus-1/system.d \
25                 --with-hotplug=${sysconfdir}/hotplug.d \
26                 --disable-docbook-docs \
27                 --disable-policy-kit \
28                 --disable-pmu \
29                 --disable-pnp-ids \
30                 ${@base_contains('COMBINED_FEATURES', 'pci', '--enable-pci --enable-pci-ids', '--disable-pci --disable-pci-ids',d)} \
31                 ${@base_contains('MACHINE_FEATURES', 'acpi', '--enable-acpi', '--disable-acpi',d)} \
32                "
33
34 MY_ARCH := "${PACKAGE_ARCH}"
35 PACKAGE_ARCH = "${@base_contains('MACHINE_FEATURES', 'acpi', '${MACHINE_ARCH}', '${MY_ARCH}',d)}"
36 PACKAGE_ARCH = "${@base_contains('MACHINE_FEATURES', 'pci', '${MACHINE_ARCH}', '${MY_ARCH}',d)}"
37
38 do_install_append() {
39         install -d ${D}/${sysconfdir}/default/volatiles
40         install -m 0644 ${WORKDIR}/99_hal ${D}/${sysconfdir}/default/volatiles
41         install -d ${D}/${sysconfdir}/dbus-1/event.d
42         install -m 0755 ${WORKDIR}/20hal ${D}/${sysconfdir}/dbus-1/event.d
43         rm -rf ${D}/${sysconfdir}/rc.d || true
44 }
45
46 do_stage() {
47         oe_libinstall -C libhal -a -so libhal ${STAGING_LIBDIR}
48         oe_libinstall -C libhal-storage -a -so libhal-storage ${STAGING_LIBDIR}
49
50         install -d ${STAGING_INCDIR}/hal
51         install -m 0644 libhal/libhal.h ${STAGING_INCDIR}/hal
52         install -m 0644 libhal-storage/libhal-storage.h ${STAGING_INCDIR}/hal
53 }
54
55 # At the time the postinst runs, dbus might not be setup so only restart if running
56 pkg_postinst_hal () {
57         # can't do this offline
58         if [ "x$D" != "x" ]; then
59                 exit 1
60         fi
61
62         grep haldaemon ${sysconfdir}/group || addgroup haldaemon
63         grep haldaemon ${sysconfdir}/passwd || adduser --disabled-password --system --home /var/run/hald --no-create-home haldaemon --ingroup haldaemon -g HAL
64
65         ${sysconfdir}/init.d/populate-volatile.sh update
66
67         DBUSPID=`pidof dbus-daemon`
68
69         if [ "x$DBUSPID" != "x" ]; then
70                 ${sysconfdir}/init.d/dbus-1 force-reload
71         fi
72 }
73
74 pkg_postrm_hal () {
75         deluser haldaemon || true
76         delgroup haldaemon || true
77 }
78
79 FILES_${PN} = "${sysconfdir} \
80                 ${bindir}/hal-disable-polling \
81                 ${bindir}/hal-setup-keymap \
82                 ${bindir}/lshal \
83                 ${bindir}/hal-find-by-capability \
84                 ${bindir}/hal-find-by-property \
85                 ${bindir}/hal-device  \
86                 ${bindir}/hal-get-property \
87                 ${bindir}/hal-set-property  \
88                 ${bindir}/hal-lock  \
89                 ${bindir}/hal-is-caller-locked-out  \
90                 ${sbindir} \
91                 ${libdir}/libhal.so.* \
92                 ${libdir}/libhal-storage.so.* \
93                 ${libdir}/hal \
94                 ${libexecdir} \
95                 ${datadir}/hal/fdi \
96                 ${datadir}/hal/scripts"