All pastes #1526896 Raw Edit

Something

public text v1 · immutable
#1526896 ·published 2009-08-12 18:42 UTC
rendered paste body
#!/bin/sh

# Slackware build script for kicad
# Written by antiwire <antiwire at gmail dot com>
# Cmake style build script ideas gleamed from B. Watson (Urchlay)

# Do what you will with this script but give credit where credit is due.
# No warranty exists for use of the script.

PRGNAM=kicad
VERSION=${VERSION:-2009-02-16}
SRC_VERSION=${SRC_VERSION:-sources-2009-02-16}
PKG_VERSION=${PKG_VERSION:-20090216}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_ANTI}

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"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
fi

set -e

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

mkdir -p build$TAG
cd build$TAG
cmake .. -DCMAKE_INSTALL_PREFIX:STRING=/usr

make
make install DESTDIR=$PKG

mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERSION
cp ../{AUTHORS.txt,CHANGELOG.txt,COMPILING.txt,INSTALL.txt,TODO.txt,UIpolicies.txt,version.txt} $PKG/usr/doc/$PRGNAM-$PKG_VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERSION/$PRGNAM.SlackBuild
cat $CWD/README.SBo > $PKG/usr/doc/$PRGNAM-$PKG_VERSION/README.SBo
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$PKG_VERSION/README

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

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