wok-next view hal/receipt @ rev 11384
Compat: add binutils as a gmp BUILD_DEPENDS to ensure proper cookorder in tazwok
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sat Dec 10 04:32:17 2011 +0100 (2011-12-10) |
parents | 74b63eaf8099 |
children | 73641efed1cc |
line source
1 # SliTaz package receipt.
3 PACKAGE="hal"
4 VERSION="0.5.14"
5 CATEGORY="x-window"
6 SHORT_DESC="Hardware Abstraction Layer."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.freedesktop.org/wiki/Software/hal"
10 WGET_URL="http://hal.freedesktop.org/releases/$TARBALL"
11 CROSS="error: cannot check for file existence when cross compiling"
13 DEPENDS="dbus dbus-glib slitaz-base-files udev util-linux-ng-blkid libusb-compat"
14 BUILD_DEPENDS="dbus-dev dbus-glib dbus-glib-dev udev-dev pciutils \
15 util-linux-ng-blkid-dev expat-dev util-linux-ng-uuid-dev glib-dev pkg-config"
17 EXTRA="
18 hald-addon-cpufreq
19 hald-addon-hid-ups
20 hald-addon-imac-backlight
21 hald-addon-ipw-killswitch
22 hald-probe-video4linux
23 hald-probe-net-bluetooth
24 hald-probe-ieee1394-unit
25 hald-probe-pc-floppy
26 hald-probe-printer"
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 cd $src
32 zcat /usr/share/misc/pci.ids.gz > /usr/share/misc/pci.ids &&
33 patch -p1 < $stuff/hal-scripts.u || return 1 &&
34 #patch -p1 < $stuff/hal-udev.patch || return 1 &&
35 grep -qs 'define u8' hald/linux/probing/linux_dvd_rw_utils.c ||
36 sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' \
37 hald/linux/probing/linux_dvd_rw_utils.c
38 ./configure \
39 --prefix=/usr \
40 --libexecdir=/usr/lib/hal \
41 --sysconfdir=/etc \
42 --localstatedir=/var \
43 --disable-usb-ids \
44 --disable-policy-kit \
45 --build=$HOST_SYSTEM \
46 --host=$HOST_SYSTEM &&
47 make &&
48 rm /usr/share/misc/pci.ids &&
49 make install
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 mkdir -p $fs/usr/lib $fs/usr/share
56 cp -a $_pkg/etc $fs
57 cp -a $_pkg/var $fs
58 cp -a $_pkg/usr/bin $fs/usr
59 cp -a $_pkg/usr/sbin $fs/usr
60 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
61 cp -a $_pkg/usr/lib/hal $fs/usr/lib
62 cp -a $_pkg/usr/share/hal $fs/usr/share
63 chmod -R +x $fs/usr/lib/hal/scripts/*
64 # Remove a few run time lib and strip.
65 for lib in $EXTRA
66 do
67 rm $fs/usr/lib/hal/$lib
68 done
69 strip -s $fs/usr/lib/hal/* 2>/dev/null
70 # Init script
71 cp -a stuff/etc $fs
73 # Policy for ntfs-3g
74 cp -a stuff/policy $fs/usr/share/hal/fdi/
75 chown -R root.root $fs
77 # exclude unwanted fdi files
78 rm $fs/usr/share/hal/fdi/policy/10osvendor/10-cpufreq.fdi
79 rm $fs/usr/share/hal/fdi/policy/10osvendor/10-dockstation.fdi
80 rm $fs/usr/share/hal/fdi/policy/10osvendor/10-imac-backlight.fdi
81 rm $fs/usr/share/hal/fdi/policy/10osvendor/15-storage-luks.fdi
82 rm $fs/usr/share/hal/fdi/policy/10osvendor/30-wol.fdi
84 # change bash to sh in hal scripts
85 sed -i 's:/bin/bash:/bin/sh:' $fs/usr/lib/hal/scripts/hal*
86 sed -i 's:/bin/bash:/bin/sh:' $fs/usr/lib/hal/scripts/linux/hal*
87 # use full-path
88 sed -i 's:hal-functions:/usr/lib/hal/scripts/hal-functions:' $fs/usr/lib/hal/scripts/hal*
89 sed -i 's:hal-functions:/usr/lib/hal/scripts/hal-functions:' $fs/usr/lib/hal/scripts/linux/hal*
90 }
92 pre_install()
93 {
94 local root
95 root=$1
96 # Go for echoing on configuration files if any haldeamon user
97 # was found.
98 if ! grep -q 'haldaemon' $root/etc/passwd; then
99 echo -n "Adding user: messagebus..."
100 echo 'haldaemon:x:26:26:HAL Daemon User:/dev/null:/bin/false' >> $root/etc/passwd
101 echo 'haldaemon:!:14013:0:99999:7:::' >> $root/etc/shadow
102 echo 'haldaemon:x:26:' >> $root/etc/group
103 echo 'haldaemon:!::' >> $root/etc/gshadow
104 status
105 fi
106 if ! grep -q ^HALD_OPTIONS $root/etc/daemons.conf; then
107 echo -n "Configuring $root/etc/daemons.conf..."
108 cat >> $root/etc/daemons.conf << "EOT"
109 # HAL daemon options.
110 HALD_OPTIONS="--daemon=yes"
112 EOT
113 status
114 fi
115 }
117 pre_remove()
118 {
119 /etc/init.d/hald stop
120 deluser haldaemon
121 }