Rogue Class Linux Download Login

Artifact Content

Artifact 7e07844d94f747f7a10d3f18a0f8d0737c9ceb9e:


#!/bin/sh -e

PRGNAM=ivan
VERSION=${VERSION:-0.50}
BUILD=${BUILD:-1}
TAG=${TAG:-}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

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

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-g -O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-g -O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-g -O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
patch -b -p0 <$CWD/patches/bitmap.cpp.diff
patch -b -p0 <$CWD/patches/char.h.diff
patch -b -p0 <$CWD/patches/command.cpp.diff
patch -b -p0 <$CWD/patches/fearray.h.diff
patch -b -p0 <$CWD/patches/feio.cpp.diff
patch -b -p0 <$CWD/patches/festring.cpp.diff
patch -b -p0 <$CWD/patches/fetime.cpp.diff
patch -b -p0 <$CWD/patches/fluid.cpp.diff
patch -b -p0 <$CWD/patches/game.cpp.diff
patch -b -p0 <$CWD/patches/graphics.cpp.diff
patch -b -p0 <$CWD/patches/graphics.h.diff
patch -b -p0 <$CWD/patches/human.h.diff
patch -b -p0 <$CWD/patches/lsquare.cpp.diff
patch -b -p0 <$CWD/patches/lsquare.h.diff
patch -b -p0 <$CWD/patches/lterras.cpp.diff
patch -b -p0 <$CWD/patches/Makefile.in.diff
patch -b -p0 <$CWD/patches/save.h.diff
patch -b -p0 <$CWD/patches/script.cpp.diff
patch -b -p0 <$CWD/patches/stack.h.diff
patch -b -p0 <$CWD/patches/whandler.cpp.diff

cd $PRGNAM-$VERSION

chown -R root:root .
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 {} \;

export CXXFLAGS="$SLKFLAGS -fpermissive"
export LDFLAGS=-lvjk
find . -name Makefile.in -exec sed -i -e "s|^DESTDIR =$|& \"$PKG\"|" {} \;
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
make
make install

mkdir -p $PKG/etc/skel/settings
cp $CWD/ivan-vjk.txt $PKG/etc/skel/settings/

mkdir -p $PKG/usr/share/applications
cp $CWD/ivan.desktop $PKG/usr/share/applications/

mkdir -p $PKG/usr/share/pixmaps
cp $CWD/ivan.png $PKG/usr/share/pixmaps/

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp AUTHORS COPYING ChangeLog NEWS README $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/readme-rcl.txt $PKG/usr/doc/$PRGNAM-$VERSION/
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

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.${PKGTYPE:-tgz}