wok-4.x rev 3462

get-softmodem-driver: add get-hcfpcimodem-driver
author Dominique Corbex <domcox@users.sourceforge.net>
date Tue Jun 16 09:46:41 2009 +0200 (2009-06-16)
parents 2b328ebaa020
children c7584773b8f1
files get-softmodem-driver/receipt get-softmodem-driver/stuff/get-hcfpcimodem-driver get-softmodem-driver/stuff/get-softmodem-driver get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff get-softmodem-driver/stuff/hcfpcimodem.receipt
line diff
     1.1 --- a/get-softmodem-driver/receipt	Tue Jun 16 09:22:41 2009 +0200
     1.2 +++ b/get-softmodem-driver/receipt	Tue Jun 16 09:46:41 2009 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="get-softmodem-driver"
     1.7 -VERSION="0.4"
     1.8 +VERSION="0.5"
     1.9  CATEGORY="non-free"
    1.10  SHORT_DESC="Get misc softmodem drivers."
    1.11  MAINTAINER="domcox@slitaz.org"
    1.12 @@ -13,7 +13,7 @@
    1.13  {
    1.14  	mkdir -p $fs/usr/bin
    1.15  	cp stuff/$PACKAGE $fs/usr/bin
    1.16 -	for i in hsfmodem; do
    1.17 +	for i in hsfmodem hcfpcimodem; do
    1.18  		ln -s $PACKAGE $fs/usr/bin/get-$i-driver
    1.19  	done
    1.20  	mkdir -p $fs/usr/share/softmodem
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-softmodem-driver/stuff/get-hcfpcimodem-driver	Tue Jun 16 09:46:41 2009 +0200
     2.3 @@ -0,0 +1,1 @@
     2.4 +get-softmodem-driver
     2.5 \ No newline at end of file
     3.1 --- a/get-softmodem-driver/stuff/get-softmodem-driver	Tue Jun 16 09:22:41 2009 +0200
     3.2 +++ b/get-softmodem-driver/stuff/get-softmodem-driver	Tue Jun 16 09:46:41 2009 +0200
     3.3 @@ -9,6 +9,9 @@
     3.4  hsfmodem)
     3.5  	. /usr/share/softmodem/hsfmodem.receipt
     3.6  	;;
     3.7 +hcfpcimodem)
     3.8 +	. /usr/share/softmodem/hcfpcimodem.receipt
     3.9 +	;;
    3.10  *)	echo "Unknown modem driver. Please run one of the following commands:"
    3.11  	for i in $(cd $(dirname $0); ls get-*-driver); do
    3.12  		[ -L $i ] || continue
    3.13 @@ -58,7 +61,7 @@
    3.14  *rpm)	rpm2cpio < $(basename $WGET_URL) | cpio -id;;
    3.15  *deb)	dpkg-deb -x $(basename $WGET_URL) . ;;
    3.16  *bz2)	tar xjf $(basename $WGET_URL) ;;
    3.17 -*tar.gz|*tgz)	tar xzf $(basename $WGET_URL) ;;
    3.18 +*tar.gz|*tgz)	tar xzf $(basename $WGET_URL) || exit 1 ;;
    3.19  *zip)	unzip $(basename $WGET_URL);;
    3.20  *o)	;;
    3.21  esac
    3.22 @@ -88,11 +91,28 @@
    3.23  	mkdir -p $fs/usr/src
    3.24  	mv $src $fs/usr/src
    3.25  	;;
    3.26 +hcfpcimodem)
    3.27 +	# Rules to configure and make the package.
    3.28 +	cd $src
    3.29 +	echo "Apply $file..."
    3.30 +	patch -p1 < /usr/share/softmodem/$PACKAGE-$VERSION.diff || exit 1
    3.31 +	# Build
    3.32 +	make all
    3.33 +	make ROOT=$fs install
    3.34 +	make clean
    3.35 +	# Data for automatic region setting
    3.36 +	mkdir -p $fs/usr/share/softmodem
    3.37 +	cp -a /usr/share/softmodem/zone.tab $fs/usr/share/softmodem/hcfpcizone.tab
    3.38 +	# src is needed
    3.39 +	cd $taz
    3.40 +	mkdir -p $fs/usr/src
    3.41 +	mv $src $fs/usr/src
    3.42 +	;;
    3.43  esac
    3.44  
    3.45  # Create receipt
    3.46  cd $taz
    3.47 -cat /usr/share/softmodem/hsfmodem.receipt> $PACKAGE-$VERSION/receipt
    3.48 +cat /usr/share/softmodem/$PACKAGE.receipt> $PACKAGE-$VERSION/receipt
    3.49  
    3.50  # Pack
    3.51  tazpkg pack $PACKAGE-$VERSION
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/get-softmodem-driver/stuff/hcfpcimodem-1.19full.diff	Tue Jun 16 09:46:41 2009 +0200
     4.3 @@ -0,0 +1,169 @@
     4.4 +diff -ru hcfpcimodem-1.19full/config.mak hcfpcimodem-1.19full-slitaz/config.mak
     4.5 +--- hcfpcimodem-1.19full/config.mak	2009-04-29 22:04:22.000000000 +0200
     4.6 ++++ hcfpcimodem-1.19full-slitaz/config.mak	2009-06-15 22:17:05.000000000 +0200
     4.7 +@@ -131,4 +131,4 @@
     4.8 + 		-e "s!@SCR_SUPPORT@!`test ! \"$(IMPORTED_SCR_SUPPORT)\" = yes; echo $$?`!g" \
     4.9 + 		-e "s!@DMP_SUPPORT@!`test -z \"$(IMPORTED_DMP_SUPPORT)\"; echo $$?`!g" \
    4.10 + 		< $< > $@
    4.11 +-	chmod --reference=$< $@
    4.12 ++	chmod 755 $@
    4.13 +diff -ru hcfpcimodem-1.19full/makefile hcfpcimodem-1.19full-slitaz/makefile
    4.14 +--- hcfpcimodem-1.19full/makefile	2009-04-29 22:04:22.000000000 +0200
    4.15 ++++ hcfpcimodem-1.19full-slitaz/makefile	2009-06-15 22:17:47.000000000 +0200
    4.16 +@@ -149,7 +149,7 @@
    4.17 + ifeq ($(RPMOPTEVAL),yes)
    4.18 + RPMTARGETCPU=$(shell rpm --eval '%_target_cpu')
    4.19 + else
    4.20 +-RPMTARGETCPU=$(shell uname -i)
    4.21 ++RPMTARGETCPU=$(shell uname -m)
    4.22 + endif
    4.23 + 
    4.24 + ifneq ($(RPMOPTDEFINE),yes)
    4.25 +diff -ru hcfpcimodem-1.19full/modules/Makefile hcfpcimodem-1.19full-slitaz/modules/Makefile
    4.26 +--- hcfpcimodem-1.19full/modules/Makefile	2009-04-29 22:04:22.000000000 +0200
    4.27 ++++ hcfpcimodem-1.19full-slitaz/modules/Makefile	2009-06-15 22:19:01.000000000 +0200
    4.28 +@@ -20,7 +20,7 @@
    4.29 + include $(TOP)/config.mak
    4.30 + 
    4.31 + IMPORTED = $(TOP)/modules/imported
    4.32 +-MACHINE_ARCH := $(shell if uname --hardware-platform >/dev/null 2>&1 && ! uname --hardware-platform | grep -q "unknown"; then uname --hardware-platform; else uname --machine | sed 's/^i.86$$/i386/'; fi)
    4.33 ++MACHINE_ARCH := $(shell if uname -p >/dev/null 2>&1 && ! uname -p | grep -q "unknown"; then uname -p; else uname -m | sed 's/^i.86$$/i386/'; fi)
    4.34 + ifneq ($(subst powerpc,ppc,$(IMPORTED_ARCH)),$(MACHINE_ARCH))
    4.35 + $(warning *** WARNING: Trying to compile kernel modules on a $(MACHINE_ARCH) system while the installed $(CNXTTARGET) driver package is for $(IMPORTED_ARCH), this is likely to fail... ***)
    4.36 + endif
    4.37 +diff -ru hcfpcimodem-1.19full/scripts/cnxtconfig.in hcfpcimodem-1.19full-slitaz/scripts/cnxtconfig.in
    4.38 +--- hcfpcimodem-1.19full/scripts/cnxtconfig.in	2009-04-29 22:04:22.000000000 +0200
    4.39 ++++ hcfpcimodem-1.19full-slitaz/scripts/cnxtconfig.in	2009-06-16 09:32:18.000000000 +0200
    4.40 +@@ -74,7 +74,7 @@
    4.41 + 				answer="${region}"
    4.42 + 				;;
    4.43 + 			*)
    4.44 +-				answer="`echo \"${answer}\" | tr '[a-z ]' '[A-Z_]'`"
    4.45 ++				answer="`echo \"${answer}\" | tr '[a-z]' '[A-Z]' | sed 's/\s/_/g'`"
    4.46 + 				;;
    4.47 + 			esac
    4.48 + 		fi
    4.49 +@@ -109,15 +109,13 @@
    4.50 + {
    4.51 + 	# Try to guess what region we're in, using the timezone settings
    4.52 + 
    4.53 +-	localtime_size="`/bin/ls -lL /etc/localtime 2>/dev/null | ${AWK} '{print $5}'`"
    4.54 +-
    4.55 +-	if ! [ ${localtime_size} -gt 0 ]; then
    4.56 ++	if [ ! -e /etc/TZ ]; then
    4.57 + 		return 1
    4.58 + 	fi
    4.59 + 
    4.60 +-	zoneinfo_dir=/usr/share/zoneinfo
    4.61 ++	zoneinfo_dir=/usr/share/softmodem
    4.62 + 
    4.63 +-	if [ ! -d ${zoneinfo_dir} -o ! -f ${zoneinfo_dir}/zone.tab ]; then
    4.64 ++	if [ -f ${zoneinfo_dir}/hcfpcizone.tab ]; then
    4.65 + 		return 1
    4.66 + 	fi
    4.67 + 
    4.68 +@@ -206,17 +204,9 @@
    4.69 + 	iso_VN=00BC # VIETNAM
    4.70 + 
    4.71 + 	(
    4.72 +-		cd ${zoneinfo_dir} 2>/dev/null || return 1
    4.73 +-		find . -type f -size "${localtime_size}"c -print | sed 's@^\./@@' | \
    4.74 +-			while read file; do
    4.75 +-				cmp -s /etc/localtime $file || continue
    4.76 +-# in the egrep and sed regular expressions below, it is very important to
    4.77 +-# have tabs, not spaces
    4.78 +-				egrep "	$file(	.*|\$)" ${zoneinfo_dir}/zone.tab
    4.79 +-			done | sed -n '/^[^#]/s/	.*//p' | sort | uniq | \
    4.80 +-				while read code; do
    4.81 +-					eval "echo \${iso_${code}}"
    4.82 +-				done | sort | uniq
    4.83 ++		zone=`cat /etc/TZ`
    4.84 ++		code=`grep $zone ${zoneinfo_dir}/hcfpcizone.tab | awk '{print $1}' | sort | uniq`
    4.85 ++		eval "echo \${iso_${code}}"
    4.86 + 		return 0
    4.87 + 	)
    4.88 + }
    4.89 +@@ -271,7 +261,7 @@
    4.90 + # The md5sum is used for input verification.
    4.91 + disptokey()
    4.92 + {
    4.93 +-	k="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed 's/FREE/00000000/' | tr -d -c '[0-9A-F\012]'`"
    4.94 ++	k="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed 's/FREE/00000000/' | tr -d -c '[0-9][A-F][\012]'`"
    4.95 + 	case $k in
    4.96 + 	00000000)
    4.97 + 		echo "$k"
    4.98 +@@ -1655,7 +1645,7 @@
    4.99 + 		update-modules
   4.100 + 	else
   4.101 + 		if ("$@" "${modulesconf}" | "${filter}"; cat ${f}) > ${modulesconf}.$$; then
   4.102 +-			if ! cmp --silent ${modulesconf}.$$ ${modulesconf}; then
   4.103 ++			if ! cmp -s ${modulesconf}.$$ ${modulesconf}; then
   4.104 + 				if ! cp ${modulesconf}.$$ ${modulesconf}; then
   4.105 + 					rm -f ${modulesconf}.$$ ${f}
   4.106 + 					exit 1
   4.107 +@@ -1681,7 +1671,7 @@
   4.108 + 	fi
   4.109 + 
   4.110 + 	if ("$@" "${modprobeconf}" | "${filter}"; cat ${f}) > ${modprobeconf}.$$; then
   4.111 +-		if ! cmp --silent ${modprobeconf}.$$ ${modprobeconf}; then
   4.112 ++		if ! cmp -s ${modprobeconf}.$$ ${modprobeconf}; then
   4.113 + 			if ! cp ${modprobeconf}.$$ ${modprobeconf}; then
   4.114 + 				rm -f ${modprobeconf}.$$ ${f}
   4.115 + 				exit 1
   4.116 +@@ -2214,6 +2204,10 @@
   4.117 + 	elif [ -d /var/lib/LST ]; then
   4.118 + 		OSDISTNAME=Caldera
   4.119 + 		OSDISTIDNT=caldera
   4.120 ++	elif [ -f /etc/slitaz-release ]; then
   4.121 ++		OSDISTNAME=SliTaz
   4.122 ++		OSDISTIDNT=slitaz
   4.123 ++		OSDISTVERS="`cat /etc/slitaz-release`"
   4.124 + 	fi
   4.125 + 
   4.126 + 	OSKERNNAME="`uname -s | tr '[A-Z]' '[a-z]'`"
   4.127 +@@ -2268,7 +2262,7 @@
   4.128 + 
   4.129 + dump_file()
   4.130 + {
   4.131 +-	dump_cmd cat -v $@
   4.132 ++	dump_cmd cat $@
   4.133 + }
   4.134 + 
   4.135 + dump_diagnostics()
   4.136 +@@ -2587,7 +2581,7 @@
   4.137 + 	fi
   4.138 + 	units="${specificunit}"
   4.139 + 	if [ -z "${units}" ]; then
   4.140 +-		units=`ls --ignore=flush_nvm ${procdrvdir}`
   4.141 ++		units=`ls ${procdrvdir} | grep -v flush_nvm`
   4.142 + 
   4.143 + 		if [ -z "${units}" ]; then
   4.144 + 			echo ""
   4.145 +@@ -2884,7 +2878,7 @@
   4.146 + 			explicitopt=true
   4.147 + 			do_cfgregion=true
   4.148 + 			if [ -n "$2" ]; then
   4.149 +-				setregion="`echo \"$2\" | tr '[a-z ]' '[A-Z_]'`"
   4.150 ++				setregion="`echo \"$2\" | tr '[a-z]' '[A-Z]' | sed 's/\s/_/g'`"
   4.151 + 			fi
   4.152 + 			shift 2
   4.153 + 			;;
   4.154 +@@ -2954,7 +2948,7 @@
   4.155 + 
   4.156 + # Accept --region <name> as equivalent to --region=<name>
   4.157 + if ${do_cfgregion} && [ $# -ge 1 -a -z "${setregion}" ]; then
   4.158 +-	setregion="`echo \"$1\" | tr '[a-z ]' '[A-Z_]'`"
   4.159 ++	setregion="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed 's/\s/_/s'`"
   4.160 + 	shift
   4.161 + fi
   4.162 + 
   4.163 +@@ -3033,7 +3027,7 @@
   4.164 + 
   4.165 + if ${do_cfgnewinstance}; then
   4.166 + 	if [ ! -d "${cnxtnvmdir}/dynamic/${newinstance}" ]; then
   4.167 +-		mkdir --mode=700 --parents "${cnxtnvmdir}/dynamic/${newinstance}" || exit $?
   4.168 ++		mkdir -m 700 -p "${cnxtnvmdir}/dynamic/${newinstance}" || exit $?
   4.169 + 		# The purpose of --info here is to ensure module reload:
   4.170 + 		(sleep 2; exec @CNXTTARGET@config --auto --region=AUTO --info) </dev/null >/dev/null 2>&1 &
   4.171 + 	fi
   4.172 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/get-softmodem-driver/stuff/hcfpcimodem.receipt	Tue Jun 16 09:46:41 2009 +0200
     5.3 @@ -0,0 +1,18 @@
     5.4 +# SliTaz package receipt.
     5.5 +
     5.6 +PACKAGE="hcfpcimodem"
     5.7 +VERSION="1.19full"
     5.8 +CATEGORY="non-free"
     5.9 +SHORT_DESC="Modem driver for Conexant HCF PCI chipsets."
    5.10 +MAINTAINER="domcox@slitaz.org"
    5.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    5.12 +DEPENDS="module-init-tools linux-source"
    5.13 +WEB_SITE="http://www.linuxant.com/drivers"
    5.14 +WGET_URL="http://www.linuxant.com/drivers/hcf/full/archive/$PACKAGE-$VERSION/$TARBALL"
    5.15 +
    5.16 +# Rules to gen a SliTaz package suitable for Tazpkg.
    5.17 +
    5.18 +post_install()
    5.19 +{
    5.20 +	/usr/sbin/hcfpciconfig --auto
    5.21 +}