summaryrefslogtreecommitdiffstats
path: root/development/as31/as31.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/as31/as31.SlackBuild')
-rw-r--r--development/as31/as31.SlackBuild41
1 files changed, 24 insertions, 17 deletions
diff --git a/development/as31/as31.SlackBuild b/development/as31/as31.SlackBuild
index 0ce5baa510..2c9b8c9dd7 100644
--- a/development/as31/as31.SlackBuild
+++ b/development/as31/as31.SlackBuild
@@ -1,15 +1,18 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for as31
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=as31
VERSION=${VERSION:-2.3.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -19,7 +22,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -40,23 +47,25 @@ fi
set -e
-# for some reason, upstream uses colons for separators in its URL
-if [ -e "wiki:projects:linux:as31:$PRGNAM-$VERSION.tar.gz" ]; then
- mv "wiki:projects:linux:as31:$PRGNAM-$VERSION.tar.gz" $PRGNAM-$VERSION.tar.gz
-fi
+# For some reason, upstream uses colons for separators in its URL.
+# Some clients might save the file with hex escapes in the name...
+# If all else fails, accept SRC from the environment.
+for i in "${SRC:-$PRGNAM-$VERSION.tar.gz}" \
+ "wiki:projects:linux:as31:$PRGNAM-$VERSION.tar.gz" \
+ "wiki%3Aprojects%3Alinux%3Aas31%3A$PRGNAM-$VERSION.tar.gz";
+do
+ [ -e "$CWD/$i" ] && SRC="$CWD/$i"
+done
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $SRC
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# Patch from Debian, check return value from getline(), seems like
# a good idea.
@@ -78,9 +87,7 @@ sh ./configure \
make
make install-strip DESTDIR=$PKG
-
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+gzip -9 $PKG/usr/man/man1/$PRGNAM.1
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/examples
cp -a COPYING AUTHORS ChangeLog NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
@@ -91,4 +98,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE