2016-10-13 12:48:43 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for unclutter-xfixes
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
|
|
|
PRGNAM=unclutter-xfixes
|
2019-01-11 21:04:22 +01:00
|
|
|
VERSION=${VERSION:-1.5}
|
2016-10-13 12:48:43 +02:00
|
|
|
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 $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2017-03-01 20:21:06 +01:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2016-10-13 12:48:43 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2018-12-01 09:48:33 +01:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2016-10-13 12:48:43 +02:00
|
|
|
|
|
|
|
# SBo libev has event.h in nonstandard dir
|
|
|
|
sed -i "/-Wall/s,\$, $SLKCFLAGS -I/usr/include/libev," Makefile
|
|
|
|
|
2018-01-25 20:11:04 +01:00
|
|
|
# 20180125 bkw: starting with 1.3, upstream uses PREFIX in the canonical
|
|
|
|
# way. So don't try to build older versions with this script, or it'll
|
|
|
|
# install as /usr/unclutter instead of /usr/bin/unclutter.
|
2016-10-13 12:48:43 +02:00
|
|
|
make
|
2018-01-25 20:11:04 +01:00
|
|
|
make install PREFIX=$PKG/usr MANDIR=$PKG/usr/man/man1
|
2016-10-13 12:48:43 +02:00
|
|
|
strip $PKG/usr/bin/*
|
|
|
|
gzip $PKG/usr/man/man?/*.?
|
|
|
|
|
2019-01-11 21:04:22 +01:00
|
|
|
# 20190111 bkw: starting with 1.5, upstream installs the license to
|
|
|
|
# /usr/share/licenses/. I dunno if this is some obscure FHS thing or
|
|
|
|
# a Debian standard or what, but we already got the license in /usr/doc.
|
|
|
|
rm -rf $PKG/usr/share
|
|
|
|
|
2016-10-13 12:48:43 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
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}
|