summaryrefslogtreecommitdiffstats
path: root/gspcav1
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2007-10-17 20:49:06 +0000
committer Eric Hameleers <alien@slackware.com>2007-10-17 20:49:06 +0000
commit2fffe35041c102674489d003e268077255433626 (patch)
tree4f27591e3e7e3ba22257fe06585de29f178cbd9e /gspcav1
parent426a237d3113b29aa6adcd30b08f89b1ba6a0af4 (diff)
downloadasb-2fffe35041c102674489d003e268077255433626.tar.gz
asb-2fffe35041c102674489d003e268077255433626.tar.xz
Updated script
Diffstat (limited to 'gspcav1')
-rwxr-xr-xgspcav1/build/gspcav1.SlackBuild120
1 files changed, 53 insertions, 67 deletions
diff --git a/gspcav1/build/gspcav1.SlackBuild b/gspcav1/build/gspcav1.SlackBuild
index 3dd7ff7d..570d22ac 100755
--- a/gspcav1/build/gspcav1.SlackBuild
+++ b/gspcav1/build/gspcav1.SlackBuild
@@ -1,31 +1,32 @@
#!/bin/sh
# $Id$
# Copyright (c) 2007 Eric Hameleers <alien@slackware.com>
+# All rights reserved.
#
-# Permission to use, copy, modify, and distribute this software for
-# any purpose with or without fee is hereby granted, provided that
-# the above copyright notice and this permission notice appear in all
-# copies.
+# Permission to use, copy, modify, and distribute this software for
+# any purpose with or without fee is hereby granted, provided that
+# the above copyright notice and this permission notice appear in all
+# copies.
#
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# Slackware SlackBuild script
# ===========================
# By: Eric Hameleers <alien@slackware.com>
# For: gspcav1
-# Descr: gspcav1 video for linux (v4l) driver
+# Descr: gspcav1 video for linux 'v4l' driver
# URL: http://mxhaard.free.fr/
# Needs: Linux kernel >= 2.6.11
# Changelog:
@@ -35,6 +36,8 @@
# * Update to driver version 1.00.12
# 20070508-1: 26/may/2007 by Eric Hameleers <alien@slackware.com>
# * Update to driver version 1.00.18
+# 20070508-2: 17/Oct/2007 by Eric Hameleers <alien@slackware.com>
+# * Small changes to SlackBuild.
#
# Run 'sh gspcav1.SlackBuild --cleanup' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -42,13 +45,12 @@
#
# -----------------------------------------------------------------------------
-# --- INIT ---
# Set initial variables:
PRGNAM=gspcav1
VERSION=${VERSION:-20070508}
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
DOCS="changelog"
@@ -56,8 +58,8 @@ DOCS="changelog"
DEBUG=${DEBUG:-NO}
# Where do we look for sources?
-CWD=`pwd`
-SRCDIR=`dirname $0`
+CWD=$(pwd)
+SRCDIR=$(dirname $0)
[ "${SRCDIR:0:1}" == "." ] && SRCDIR=${CWD}/${SRCDIR}
# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
@@ -65,13 +67,11 @@ TMP=${TMP:-/tmp/build}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-# Kernel module related parameters
-KVER=${KVER:-`uname -r`}
+# Kernel module related parameters:
+KVER=${KVER:-$(uname -r)}
KSRC=${KSRC:-/lib/modules/${KVER}/build}
-PATCHLEVEL=`echo $KVER|cut -f 2 -d '.'`
-[ $PATCHLEVEL -eq 4 ] && MODCONFFILE=modules.conf || MODCONFFILE=modprobe.conf
-# Input URL: http://mxhaard.free.fr/spca50x/Download/gspcav1-20061216.tar.gz
+# Input URL: http://mxhaard.free.fr/spca50x/Download/gspcav1-20070508.tar.gz
SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz"
SRCURL="http://mxhaard.free.fr/spca50x/Download/${PRGNAM}-${VERSION}.tar.gz"
@@ -87,7 +87,7 @@ set -u
P1=${1:-1}
# Slackware 11 and up need other option (gcc > 3.3.x)
-if [ `gcc -dumpversion | tr -d '.' |cut -c 1-2` -gt 33 ]; then
+if [ $(gcc -dumpversion | tr -d '.' |cut -c 1-2) -gt 33 ]; then
MOPT=tune
else
MOPT=cpu
@@ -114,42 +114,28 @@ case "$ARCH" in
;;
esac
-if [ ! -d $TMP/tmp-$PRGNAM ]; then
- mkdir -p $TMP/tmp-$PRGNAM # location to build the source
-elif [ "$P1" != "--oldbuild" ]; then
- # If the "--oldbuild" parameter is present, we keep
- # the old build files and continue;
- # By default we remove the remnants of previous build and continue:
- rm -rf $TMP/tmp-$PRGNAM/*
-fi
-
-if [ ! -d $PKG ]; then
- mkdir -p $PKG # place for the package to be built
-else
- rm -rf $PKG/* # We always erase old package's contents:
-fi
-
-if [ ! -d $OUTPUT ]; then
- mkdir -p $OUTPUT # place for the package to be saved
-fi
-
-
-# --- SOURCE FILE AVAILABILITY ---
+# Create working directories:
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
+mkdir -p $PKG # place for the package to be built
+rm -rf $PKG/* # always erase old package's contents:
+mkdir -p $OUTPUT # place for the package to be saved
+# Source file availability:
if ! [ -f ${SOURCE} ]; then
if ! [ "x${SRCURL}" == "x" ]; then
# Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
- [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/`basename $SOURCE`"
- echo "Source '`basename ${SOURCE}`' not available yet..."
- echo "Will download file to `dirname $SOURCE`"
- wget -nv -O "${SOURCE}" "${SRCURL}" || true
- if [ $? -ne 0 ]; then
- echo "Downloading '`basename ${SOURCE}`' failed... aborting the build."
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ echo "Will download file to $(dirname $SOURCE)"
+ wget -nv --connect-timeout=30 -O "${SOURCE}" "${SRCURL}" || true
+ if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
+ echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
mv -f "${SOURCE}" "${SOURCE}".FAIL
exit 1
fi
else
- echo "File '`basename ${SOURCE}`' not available... aborting the build."
+ echo "File '$(basename ${SOURCE})' not available... aborting the build."
exit 1
fi
fi
@@ -166,10 +152,11 @@ echo "|| $PRGNAM-$VERSION"
echo "++"
cd $TMP/tmp-$PRGNAM
+
echo "Extracting the source archive(s) for $PRGNAM..."
-if `file ${SOURCE} | grep -q ": bzip2"`; then
+if $(file ${SOURCE} | grep -q ": bzip2"); then
tar -xjvf ${SOURCE}
-else
+elif $(file ${SOURCE} | grep -q ": gzip"); then
tar -xzvf ${SOURCE}
fi
cd ${PRGNAM}-${VERSION}
@@ -177,10 +164,8 @@ if [ "$DEBUG" == "NO" ]; then
# Set DEBUG="YES" up above if you need to debug the driver:
patch -p0 < $SRCDIR/${PRGNAM}_nodebug.patch 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log
fi
-
-chown -R root.root *
-find . -perm 777 -exec chmod 755 {} \;
-find . -perm 666 -exec chmod 644 {} \;
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
echo Building ...
export LDFLAGS="$SLKLDFLAGS"
@@ -191,7 +176,7 @@ make KERNELVERSION=${KVER} KERNELDIR=${KSRC} 2>&1 | tee $OUTPUT/make-${PRGNAM}.l
mkdir -p $PKG/lib/modules/${KVER}/kernel/drivers/usb/media
install -c -m 644 gspca.ko $PKG/lib/modules/${KVER}/kernel/drivers/usb/media/
-# Add this to the doinst.sh
+# Add this to the doinst.sh:
! [ -d $PKG/install ] && mkdir -p $PKG/install
cat <<-EEOOTT >> $PKG/install/doinst.sh
# Only run depmod on matching running kernel
@@ -203,7 +188,7 @@ cat <<-EEOOTT >> $PKG/install/doinst.sh
chroot . /sbin/depmod -a \$MYKERNEL 1> /dev/null 2> /dev/null
fi
fi
-
+
EEOOTT
# Add documentation:
@@ -220,10 +205,11 @@ fi
# Build the package:
cd $PKG
-makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.tgz \
- 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
-(cd $OUTPUT && md5sum ${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.tgz.md5)
-cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}_${KVER}-${ARCH}-${BUILD}.txt
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+cd $OUTPUT
+md5sum ${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.tgz.md5
+cd -
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}_$(echo $KVER | tr - _)-${ARCH}-${BUILD}.txt
# Clean up the extra stuff:
if [ "$P1" = "--cleanup" ]; then