aboutsummaryrefslogtreecommitdiff
path: root/graphics/xtrkcad/xtrkcad.SlackBuild
blob: fdb4ff6108301705f2fc7acd5fbdd088c80d56bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh

# Slackware build script for xtrkcad
# Written by David Spencer <nobbutl@yahoo.co.uk>
# This script is dedicated to the public domain

# Modified by Robby Workman <rworkman@slackbuilds.org>

PRGNAM=xtrkcad
VERSION=4.0.2
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM/app
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

make product VERBOSE=1 COPTS="$SLKCFLAGS"

mkdir -p $PKG/usr/lib/xtrkcad/params
cp -a lib/params/*.xtp $PKG/usr/lib/xtrkcad/params
cp -a lib/xtrkcad.{bug,enh,fix,upd,xtq} lib/logo.bmp bin/xtc64.xpm \
  help/xtrkcad.tip  $PKG/usr/lib/xtrkcad

mkdir -p $PKG/usr/bin
cp -a bin/xtrkcad $PKG/usr/bin
strip --strip-unneeded $PKG/usr/bin/xtrkcad

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/{examples,html,demos}
cp -a COPYING README bin/ChangeLog lib/aareadme.txt $PKG/usr/doc/$PRGNAM-$VERSION
cp -a lib/demos/*.xtr $PKG/usr/doc/$PRGNAM-$VERSION/demos
cp -a lib/examples/*.xtc $PKG/usr/doc/$PRGNAM-$VERSION/examples
cp -a doc/*.html doc/png.d/ doc/xtrkcad_lin.css $PKG/usr/doc/$PRGNAM-$VERSION/html
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# The package expects docs to be in /usr/lib/xtrkcad/$dir
cd $PKG/usr/lib/xtrkcad
  ln -s /usr/doc/$PRGNAM-$VERSION/examples .
  ln -s /usr/doc/$PRGNAM-$VERSION/html .
  ln -s /usr/doc/$PRGNAM-$VERSION/demos .
cd -

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz