diff options
Diffstat (limited to 'office/pandoc-bin/pandoc-bin.SlackBuild')
-rw-r--r-- | office/pandoc-bin/pandoc-bin.SlackBuild | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/office/pandoc-bin/pandoc-bin.SlackBuild b/office/pandoc-bin/pandoc-bin.SlackBuild index 602715abc2..aa0398a01f 100644 --- a/office/pandoc-bin/pandoc-bin.SlackBuild +++ b/office/pandoc-bin/pandoc-bin.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for pandoc-bin -# Copyright 2019 Andrew Payne <phalange@komputermatrix.com> +# Copyright 2019-2024 Andrew Payne <phalange@komputermatrix.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,13 +22,14 @@ # 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) + PRGNAM=pandoc-bin SRCNAM=pandoc -VERSION=${VERSION:-2.9.1} +VERSION=${VERSION:-3.1.12.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} - -set -e +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -38,43 +39,55 @@ if [ -z "$ARCH" ]; then esac fi -if [ "$ARCH" = "x86_64" ]; then - BIT="64bit" -else - echo "$ARCH is not supported." - exit 1 +# 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 "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 fi TMP=${TMP:-/tmp/SBo} -CWD=$(pwd) 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 $OUTPUT -cd $TMP -rm -rf $SRCNAM-$VERSION -tar xvf $CWD/$SRCNAM-$VERSION-linux-amd64.tar.gz -cd $SRCNAM-$VERSION +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 \ -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 {} \; -rm -rf $PKG -mkdir -p $PKG/usr/ -cp -r bin $PKG/usr/ -cp -r share/man $PKG/usr/ +mkdir -p $PKG/opt/$PRGNAM +mv usr/bin/pandoc $PKG/opt/$PRGNAM +rm usr/bin/{pandoc-lua,pandoc-server} +ln -s /opt/$PRGNAM/pandoc $PKG/usr/bin/pandoc +ln -s /opt/$PRGNAM/pandoc $PKG/usr/bin/pandoc-lua +ln -s /opt/$PRGNAM/pandoc $PKG/usr/bin/pandoc-server -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/ -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +mv usr/share/man $PKG/usr/ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM-bin.SlackBuild +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +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 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 |