2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2013-02-23 20:41:19 +01:00
|
|
|
|
|
|
|
# Slackware build script for trayer-srg
|
|
|
|
|
|
|
|
# Copyright 2013 Bojan Popovic Belgrade Serbia
|
|
|
|
# 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.
|
|
|
|
|
2014-12-09 02:11:13 +01:00
|
|
|
# Now maintained by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
2021-09-08 00:08:16 +02:00
|
|
|
# 20210907 bkw: BUILD=2, spelling/grammar fixes in docs.
|
2018-06-16 07:21:39 +02:00
|
|
|
# 20180612 bkw: updated for v1.1.8.
|
2017-07-08 19:57:59 +02:00
|
|
|
# 20170708 bkw:
|
|
|
|
# - updated for v1.1.7.
|
|
|
|
# - stop installing INSTALL in doc dir.
|
|
|
|
|
|
|
|
# 20170122 bkw:
|
|
|
|
# - updated for latest git.
|
|
|
|
|
2015-01-13 00:24:13 +01:00
|
|
|
# 20150111 bkw:
|
|
|
|
# - Updated for latest git. Switching from git hash as version number to the
|
|
|
|
# date of the last commit as found by 'git log'. At least you can compare
|
|
|
|
# dates just by looking at them.
|
2017-07-08 19:57:59 +02:00
|
|
|
# - Upstream now uses a (non-autotools) ./configure script.
|
2017-01-22 06:21:03 +01:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2013-02-23 20:41:19 +01:00
|
|
|
PRGNAM=trayer-srg
|
2018-06-16 07:21:39 +02:00
|
|
|
VERSION=${VERSION:-1.1.8}
|
2021-09-08 00:08:16 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2013-02-23 20:41:19 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2013-02-23 20:41:19 +01:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
2014-12-09 02:11:13 +01:00
|
|
|
case "$( uname -m )" in
|
2016-08-19 11:04:32 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2014-12-09 02:11:13 +01:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
2013-02-23 20:41:19 +01:00
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2013-02-23 20:41:19 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-19 11:04:32 +02:00
|
|
|
if [ "$ARCH" = "i586" ];then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2013-02-23 20:41:19 +01:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ];then
|
2016-01-16 17:01:57 +01:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2013-02-23 20:41:19 +01:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-07-08 19:57:59 +02:00
|
|
|
#TARNAM="${PRGNAM}-trayer" # for old versions
|
|
|
|
TARNAM="${PRGNAM}-trayer"
|
|
|
|
|
2013-02-23 20:41:19 +01:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
|
|
|
|
cd $TMP
|
2017-07-08 19:57:59 +02:00
|
|
|
rm -rf $TARNAM-$VERSION
|
|
|
|
tar xvf $CWD/$TARNAM-$VERSION.tar.?z*
|
|
|
|
cd $TARNAM-$VERSION
|
2013-02-23 20:41:19 +01:00
|
|
|
chown -R root:root .
|
2021-09-08 00:08:16 +02:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
|
|
|
|
|
|
|
patch -p1 < $CWD/spelling_grammar_fixes.diff
|
2013-02-23 20:41:19 +01:00
|
|
|
|
2021-09-08 00:08:16 +02:00
|
|
|
# not a real (autotools) configure script, notice non-canonical use
|
|
|
|
# of --prefix here!
|
2015-01-13 00:24:13 +01:00
|
|
|
./configure --prefix=/usr/bin
|
2013-02-23 20:41:19 +01:00
|
|
|
CFLAGS="$SLKCFLAGS" make # This will also strip the executable
|
|
|
|
|
|
|
|
# Instead of patching the Makefile, let's install it manually:
|
|
|
|
mkdir -p $PKG/usr/bin
|
|
|
|
install -m 0755 trayer $PKG/usr/bin
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/man/man1
|
2013-11-22 08:34:22 +01:00
|
|
|
gzip -c man/trayer.1 > $PKG/usr/man/man1/trayer.1.gz
|
2013-02-23 20:41:19 +01:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2017-07-08 19:57:59 +02:00
|
|
|
cp -a CHANGELOG COPYING CREDITS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
|
2013-02-23 20:41:19 +01:00
|
|
|
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
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|