summaryrefslogblamecommitdiffstats
path: root/office/wordtsar/wordtsar.SlackBuild
blob: 2508308004fd8038c1be7cc1306ee2ebe7bb99be (plain) (tree)

















































































                                                                                      
#!/bin/bash

# Slackware build script for wordtsar

# Written by B. Watson (urchlay@slackware.uk)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# Note: building.txt appears to be horribly out of date; it refers
# to wxWidgets and CodeLite... but this is a Qt app, built with
# qmake. *shrug*.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=wordtsar
SRCNAM=WordTsar
VERSION=${VERSION:-0.3.719}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

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}

# no flags or libdir stuffs here, qmake knows what to do.

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION-src
unzip $CWD/$SRCNAM-$VERSION-src.zip
cd $SRCNAM-$VERSION-src
chown -R root:root .
find -L .  -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
        \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+

# weirdness, refers to ../src/<whatever>
sed -i.bak 's,\.\./,,g' *.pro

qmake-qt5
make

# no 'make install'.
mkdir -p $PKG/usr/{bin,share/{applications,pixmaps}}
install -s -m0755 $SRCNAM $PKG/usr/bin
install -m0644 linuxdeploy/$SRCNAM.desktop $PKG/usr/share/applications/$SRCNAM.desktop

for px in 16 22 32 48 64 128; do
  sz=${px}x${px}
  dir=$PKG/usr/share/icons/hicolor/$sz/apps
  mkdir -p $dir
  convert -resize $sz linuxdeploy/$PRGNAM.png $dir/$PRGNAM.png
done
ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png

PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a LICENSE* implemented.xlsx $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild

mkdir -p $PKG/install
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