summaryrefslogtreecommitdiff
path: root/graphics/leocad/leocad.SlackBuild
diff options
context:
space:
mode:
authorNiels Horn <niels.horn@gmail.com>2010-06-12 15:55:37 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-06-12 22:14:27 -0500
commitcfc09bb4a6031b8ab1cc0a7de58b465ae78e3f67 (patch)
treece5edd851b911f020e3f5ac855393eb663ce4525 /graphics/leocad/leocad.SlackBuild
parenta8c6d3606a7b28e758ca42a55dbcb9d1b80449d1 (diff)
downloadslackbuilds-cfc09bb4a6031b8ab1cc0a7de58b465ae78e3f67.tar.gz
graphics/leocad: Added (CAD program for lego-like bricks)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'graphics/leocad/leocad.SlackBuild')
-rw-r--r--graphics/leocad/leocad.SlackBuild81
1 files changed, 81 insertions, 0 deletions
diff --git a/graphics/leocad/leocad.SlackBuild b/graphics/leocad/leocad.SlackBuild
new file mode 100644
index 0000000000..472f6e1ea6
--- /dev/null
+++ b/graphics/leocad/leocad.SlackBuild
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# Slackware build script for LeoCAD:
+# 3D design program for bricks
+
+# Written by Niels Horn <niels.horn@gmail.com>
+# revision date 2010/05/27
+
+PRGNAM=leocad
+VERSION=${VERSION:-0.75_r949}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+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"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $TMP/$PRGNAM-$VERSION $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+make config PREFIX=/usr DESTDIR=$PKG
+CFLAGS="$SLKCFLAGS" CPPFLAGS="$SLKCFLAGS" make
+make install
+
+strip --strip-unneeded $PKG/usr/bin/$PRGNAM
+
+# Move & Compress man pages
+mv $PKG/usr/share/man $PKG/usr/man
+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
+
+# Copy icon & desktop file to package
+mkdir -p $PKG/usr/share/{applications,pixmaps}
+cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
+cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ CREDITS.txt README.txt docs/CHANGES.txt docs/COPYING.txt docs/INSTALL.txt \
+ docs/LINUX.txt docs/TODO.txt $PKG/usr/doc/$PRGNAM-$VERSION
+find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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:-tgz}