aboutsummaryrefslogtreecommitdiff
path: root/office/kchmviewer/kchmviewer.SlackBuild
diff options
context:
space:
mode:
authorMichiel van Wessem <michiel@slackbuilds.org>2010-05-13 00:39:15 +0200
committerErik Hanson <erik@slackbuilds.org>2010-05-13 00:39:15 +0200
commit564acca38a6a24e8b3233e98accdc21ad6c18a93 (patch)
treea797059c064a476c4e1d8576a145b827b56b4283 /office/kchmviewer/kchmviewer.SlackBuild
parent0932f518b5e61e09bfc492bf4ec315ff87220db5 (diff)
office/kchmviewer: Updated for version 5.1
Diffstat (limited to 'office/kchmviewer/kchmviewer.SlackBuild')
-rw-r--r--office/kchmviewer/kchmviewer.SlackBuild74
1 files changed, 49 insertions, 25 deletions
diff --git a/office/kchmviewer/kchmviewer.SlackBuild b/office/kchmviewer/kchmviewer.SlackBuild
index d7f43922e1b1d..af325fd066f25 100644
--- a/office/kchmviewer/kchmviewer.SlackBuild
+++ b/office/kchmviewer/kchmviewer.SlackBuild
@@ -1,51 +1,75 @@
#!/bin/sh
#
# SlackBuild script for KchmViewer.
-# Written by Michiel van Wessem (BP{k}) <michiel@slackbuilds.org>
-# Modified by the SlackBuilds.org project
+# Copyright 2007-2009 Michiel van Wessem, Manchester, United Kingdom
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=kchmviewer
-VERSION=3.1 #
-SRCVER=3.1-2 # yes, kchmviewer is really that weird :\
-PKGVER=3.1.2 #
+VERSION=${VERSION:-5.1}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-DOCFILES="COPYING ChangeLog DCOP-bindings README FAQ "
-
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
rm -rf $TMP/$PRGNAM-$VERSION
-cd $TMP || exit 1
-tar -xzvf $CWD/$PRGNAM-$SRCVER.tar.gz || exit 1
-cd $PRGNAM-$VERSION || exit 1
+cd $TMP
+tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd build-$VERSION
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
-
-KDEPREF=$(kde-config --prefix)
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure --prefix=$KDEPREF \
- --disable-debug \
- --with-kde \
- --program-prefix="" \
- --program-suffix="" \
- || exit 1
+cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DCMAKE_BUILD_TYPE=Release .
-make || exit 1
-make install DESTDIR=$PKG || exit 1
+make
+make install DESTDIR=$PKG
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
@@ -53,11 +77,11 @@ make install DESTDIR=$PKG || exit 1
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING ChangeLog DBUS-bindings FAQ README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}