wok-stable view linmodem-hsfmodem/receipt @ rev 7396

linmodem-hsfmodem: fix kernel version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 26 18:52:20 2010 +0100 (2010-11-26)
parents fd2978445c1a
children 9ce59d5bc5b7
line source
1 # SliTaz package receipt.
3 PACKAGE="linmodem-hsfmodem"
4 SOURCE="hsfmodem"
5 VERSION="7.80.02.06full"
6 CATEGORY="non-free"
7 SHORT_DESC="Driver for the Conexant (formerly Rockwell) HSF Softmodem family."
8 MAINTAINER="orphaned@sliatz.org"
9 DEPENDS="module-init-tools perl usbutils"
10 BUILD_DEPENDS="cpio linux lzma"
11 TARBALL="$SOURCE-$VERSION.tar.gz"
12 WEB_SITE="http://www.linuxant.com/drivers"
13 WGET_URL="http://www.linuxant.com/drivers/hsf/full/archive/$SOURCE-$VERSION/$TARBALL"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
19 [ -d $WOK/linux/taz ] || tazwok cook linux
20 cd $src
21 echo "Apply $file..."
22 patch -p1 < ../stuff/$SOURCE-$VERSION.diff || exit 1
23 # set /usr/src/linux
24 echo "Set fake /usr/src/linux dir..."
25 [ -e /usr/src ] && SRCDIR=yes || mkdir -p /usr/src
26 ln -s $WOK/linux/linux-$KERNEL_VERSION /usr/src/linux
27 grep -rl 'uname -r' . | xargs sed -i "s/uname -r/echo $KERNEL_VERSION/g"
28 # build driver
29 echo "Build driver"
30 make ROOT=$PWD/_pkg install
31 # build kernel modules
32 echo "Running $PWD/_pkg/usr/sbin/hsfconfig -ka"
33 $PWD/_pkg/usr/sbin/hsfconfig -ka
34 # reset /usr/src/linux
35 echo "Clean files"
36 rm /usr/src/linux
37 [ "$SRCDIR" = "yes" ] && rmdir /usr/src
38 echo "done."
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
45 # kernel modules
46 mkdir -p $fs/lib/modules/$KERNEL_VERSION
47 cp -a /lib/modules/$KERNEL_VERSION/extra $fs/lib/modules/$KERNEL_VERSION
48 # cleaning up
49 rm -r /lib/modules/$KERNEL_VERSION/extra
50 # command files
51 mkdir -p $fs/usr
52 cp -a $_pkg/usr/sbin $fs/usr
53 cp -a $_pkg/usr/lib $fs/usr
54 # config files
55 mkdir -p $fs/etc
56 cp -a $_pkg/etc/hsfmodem $fs/etc
57 cp -a stuff/zone.tab $fs/etc/hsfmodem
58 }
60 post_install()
61 {
62 depmod -a
63 echo -n "Install serial port devices"
64 hsfconfig -s > /dev/null
65 status
66 echo -n "Install kernel modules"
67 modprobe -v /dev/ttySHSF > /dev/null
68 status
69 echo -n "Set region"
70 hsfconfig -c AUTO
71 echo "-----------------------------------------------------------------------------"
72 echo "To enable your modem's full functionality (high-speed 56k data and FAX),"
73 echo "a license registration key must be obtained from Linuxant and entered with"
74 echo "hsfconfig --license."
75 echo ""
76 echo "Without a proper license key, the modem can only operate in FREE mode,"
77 echo "limited to a maximum speed of 14.4Kbps (V.32bis) and the FAX"
78 echo "functionality will not be available."
79 }
81 pre_remove()
82 {
83 hsfstop
84 }
86 post_remove()
87 {
88 depmod -a
89 rm -r /etc/hsfmodem
90 }