summaryrefslogtreecommitdiffstats
path: root/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/usb_modeswitch/usb_modeswitch.SlackBuild')
-rwxr-xr-xsource/a/usb_modeswitch/usb_modeswitch.SlackBuild42
1 files changed, 27 insertions, 15 deletions
diff --git a/source/a/usb_modeswitch/usb_modeswitch.SlackBuild b/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
index 703222152..af59704c1 100755
--- a/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
+++ b/source/a/usb_modeswitch/usb_modeswitch.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for usb_modeswitch.
-# Copyright 2010, 2012, 2013, 2015 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2010, 2012, 2013, 2015, 2017, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2010 David Somero, Athens, TN, USA
# All rights reserved.
#
@@ -23,10 +23,12 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PKGNAM=usb_modeswitch
-VERSION=${VERSION:-2.2.6}
-DATAVER=${DATAVER:-20151101}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-2.5.1}
+DATAVER=${DATAVER:-20170806}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -38,10 +40,17 @@ if [ -z "$ARCH" ]; then
esac
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
# Upstream is playing guess the program name.
SRCPKGNAM=$(echo $PKGNAM | tr _ -)
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
@@ -72,16 +81,19 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-make clean
+make clean || exit 1
# "make static" uses the embedded "jim" Tcl interpreter
-make static
+make static || exit 1
+
+make \
+ DESTDIR=$PKG \
+ MANDIR=$PKG/usr/man/man1 \
+ install || exit 1
+
+mv $PKG/etc/usb_modeswitch.conf $PKG/etc/usb_modeswitch.conf.new
-install -D -s --mode=755 usb_modeswitch $PKG/usr/sbin/usb_modeswitch
-install -D --mode=755 usb_modeswitch.sh $PKG/lib/udev/usb_modeswitch
-install -D --mode=644 usb_modeswitch.conf $PKG/etc/usb_modeswitch.conf.new
-install -D --mode=644 usb_modeswitch.1 $PKG/usr/man/man1/usb_modeswitch.1
-install -d $PKG/var/lib/usb_modeswitch
-install -D -s --mode=755 usb_modeswitch_dispatcher $PKG/usr/sbin/usb_modeswitch_dispatcher
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
@@ -103,7 +115,7 @@ cp -a \
COPYING* README* \
$PKG/usr/doc/$PKGNAM-$VERSION
# http://www.draisberghof.de/usb_modeswitch/device_reference.txt.gz
-cat $CWD/device_reference.txt.gz > $PKG/usr/doc/$PKGNAM-$VERSION/device_reference.txt
+zcat $CWD/device_reference.txt.gz > $PKG/usr/doc/$PKGNAM-$VERSION/device_reference.txt
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION/jim
cp -a \
jim/{AUTHORS,LICENSE,README*} \