slackbuilds/desktop/paginator/paginator.SlackBuild

88 lines
2.0 KiB
Bash

#!/bin/bash
# Slackware build script for paginator
# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# MLanden found this gem: a WindowMaker dockapp that was written this
# century! I probably will never use it, but it definitely is useful
# and should be on SBo.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=paginator
VERSION=${VERSION:-1.1.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
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 $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown root:root *
chmod 644 *
# there's only one commit past the v1.1.0 tag, and it actually does
# something important and useful, so include it.
patch -p1 < $CWD/0001-ignore-minimized-windows.patch
# _DEFAULT_SOURCE not really important for 15.0, but may be in the future.
# Also, get rid of -I and -L options, we don't need them.
sed -i -e 's/-D_GNU_SOURCE -D_BSD_SOURCE/-D_DEFAULT_SOURCE/' \
-e 's,-[IL][^ ]* , ,g' \
Makefile
make CFLAGS="$SLKCFLAGS"
strip $PRGNAM
make install DESTDIR=$PKG PREFIX=/usr MANPREFIX=/usr/man
gzip $PKG/usr/man/man1/*
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a LICENSE* README* $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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