slackbuilds_ponce/system/mrxvt/mrxvt.SlackBuild
2010-05-13 00:41:02 +02:00

106 lines
2.5 KiB
Bash

#!/bin/sh
# Slackware build script for mrxvt
# Written by Paul Wisehart wise@lupulin.net
set -e
PKGNAM=mrxvt
VERSION=0.5.4
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PKGNAM
OUTPUT=${OUTPUT:-/tmp}
# Number of lines to save in scroll buffer
# The default if not specified in configure is 100, but I can't
# imagine this being enough for any real usage of a terminal emulator
SAVELINES=${SAVELINES:-500}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
fi
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.gz
cd $PKGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+rw,go+r-w .
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--with-save-lines=$SAVELINES \
--enable-xft \
--enable-xim \
--enable-text-shadow \
--enable-utempter \
--enable-menubar \
--disable-debug
make
make install DESTDIR=$PKG
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null
)
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \
$PKG/usr/doc/$PKGNAM-$VERSION
mv $PKG/usr/share/doc/$PKGNAM/* $PKG/usr/doc/$PKGNAM-$VERSION/
rmdir $PKG/usr/share/doc/$PKGNAM
cat $CWD/$PKGNAM.SlackBuild > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild
( cd $PKG/usr/doc/$PKGNAM-$VERSION
for i in *.bz2 ; do
bunzip2 $i ;
done
)
# Add an mrxvt.desktop entry
mkdir -p $PKG/usr/share/applications
cat $CWD/mrxvt.desktop > $PKG/usr/share/applications/mrxvt.desktop
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
)
# Let's not clobber existing config files
for i in \
$PKG/etc/mrxvt/default.menu $PKG/etc/mrxvt/submenus.menu \
$PKG/etc/mrxvt/mrxvtrc $PKG/etc/mrxvt/mrxvtrc.sample ;
do mv $i $i.new ;
done
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}