aboutsummaryrefslogtreecommitdiff
path: root/office
diff options
context:
space:
mode:
Diffstat (limited to 'office')
-rw-r--r--office/pandoc-bin/pandoc-bin.SlackBuild42
1 files changed, 22 insertions, 20 deletions
diff --git a/office/pandoc-bin/pandoc-bin.SlackBuild b/office/pandoc-bin/pandoc-bin.SlackBuild
index 3dc4839cfcb09..b2abde702dfaf 100644
--- a/office/pandoc-bin/pandoc-bin.SlackBuild
+++ b/office/pandoc-bin/pandoc-bin.SlackBuild
@@ -27,20 +27,18 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pandoc-bin
SRCNAM=pandoc
VERSION=${VERSION:-2.17.1.1}
-ARCNAM=$(basename $CWD/pandoc*.deb .deb);ARCNAM=${ARCNAM:(-5)}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
-if [ "$ARCNAM" = "amd64" ]; then
- BIT="64bit"; ARCH="x86_64"
-else
- echo "$ARCNAM is not supported."
- exit 1
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
fi
-set -e
-
# 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.
@@ -53,15 +51,19 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+if [ "$ARCH" = "x86_64" ]; then
+ DEBARCH="amd64"
+else
+ echo "Sorry, the pandoc binary is currently available for x86_64 only."
+ exit 1
+fi
+
+set -e
+
rm -rf $PKG
-mkdir -p $TMP $PKG/usr $OUTPUT
-cd $TMP
-rm -rf $SRCNAM-$VERSION
-mkdir -p $SRCNAM-$VERSION
-mv $CWD/$SRCNAM-$VERSION-$BUILD-$ARCNAM.deb $SRCNAM-$VERSION
-cd $SRCNAM-$VERSION
-ar -x $SRCNAM-$VERSION-$BUILD-$ARCNAM.deb
-tar xvf data.tar.gz
+mkdir -p $TMP $PKG $OUTPUT
+cd $PKG
+ar p $CWD/$SRCNAM-$VERSION-*-$DEBARCH.deb data.tar.gz | tar xvz
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -69,17 +71,17 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-mkdir -p $PKG/usr/bin
mkdir -p $PKG/opt/$PRGNAM
-cp -a $TMP/$SRCNAM-$VERSION/usr/bin/pandoc $PKG/opt/$PRGNAM
+mv usr/bin/pandoc $PKG/opt/$PRGNAM
ln -s /opt/$PRGNAM/pandoc $PKG/usr/bin/pandoc
-cp -a $TMP/$SRCNAM-$VERSION/usr/share/man $PKG/usr/
+mv usr/share/man $PKG/usr/
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-cp -a $TMP/$SRCNAM-$VERSION/usr/share/doc/pandoc/copyright \
+mv usr/share/doc/pandoc/copyright \
$PKG/usr/doc/$PRGNAM-$VERSION
+rm -rf usr/share
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc