summaryrefslogtreecommitdiffstats
path: root/source/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild')
-rwxr-xr-xsource/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild33
1 files changed, 19 insertions, 14 deletions
diff --git a/source/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild b/source/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild
index 1ba342b37..2ba3a0b56 100755
--- a/source/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild
+++ b/source/n/mobile-broadband-provider-info/mobile-broadband-provider-info.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for mobile-broadband-provider-info
@@ -24,10 +24,11 @@
# Modified 2011, 2012 by Eric Hameleers, Eindhoven, NL
+cd $(dirname $0) ; CWD=$(pwd)
+
PKGNAM=mobile-broadband-provider-info
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
-TAG=${TAG:-}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
MARCH=$( uname -m )
@@ -41,7 +42,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# 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
+
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -68,14 +76,12 @@ case "$ARCH" in
*) TARGET=$ARCH-slackware-linux ;;
esac
-set -e
-
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.?z*
-cd $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
+cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
find . \
@@ -99,23 +105,22 @@ CXXFLAGS="$SLKCFLAGS" \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PKGNAM-$VERSION \
- --build=$TARGET
+ --build=$TARGET || exit 1
-make
-make install DESTDIR=$PKG
+make || exit 1
+make install DESTDIR=$PKG || exit 1
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
- COPYING ChangeLog NEWS README \
+ COPYING* ChangeLog NEWS README* \
$PKG/usr/doc/$PKGNAM-$VERSION
-cat $CWD/$PKGNAM.SlackBuild > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
+/sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD.txz