wok-current view hal/receipt @ rev 25728
Merge wok for both arch and few updates
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Thu Dec 05 08:39:45 2024 +0000 (5 weeks ago) |
parents | 3ad63c8fc2f9 |
children |
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 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="https://www.freedesktop.org/wiki/Software/hal"
11 WGET_URL="https://hal.freedesktop.org/releases/$TARBALL"
12 CROSS="error: cannot check for file existence when cross compiling"
14 DEPENDS="dbus dbus-glib slitaz-base-files udev util-linux-blkid libusb-compat"
15 BUILD_DEPENDS="dbus-dev dbus-glib dbus-glib-dev udev-dev pciutils \
16 util-linux-blkid-dev expat-dev util-linux-uuid-dev glib-dev pkg-config \
17 libv4l-dev"
19 EXTRA="
20 hald-addon-cpufreq
21 hald-addon-hid-ups
22 hald-addon-imac-backlight
23 hald-addon-ipw-killswitch
24 hald-probe-video4linux
25 hald-probe-net-bluetooth
26 hald-probe-ieee1394-unit
27 hald-probe-pc-floppy
28 hald-probe-printer"
30 HOST_ARCH="i486 x86_64"
32 # What is the latest version available today?
33 current_version()
34 {
35 wget -O - ${WGET_URL%/*} 2>/dev/null | \
36 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
37 }
39 # Rules to configure and make the package.
40 compile_rules()
41 {
42 cd $src
43 sed -i 's|linux/videodev.h|libv4l1-videodev.h|' \
44 hald/linux/probing/probe-video4linux.c
45 sed -i 's|glib/gmain|glib|' hald/linux/addons/addon-*.c
46 zcat /usr/share/misc/pci.ids.gz > /usr/share/misc/pci.ids &&
47 patch -p1 < $stuff/hal-scripts.u || return 1 &&
48 #patch -p1 < $stuff/hal-udev.patch || return 1 &&
49 grep -qs 'define u8' hald/linux/probing/linux_dvd_rw_utils.c ||
50 sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' \
51 hald/linux/probing/linux_dvd_rw_utils.c
52 # Patch to be build with glibc 2.28
53 patch -p1 < $stuff/glibc-2.28-build.patch
54 ./configure \
55 --prefix=/usr \
56 --libexecdir=/usr/lib/hal \
57 --sysconfdir=/etc \
58 --localstatedir=/var \
59 --disable-usb-ids \
60 --disable-policy-kit \
61 --build=$HOST_SYSTEM \
62 --host=$HOST_SYSTEM &&
63 make &&
64 rm /usr/share/misc/pci.ids &&
65 make install
66 }
68 # Rules to gen a SliTaz package suitable for Tazpkg.
69 genpkg_rules()
70 {
71 mkdir -p $fs/usr/lib $fs/usr/share
72 cp -a $install/etc $fs
73 cp -a $install/var $fs
74 cp -a $install/usr/bin $fs/usr
75 cp -a $install/usr/sbin $fs/usr
76 cp -a $install/usr/lib/*.so* $fs/usr/lib
77 cp -a $install/usr/lib/hal $fs/usr/lib
78 cp -a $install/usr/share/hal $fs/usr/share
79 chmod -R +x $fs/usr/lib/hal/scripts/*
80 # Remove a few run time lib and strip.
81 for lib in $EXTRA
82 do
83 rm $fs/usr/lib/hal/$lib
84 done
85 strip -s $fs/usr/lib/hal/* 2>/dev/null
86 # Init script
87 cp -a stuff/etc $fs
89 # Policy for ntfs-3g
90 cp -a stuff/policy $fs/usr/share/hal/fdi/
91 chown -R root.root $fs
93 # exclude unwanted fdi files
94 rm $fs/usr/share/hal/fdi/policy/10osvendor/10-cpufreq.fdi
95 rm $fs/usr/share/hal/fdi/policy/10osvendor/10-dockstation.fdi
96 rm $fs/usr/share/hal/fdi/policy/10osvendor/10-imac-backlight.fdi
97 rm $fs/usr/share/hal/fdi/policy/10osvendor/15-storage-luks.fdi
98 rm $fs/usr/share/hal/fdi/policy/10osvendor/30-wol.fdi
100 # change bash to sh in hal scripts
101 sed -i 's:/bin/bash:/bin/sh:' $fs/usr/lib/hal/scripts/hal*
102 sed -i 's:/bin/bash:/bin/sh:' $fs/usr/lib/hal/scripts/linux/hal*
103 # use full-path
104 sed -i 's:hal-functions:/usr/lib/hal/scripts/hal-functions:' $fs/usr/lib/hal/scripts/hal*
105 sed -i 's:hal-functions:/usr/lib/hal/scripts/hal-functions:' $fs/usr/lib/hal/scripts/linux/hal*
106 }
108 pre_install()
109 {
110 # Go for echoing on configuration files if any haldaemon user
111 # was found.
112 if ! grep -q 'haldaemon' "$1/etc/passwd"; then
113 echo -n "Adding user: messagebus..."
114 echo 'haldaemon:x:26:26:HAL Daemon User:/dev/null:/bin/false' >> "$1/etc/passwd"
115 echo 'haldaemon:!:14013:0:99999:7:::' >> "$1/etc/shadow"
116 echo 'haldaemon:x:26:' >> "$1/etc/group"
117 echo 'haldaemon:!::' >> "$1/etc/gshadow"
118 status
119 fi
120 if ! grep -q ^HALD_OPTIONS "$1/etc/daemons.conf"; then
121 echo -n "Configuring /etc/daemons.conf..."
122 cat >> "$1/etc/daemons.conf" << "EOT"
123 # HAL daemon options.
124 HALD_OPTIONS="--daemon=yes"
126 EOT
127 status
128 fi
129 }
131 pre_remove()
132 {
133 /etc/init.d/hald stop
134 deluser haldaemon
135 }