summaryrefslogtreecommitdiff
path: root/source/l/poppler-data/poppler-data.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/poppler-data/poppler-data.SlackBuild')
-rwxr-xr-xsource/l/poppler-data/poppler-data.SlackBuild22
1 files changed, 15 insertions, 7 deletions
diff --git a/source/l/poppler-data/poppler-data.SlackBuild b/source/l/poppler-data/poppler-data.SlackBuild
index c9937e7f..886ff1a2 100755
--- a/source/l/poppler-data/poppler-data.SlackBuild
+++ b/source/l/poppler-data/poppler-data.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2006, 2007, 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,13 +20,21 @@
# 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=poppler-data
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
ARCH=noarch
BUILD=${BUILD:-1}
-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}
@@ -34,8 +42,8 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf ${PKGNAM}-${VERSION}
-tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1
-cd ${PKGNAM}-$VERSION
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z || exit 1
+cd ${PKGNAM}-$VERSION || exit 1
chown -R root:root .
find . \
@@ -45,7 +53,7 @@ find . \
-exec chmod 644 {} \;
# install:
-make install datadir=/usr/share DESTDIR=$PKG
+make install datadir=/usr/share DESTDIR=$PKG || exit 1
# Add a documentation directory:
mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION