|
|
@ -2,30 +2,20 @@ |
|
|
|
|
|
|
|
# Slackware build script for ECWolf |
|
|
|
|
|
|
|
# Copyright 2016-2017 Hunter Sezen California, USA |
|
|
|
# All rights reserved. |
|
|
|
# |
|
|
|
# Redistribution and use of this script, with or without modification, is |
|
|
|
# permitted provided that the following conditions are met: |
|
|
|
# |
|
|
|
# 1. Redistributions of this script must retain the above copyright |
|
|
|
# notice, this list of conditions and the following disclaimer. |
|
|
|
# |
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED |
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
# Original author: Hunter Sezen. |
|
|
|
# Modified and now maintained by B. Watson <urchlay@slackware.uk>. |
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. |
|
|
|
|
|
|
|
# 20240904 bkw: |
|
|
|
# - new maintainer. |
|
|
|
# - update for v1.4.1. |
|
|
|
# - new version has .desktop and icon, so add doinst.sh. |
|
|
|
|
|
|
|
cd $(dirname $0) ; CWD=$(pwd) |
|
|
|
|
|
|
|
PRGNAM=ecwolf |
|
|
|
VERSION=${VERSION:-1.3.3} |
|
|
|
VERSION=${VERSION:-1.4.1} |
|
|
|
BUILD=${BUILD:-1} |
|
|
|
TAG=${TAG:-_SBo} |
|
|
|
PKGTYPE=${PKGTYPE:-tgz} |
|
|
@ -38,9 +28,6 @@ if [ -z "$ARCH" ]; then |
|
|
|
esac |
|
|
|
fi |
|
|
|
|
|
|
|
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what |
|
|
|
# the name of the created package would be, and then exit. This information |
|
|
|
# could be useful to other scripts. |
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then |
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" |
|
|
|
exit 0 |
|
|
@ -52,19 +39,15 @@ OUTPUT=${OUTPUT:-/tmp} |
|
|
|
|
|
|
|
if [ "$ARCH" = "i586" ]; then |
|
|
|
SLKCFLAGS="-O2 -march=i586 -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 -eu |
|
|
|
set -e |
|
|
|
|
|
|
|
rm -rf $PKG |
|
|
|
mkdir -p $TMP $PKG $OUTPUT |
|
|
@ -73,17 +56,8 @@ rm -rf $PRGNAM-$VERSION-src |
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION-src.tar.xz |
|
|
|
cd $PRGNAM-$VERSION-src |
|
|
|
chown -R root:root . |
|
|
|
find -L . \ |
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ |
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \ |
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ |
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; |
|
|
|
|
|
|
|
# data dir hack (From AUR) |
|
|
|
sed -e 's|OpenResourceFile(datawad|OpenResourceFile("/usr/share/games/ecwolf/ecwolf.pk3"|' \ |
|
|
|
-e 's|Push(datawad|Push("/usr/share/games/ecwolf/ecwolf.pk3"|' \ |
|
|
|
-e 's|/usr/local/share/games/wolf3d|/usr/share/games/wolf3d|' \ |
|
|
|
-i src/wl_iwad.cpp |
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ |
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + |
|
|
|
|
|
|
|
mkdir -p build |
|
|
|
cd build |
|
|
@ -91,26 +65,30 @@ cd build |
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ |
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ |
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \ |
|
|
|
-DBUILD_PATCHUTIL=ON \ |
|
|
|
-DCMAKE_INSTALL_MANDIR=man \ |
|
|
|
-DCMAKE_INSTALL_DOCDIR=doc/$PRGNAM-$VERSION \ |
|
|
|
-Wno-dev \ |
|
|
|
-DCMAKE_BUILD_TYPE=Release .. |
|
|
|
make |
|
|
|
make install DESTDIR=$PKG |
|
|
|
install -m0755 tools/patchutil/patchutil $PKG/usr/bin/$PRGNAM-patchutil |
|
|
|
make install/strip DESTDIR=$PKG |
|
|
|
install -Dm0644 $PRGNAM.pk3 $PKG/usr/share/games/$PRGNAM/$PRGNAM.pk3 |
|
|
|
cd .. |
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/games/wolf3d |
|
|
|
gzip -9 $PKG/usr/man/man*/* |
|
|
|
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ |
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true |
|
|
|
# 20240904 bkw: empty dir for the data files. |
|
|
|
mkdir -p $PKG/usr/share/games/wolf3d |
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION |
|
|
|
cp -a README.md docs/*.txt $PKG/usr/doc/$PRGNAM-$VERSION |
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild |
|
|
|
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION |
|
|
|
mkdir -p $PKGDOC |
|
|
|
mv $PKG/usr/share/doc/$PRGNAM/* $PKGDOC |
|
|
|
rm -rf $PKG/usr/share/doc |
|
|
|
cp -a README.md docs/*.txt $PKGDOC |
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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 |