diff options
Diffstat (limited to 'office/zim/zim.SlackBuild')
-rw-r--r-- | office/zim/zim.SlackBuild | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/office/zim/zim.SlackBuild b/office/zim/zim.SlackBuild index 7f21085fbc..27b2c1205c 100644 --- a/office/zim/zim.SlackBuild +++ b/office/zim/zim.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for zim -# Copyright 2019-2020 Andrew Payne <phalange@komputermatrix.com> +# Copyright 2019-2022 Andrew Payne <phalange@komputermatrix.com> # Copyright 2015-2017 Brenton Earl <brent@exitstatusone.com> # Copyright 2013 Michael Ren <micron33@gmail.com> # All rights reserved. @@ -24,10 +24,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=zim -VERSION=${VERSION:-0.73.3} +SRCNAM=desktop-wiki +VERSION=${VERSION:-0.75.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -37,25 +41,22 @@ if [ -z "$ARCH" ]; then esac fi -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 "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -DOCS="CHANGELOG.md CONTRIBUTING.md LICENSE PLUGIN_WRITING.md README.md" - -if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" +# Abort build if architecture is not 64-bit. +if [ "$ARCH" != "x86_64" ]; then + echo "$ARCH is not supported." + exit 1 fi set -e @@ -64,8 +65,16 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -cd $PRGNAM-$VERSION + +# some scripts pull down the tarball with a truncated name +if [ -f $CWD/$VERSION.tar.gz ] +then + tar xvf $CWD/$VERSION.tar.gz +else + tar xvf $CWD/$PRGNAM-$SRCNAM-$VERSION.tar.gz +fi + +cd $PRGNAM-$SRCNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -87,7 +96,8 @@ mkdir -p $PKG/usr/share/icons cp -r xdg/hicolor/ $PKG/usr/share/icons/ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cp -a {CHANGELOG.md,CONTRIBUTING.md,LICENSE,PLUGIN_WRITING.md,README.md} \ + $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install @@ -95,4 +105,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh 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 |