slackbuilds/y/REminiscence_FlashBack/SlackBuild

142 lines
3.7 KiB
Text
Raw Normal View History

2021-06-15 10:26:26 +02:00
#!/bin/bash
2011-02-17 06:25:23 +01:00
# --- INIT ---
# Set initial variables:
CWD=`pwd`
if [ "$TMP" = "" ]; then
2020-06-25 11:23:11 +02:00
TAG=gwh
2011-02-17 06:25:23 +01:00
OUTPUT=/tmp
TMP=/tmp/$TAG
fi
PRGNAM=REminiscence
2019-01-26 14:16:43 +01:00
VERSION=0.3.7
2011-02-17 06:25:23 +01:00
ARCH=${ARCH:-$(uname -m)}
BUILD=1
2022-01-22 19:52:02 +01:00
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
mkdir -p $REPOSITORY
2011-02-17 06:25:23 +01:00
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mtune=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
PKG=$TMP/pkg-$PRGNAM
# --- PACKAGE BUILDING ---
echo "++"
echo "|| $PRGNAM-$VERSION"
echo "++"
rm -rf $PKG $TMP/${PRGNAM}-${VERSION}
cd $TMP
# --- TARBALL EXTRACTION,PATCH,MODIFY ---
[ ! -e $REPOSITORY/${PRGNAM}-${VERSION}.tar.bz2 ] && wget -c -O $REPOSITORY/${PRGNAM}-${VERSION}.tar.bz2 http://cyxdown.free.fr/reminiscence/REminiscence-${VERSION}.tar.bz2
[ ! -e $REPOSITORY/flashback-x86_64.tar.gz ] & wget -c -O $REPOSITORY/flashback-x86_64.tar.gz https://lutris.net/files/games/flashback/flashback-x86_64.tar.gz
2011-02-17 06:25:23 +01:00
echo "Extracting the program tarball for $PRGNAM..."
tar xf $REPOSITORY/${PRGNAM}-${VERSION}.tar.bz2
2011-02-17 06:25:23 +01:00
cd ${PRGNAM}-${VERSION}
chown -R root.root *
find . -perm 777 -exec chmod 755 {} \;
zcat $REPOSITORY/nices_path.patch.gz | patch -p1
#zcat $REPOSITORY/bad_crc.diff.gz | patch -p1
2011-02-17 06:25:23 +01:00
# --- BUILDING ---
echo Building ...
CFLAGS="$SLKCFLAGS" \
make
#
# Install all the needed stuff to the package dir
#
2019-01-26 14:16:43 +01:00
mkdir -p $PKG/usr/games $PKG/usr/share/games/ $PKG/var/lib/$PRGNAM
2011-02-17 06:25:23 +01:00
mv rs $PKG/usr/games/
2019-01-26 14:16:43 +01:00
cd $PKG/usr/games/
ln -s rs REminiscence
ln -s rs flashback
2011-02-17 06:25:23 +01:00
2019-01-26 14:16:43 +01:00
cd $PKG/usr/share/games/
tar xf $REPOSITORY/flashback-x86_64.tar.gz # jeu lui-m<>me
2019-01-26 14:16:43 +01:00
mv flashback $PRGNAM
2011-02-17 06:25:23 +01:00
mkdir -p $PKG/usr/share/pixmaps
cp $REPOSITORY/flashback.png $PKG/usr/share/pixmaps
2011-02-17 06:25:23 +01:00
# --- DOCUMENTATION ---
cd $TMP/${PRGNAM}-${VERSION}
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
2019-01-26 14:16:43 +01:00
cp -a README.txt $PKG/usr/doc/$PRGNAM-$VERSION
2011-02-17 06:25:23 +01:00
chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
# Compress the man page(s)
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
# Strip binaries
2019-01-26 14:16:43 +01:00
find $PKG | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find $PKG | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
2011-02-17 06:25:23 +01:00
# --- OWNERSHIP, RIGHTS ---
chmod -R o-w $PKG
chown -R root:root $PKG/*
chmod a+rwx $PKG/var/lib/REminiscence
# --- PACKAGE DESCRIPTION ---
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
${PRGNAM}: ${PRGNAM} (Flashback game engine)
${PRGNAM}:
${PRGNAM}: ${PRGNAM} is a re-implementation of the engine used in the game
${PRGNAM}: Flashback made by Delphine Software and released in 1992.
2019-01-26 14:16:43 +01:00
${PRGNAM}:
2011-02-17 06:25:23 +01:00
${PRGNAM}: You will need the original files.
2019-01-26 14:16:43 +01:00
${PRGNAM}:
2011-02-17 06:25:23 +01:00
${PRGNAM}: Original files included.
2019-01-26 14:16:43 +01:00
${PRGNAM}:
2011-02-17 06:25:23 +01:00
${PRGNAM}: see /usr/doc/${PRGNAM}-${VERSION} for more.
2019-01-26 14:16:43 +01:00
${PRGNAM}: http://cyxdown.free.fr/reminiscence/
2011-02-17 06:25:23 +01:00
EOF
# --- BUILDING ---
# Build the package:
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
2020-07-12 09:22:26 +02:00
/sbin/makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}$TAG.txz
2011-02-17 06:25:23 +01:00
# --- CLEANUP ---
# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP/tmp-$PRGNAM
rm -rf $PKG
fi