2014-08-14 17:42:09 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for xli
|
|
|
|
|
2018-06-29 11:56:10 +02:00
|
|
|
# Copyright 2014 Leonard Schmidt <email removed>
|
2014-08-14 17:42:09 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any purpose
|
|
|
|
# with or without fee is hereby granted, provided that the above copyright
|
|
|
|
# notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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
|
|
|
|
# AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS 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.
|
|
|
|
|
2018-06-29 11:56:10 +02:00
|
|
|
# Now maintained by B. Watson <yalhcru@gmail.com>
|
|
|
|
|
|
|
|
# 20180629 bkw:
|
|
|
|
# - Take over maintenance.
|
|
|
|
# - BUILD=2.
|
|
|
|
# - Stop spamming /etc/X11/app-defaults and /usr/bin (!!)
|
|
|
|
# - Add -DHAVE_GUNZIP and -DHAVE_BUNZIP2 options, to support viewing
|
|
|
|
# compressed images.
|
|
|
|
# - Install xliguide.5 man page.
|
|
|
|
# - Make system-wide config file actually work as documented in the
|
|
|
|
# man page. Previous it was getting installed (straight to /etc, not
|
|
|
|
# as part of the package!) and totally ignored at runtime.
|
|
|
|
# - Include chkgamma.jpg in doc dir, since ABOUTGAMMA references it.
|
|
|
|
|
|
|
|
# TODO: find out why "-border" doesn't seem to work. The -fullscreen
|
|
|
|
# window border is always white, no matter what color you give to
|
|
|
|
# -border. I only moderately care about this, TBH.
|
|
|
|
|
2014-08-14 17:42:09 +02:00
|
|
|
PRGNAM=xli
|
|
|
|
VERSION=${VERSION:-1.17}
|
|
|
|
SRCVER=${SRCVER:-2005-02-27}
|
2018-06-29 11:56:10 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2014-08-14 17:42:09 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2018-06-16 00:28:50 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2014-08-14 17:42:09 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2018-06-16 00:28:50 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2014-08-14 17:42:09 +02:00
|
|
|
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-$SRCVER
|
|
|
|
tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
|
|
|
|
cd $PRGNAM-$SRCVER
|
|
|
|
chown -R root:root .
|
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
2018-06-29 11:56:10 +02:00
|
|
|
-o -perm 511 \) -exec chmod 755 {} \+ -o \
|
2014-08-14 17:42:09 +02:00
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
2018-06-29 11:56:10 +02:00
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
|
2014-08-14 17:42:09 +02:00
|
|
|
|
|
|
|
# These patches are from NetBSD's pkgsrc:
|
|
|
|
# <http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/graphics/xli/patches/?only_with_tag=MAIN>
|
|
|
|
for i in c d e f g h; do
|
|
|
|
patch -p0 < $CWD/patch-a${i}
|
|
|
|
done
|
|
|
|
|
2018-06-29 11:56:10 +02:00
|
|
|
# 20180629 bkw: Seems we have to explicitly define the system-wide
|
|
|
|
# config file in CCOPTIONS. Might as well add .gz and .bz2 support,
|
|
|
|
# while we're at it.
|
|
|
|
APPDEF=/etc/X11/app-defaults/Xli
|
2014-08-14 17:42:09 +02:00
|
|
|
xmkmf -a
|
2018-06-29 11:56:10 +02:00
|
|
|
make \
|
|
|
|
CDEBUGFLAGS="$SLKCFLAGS" \
|
|
|
|
CCOPTIONS="-DHAVE_GUNZIP -DHAVE_BUNZIP2 -DSYSPATHFILE=\\\"$APPDEF\\\""
|
|
|
|
|
|
|
|
# 20180629 bkw: Do not use 'make install', it doesn't fully support
|
|
|
|
# DESTDIR and spams stuff to /usr/bin and /etc/X11/app-defaults.
|
|
|
|
mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG
|
|
|
|
|
|
|
|
for i in $PRGNAM ${PRGNAM}to; do
|
|
|
|
install -s -m0755 -oroot -groot $i $PKG/usr/bin
|
|
|
|
gzip -9c < $PRGNAM.man > $PKG/usr/man/man1/$i.1x.gz
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in xview xsetbg; do
|
|
|
|
ln -s $PRGNAM $PKG/usr/bin/$i
|
|
|
|
ln -s $PRGNAM.1x.gz $PKG/usr/man/man1/$i.1x.gz
|
|
|
|
done
|
2014-08-14 17:42:09 +02:00
|
|
|
|
2018-06-29 11:56:10 +02:00
|
|
|
# This is API doc, for extending xli with new image formats. Not
|
|
|
|
# necessarily useful, but why not package it?
|
|
|
|
mkdir -p $PKG/usr/man/man5
|
|
|
|
gzip -9c < xliguide.man > $PKG/usr/man/man5/xliguide.5.gz
|
2014-08-14 17:42:09 +02:00
|
|
|
|
2018-06-29 11:56:10 +02:00
|
|
|
# The defaults file is only 2 lines, easier to create here than
|
|
|
|
# try to make the Makefile play nice with DESTDIR. Plus, the hard-coded
|
|
|
|
# defaults need modifying anyway (add formats to extension= and use dirs
|
|
|
|
# that actually exist for path=).
|
|
|
|
mkdir -p $PKG/etc/X11/app-defaults
|
|
|
|
cat <<EOF >$PKG/etc/X11/app-defaults/Xli
|
|
|
|
path=/usr/share/pixmaps /usr/share/icons
|
|
|
|
extension=.png .gif .jpg .PNG .GIF .JPG .jpeg .JPEG .xpm .pcx .PCX .bmp .BMP .pbm .pgm .ppm .tga .TGA .rle .csun .msun .sun .face .xbm .bm
|
|
|
|
EOF
|
2014-08-14 17:42:09 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2018-06-29 11:56:10 +02:00
|
|
|
cp -a ABOUTGAMMA CHANGES README* TODO chkgamma.jpg $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-08-14 17:42:09 +02: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
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|