diff options
author | Hexxend <hexxend@protonmail.com> | 2019-03-01 07:15:58 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-03-01 07:15:58 +0700 |
commit | 9545541a186fe588cc104adccd99efe163b27e6f (patch) | |
tree | 6263a27353705008802120cc3c9a67f4926df238 /system/quake-par/quake-par.SlackBuild | |
parent | 2579a9119c2c7ad9e9c4cabac3ab68cd03a7c48a (diff) | |
download | slackbuilds-9545541a186fe588cc104adccd99efe163b27e6f.tar.gz |
system/quake-par: Added (Quake archiver).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/quake-par/quake-par.SlackBuild')
-rw-r--r-- | system/quake-par/quake-par.SlackBuild | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/system/quake-par/quake-par.SlackBuild b/system/quake-par/quake-par.SlackBuild new file mode 100644 index 0000000000..84d0fd6958 --- /dev/null +++ b/system/quake-par/quake-par.SlackBuild @@ -0,0 +1,112 @@ +#!/bin/sh + +# Slackware build script for quake-par + +# Copyright 2019 Hexxend, 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. + +PRGNAM=quake-par +SRCNAME=par +VERSION=${VERSION:-0.03.01} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +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 -e + +rm -rf $PKG +mkdir -p $TMP $PKG/{'usr/bin','usr/man/man1'} $OUTPUT +cd $TMP +rm -rf $SRCNAME-$VERSION +tar xvf $CWD/$SRCNAME-$VERSION.tar.gz +cd $SRCNAME-$VERSION +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 {} \; + +sed -i "s|usr/local|usr|g" Makefile.Linux + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --mandir=/usr/man \ + --build=$ARCH-slackware-linux + +make + +sed -i '41,42 s/$(PRG)/quake-par/' Makefile +sed -i 's/$(INSTALLDIR_BIN)/$(DESTDIR)$(INSTALLDIR_BIN)/g' Makefile +sed -i 's/$(INSTALLDIR_MAN)/$(DESTDIR)$(INSTALLDIR_MAN)/g' Makefile +sed -i 's/rm -f $(PRG) $(PRG).$(MAN_NO) header.h mkmkman mkman* all install/rm -f quake-par quake-par.$(MAN_NO) $(PRG) $(PRG).$(MAN_NO) header.h mkmkman mkman* all install/' Makefile + +mv $SRCNAME $PRGNAM +mv $SRCNAME.1 $PRGNAM.1 + +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man/man1 -type l ) ; do ln -s $( readlink $i ).gz $i.gz \ + ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $TMP/$SRCNAME-$VERSION/README > $PKG/usr/doc/$PRGNAM-$VERSION/README +cat $TMP/$SRCNAME-$VERSION/pak-format.txt > \ + $PKG/usr/doc/$PRGNAM-$VERSION/pak-format.txt +cat $TMP/$SRCNAME-$VERSION/COPYING > $PKG/usr/doc/$PRGNAM-$VERSION/COPYING + +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} |