summaryrefslogtreecommitdiffstats
path: root/office/ghostwriter/ghostwriter.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'office/ghostwriter/ghostwriter.SlackBuild')
-rw-r--r--office/ghostwriter/ghostwriter.SlackBuild49
1 files changed, 30 insertions, 19 deletions
diff --git a/office/ghostwriter/ghostwriter.SlackBuild b/office/ghostwriter/ghostwriter.SlackBuild
index 5abab5fafe..4a94191878 100644
--- a/office/ghostwriter/ghostwriter.SlackBuild
+++ b/office/ghostwriter/ghostwriter.SlackBuild
@@ -1,8 +1,9 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for ghostwriter
-# Copyright 2020 Andrzej Telszewski, Szczecin
+# Copyright 2022 Andrew Payne <phalange@komputermatrix.com>
+# Copyright 2021 Andrzej Telszewski, Szczecin
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,10 +23,13 @@
# 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=ghostwriter
-VERSION=${VERSION:-1.8.1}
+VERSION=${VERSION:-2.1.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +39,14 @@ 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}
@@ -59,33 +70,33 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
-
chown -R root:root .
-chmod -R a-st,u+rwX,go-w+rX .
-
-# Adjust docs location.
-
-sed -i $PRGNAM.pro -e "s|man\.path.*$|man.path = /usr/man/man1|"
+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 {} \;
-qmake-qt5 -r $PRGNAM.pro \
- QMAKE_CFLAGS="$SLKCFLAGS" \
- QMAKE_CXXFLAGS="$SLKCFLAGS" \
+qmake-qt5 \
PREFIX=/usr
make
make install INSTALL_ROOT=$PKG
+cd ..
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-gzip -9 $PKG/usr/man/man1/$PRGNAM.1
+mv $PKG/usr/share/man $PKG/usr/
+find $PKG/usr/man/man1 -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man/man1 -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a {BUILD_MAC,CHANGELOG,CREDITS,README}.md COPYING $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $TMP/$PRGNAM-$VERSION/{CHANGELOG.md,CONTRIBUTING.md,COPYING,CREDITS.md,README.md} \
+ $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
@@ -93,4 +104,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