summaryrefslogtreecommitdiffstats
path: root/ham/klog/klog.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'ham/klog/klog.SlackBuild')
-rw-r--r--ham/klog/klog.SlackBuild46
1 files changed, 27 insertions, 19 deletions
diff --git a/ham/klog/klog.SlackBuild b/ham/klog/klog.SlackBuild
index 901b97ae0c..ed669217a9 100644
--- a/ham/klog/klog.SlackBuild
+++ b/ham/klog/klog.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackbuild for klog
# Written by JK Wood <joshuakwood@gmail.com>
@@ -20,10 +20,13 @@
# see fit. Or as I see fit. Or as I fit. Although
# that is unlikely, as I am rather tall.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=klog
-VERSION=${VERSION:-0.9.1.1}
+VERSION=${VERSION:-1.8.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -33,7 +36,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}
@@ -58,7 +68,11 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
+TARBALL="$CWD/$VERSION.tar.gz"
+if [ ! -e "$TARBALL" ] ; then
+ TARBALL="$CWD/$PRGNAM-$VERSION.tar.gz"
+fi
+tar -xvf $TARBALL
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@@ -69,25 +83,19 @@ find -L . \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-qmake PREFIX=/usr klog.pro
+qmake-qt5 PREFIX=$PKG/usr KLog.pro
make
+make install DESTDIR=$PKG
-# Somewhere after 0.6.2 the developers
-# broke the install target. We'll do
-# it live!
-
-mkdir -p $PKG/usr/bin
-install -m 755 klog $PKG/usr/bin/
+# this seems purposeless
+rm -r $PKG/usr/share/klog
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
mkdir -p $PKG/usr/man/man1
-cat klog.1 > $PKG/usr/man/man1/klog.1
-
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+gzip -9c src/klog.1 > $PKG/usr/man/man1/klog.1.gz
mkdir -p $PKG/usr/share/applications
cat $CWD/klog.desktop > $PKG/usr/share/applications/klog.desktop
@@ -98,15 +106,15 @@ cat $CWD/klog16x16.png > $PKG/usr/share/icons/locolor/16x16/apps/klog.png
cat $CWD/klog32x32.png > $PKG/usr/share/icons/locolor/32x32/apps/klog.png
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS COPYING Changelog INSTALL.txt INSTALL-linux NEWS README TODO \
+for doc in AUTHORS COPYING Changelog NEWS README TODO; do
+ cp -a "src/$doc" \
$PKG/usr/doc/$PRGNAM-$VERSION
+done
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-find $PKG/usr/doc -name "Makefile" -exec rm {} \;
-find $PKG/usr/doc -type f -exec chmod 644 {} \;
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:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE