wok-current annotate get-softmodem-driver/stuff/slmodem.receipt @ rev 3498
get-softmodem-driver: Add automatic country detection during martian install
author | Dominique Corbex <domcox@users.sourceforge.net> |
---|---|
date | Thu Jun 18 21:10:59 2009 +0200 (2009-06-18) |
parents | 8fc90d8b565b |
children |
rev | line source |
---|---|
domcox@3473 | 1 # SliTaz package receipt. |
domcox@3473 | 2 |
domcox@3473 | 3 PACKAGE="slmodem" |
domcox@3473 | 4 VERSION="2.9.11-20090222" |
domcox@3473 | 5 CATEGORY="non-free" |
domcox@3478 | 6 SHORT_DESC="Support for the SmartLink Softmodem and ALSA supported chipsets." |
domcox@3473 | 7 MAINTAINER="domcox@slitaz.org" |
domcox@3473 | 8 TARBALL="$PACKAGE-$VERSION.tar.gz" |
domcox@3498 | 9 DEPENDS="alsa-lib module-init-tools linux-source" |
domcox@3473 | 10 WEB_SITE="http://linmodems.technion.ac.il" |
domcox@3473 | 11 WGET_URL="http://linmodems.technion.ac.il/packages/smartlink/$TARBALL" |
domcox@3473 | 12 |
domcox@3473 | 13 # Rules to gen a SliTaz package suitable for Tazpkg. |
domcox@3473 | 14 |
domcox@3473 | 15 post_install() |
domcox@3473 | 16 { |
domcox@3494 | 17 # Country detection |
domcox@3494 | 18 if [ -e /etc/TZ ]; then |
domcox@3494 | 19 ZONE=`cat /etc/TZ` |
domcox@3494 | 20 CODE=`grep $ZONE /usr/share/slmodem/zone.tab | cut -f1'` |
domcox@3494 | 21 if [ -n $CODE ]; then |
domcox@3494 | 22 COUNTRY=`grep ^$CODE /usr/share/slmodem/slmodem.country | cut -f2` |
domcox@3494 | 23 fi |
domcox@3494 | 24 fi |
domcox@3494 | 25 if [ -z $COUNTRY ]; then |
domcox@3494 | 26 COUNTRY="USA" |
domcox@3494 | 27 fi |
domcox@3494 | 28 echo "Automatic country setting: $COUNTRY" |
domcox@3494 | 29 # Save options |
domcox@3494 | 30 if [ `grep -c SLMODEM_OPTIONS /etc/daemons.conf` -gt 0 ]; then |
domcox@3494 | 31 sed -i 's/SLMODEM_OPTIONS=.*/SLMODEM_OPTIONS="--country='"$COUNTRY"' \/dev\/slamr0"/' /etc/daemons.conf |
domcox@3494 | 32 else |
domcox@3494 | 33 echo "# slmodemd daemon options." >> $root/etc/daemons.conf |
domcox@3494 | 34 echo "SLMODEM_OPTIONS=\"--country=$COUNTRY /dev/slamr0\"" >> $root/etc/daemons.conf |
domcox@3494 | 35 echo >> $root/etc/daemons.conf |
domcox@3494 | 36 fi |
domcox@3494 | 37 # Load module |
domcox@3473 | 38 depmod -a |
domcox@3473 | 39 /sbin/modprobe slamr && /etc/init.d/slmodem start |
domcox@3473 | 40 } |
domcox@3494 | 41 |
domcox@3494 | 42 post_remove() |
domcox@3494 | 43 { |
domcox@3498 | 44 /etc/init.d/slmodem stop |
domcox@3494 | 45 rm -rf /usr/share/slmodem |
domcox@3494 | 46 } |