2010-05-11 14:03:47 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for ratpoison
|
2010-05-13 00:23:07 +02:00
|
|
|
# Written by Grigorios Bouzakis (grbzks@xsmail.com)
|
2013-04-24 02:47:03 +02:00
|
|
|
# Updated by Ellington Santos aka necropresto (ellingtonsantos@gmail.com)
|
2014-06-04 01:11:57 +02:00
|
|
|
# SlackBuild adopted by Glenn Becker (burningc@sdf.org)
|
2010-05-11 14:03:47 +02:00
|
|
|
|
|
|
|
PRGNAM=ratpoison
|
2014-04-22 02:33:44 +02:00
|
|
|
VERSION=${VERSION:-1.4.7}
|
2013-04-24 02:47:03 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 14:03:47 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 22:22:04 +02:00
|
|
|
|
2010-05-22 05:56:03 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2010-06-04 07:01:28 +02:00
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
2010-05-22 05:56:03 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 19:44:02 +02:00
|
|
|
CWD=$(pwd)
|
2010-05-11 14:03:47 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:23:07 +02:00
|
|
|
LIBDIRDSUFFIX=""
|
2010-05-11 14:03:47 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:23:07 +02:00
|
|
|
LIBDIRDSUFFIX=""
|
2010-05-11 22:22:04 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:23:07 +02:00
|
|
|
LIBDIRDSUFFIX="64"
|
2010-05-22 05:56:03 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 14:03:47 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-11 22:22:04 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
2010-05-11 14:03:47 +02:00
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-11 22:22:04 +02:00
|
|
|
cd $TMP
|
2010-05-11 14:03:47 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-11 22:22:04 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 14:03:47 +02:00
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2014-04-22 02:33:44 +02:00
|
|
|
\( -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 {} \;
|
2010-05-11 22:22:04 +02:00
|
|
|
|
|
|
|
# Set the terminal emulator to be used as default by ratpoison
|
|
|
|
# The default is xterm if it's not specified in ./configure, so
|
|
|
|
# we'll leave it that way here. You can specify rxvt or something
|
|
|
|
# else if you wish
|
|
|
|
XTERM=${XTERM:-xterm}
|
2010-05-11 14:03:47 +02:00
|
|
|
|
2010-05-22 05:56:03 +02:00
|
|
|
CFLAGS="$SLKCFLAGS -DHAVE_GETLINE" \
|
2010-05-11 14:03:47 +02:00
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:23:07 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 22:22:04 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
2010-05-13 00:23:07 +02:00
|
|
|
--infodir=/usr/info \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--with-xterm=$XTERM \
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 14:03:47 +02:00
|
|
|
|
2010-05-11 22:22:04 +02:00
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-13 00:23:07 +02:00
|
|
|
mkdir -p $PKG/etc/X11/xinit
|
|
|
|
install -m 0755 $CWD/xinitrc.ratpoison $PKG/etc/X11/xinit/xinitrc.ratpoison
|
|
|
|
|
2010-05-19 08:32:12 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-11 14:03:47 +02:00
|
|
|
|
2010-05-22 05:56:03 +02:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ;
|
|
|
|
rm $i ; done
|
2010-05-11 14:03:47 +02:00
|
|
|
|
2010-05-11 22:22:04 +02:00
|
|
|
rm -f $PKG/usr/info/dir
|
|
|
|
gzip -9 $PKG/usr/info/*.info*
|
2010-05-11 14:03:47 +02:00
|
|
|
|
2010-05-13 00:23:07 +02:00
|
|
|
# Add some missed docs
|
|
|
|
cp -a INSTALL TODO $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 14:03:47 +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
|
2010-05-13 00:23:07 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-11 14:03:47 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:23:07 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|