summaryrefslogtreecommitdiff
path: root/libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild')
-rw-r--r--libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild39
1 files changed, 28 insertions, 11 deletions
diff --git a/libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild b/libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild
index 6897a61a4d..913da8eae9 100644
--- a/libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild
+++ b/libraries/OpenSceneGraph/OpenSceneGraph.SlackBuild
@@ -2,15 +2,14 @@
# Slackware build script for OpenSceneGraph
-# Written by Aleksandar B. Samardzic (<asamardzic@matf.bg.ac.yu>)
-
-set -e
+# Written by Aleksandar Samardzic <asamardzic@gmail.com>
PRGNAM=OpenSceneGraph
-VERSION=2.2.0
+VERSION=${VERSION:-2.8.0}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -18,10 +17,17 @@ OUTPUT=${OUTPUT:-/tmp}
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
cd $TMP
@@ -29,21 +35,32 @@ rm -rf $PRGNAM-$VERSION
unzip $CWD/$PRGNAM-$VERSION.zip
cd $PRGNAM-$VERSION
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
+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 {} \;
+
+cmake \
+ -DCMAKE_C_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DCMAKE_INSTALL_PREFIX=/usr
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-cmake -DCMAKE_INSTALL_PREFIX=/usr .
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
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null || true
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS.txt ChangeLog LICENSE.txt NEWS.txt README.txt $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ AUTHORS.txt ChangeLog LICENSE.txt NEWS.txt README.txt \
+ $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install