diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2022-02-18 12:25:18 +1300 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-02-19 12:10:40 +0700 |
commit | b933c905c2486b640c9d6120d37c74da10ba2eff (patch) | |
tree | 0c02f12e6cdd823a6508fc39a93bea4c53f330ff /office | |
parent | c49e404718558bbb9f43d2d167fa3066ee76294d (diff) |
office/pandoc-bin: Fix BUILD usage.
* do not write to (or mv into or from) CWD
* BUILD is users of the script, not upstream build numbers
* align to DEBARCH usage etc of other SBo scripts
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office')
-rw-r--r-- | office/pandoc-bin/pandoc-bin.SlackBuild | 42 |
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 |