root-tail Slackbuild
Inviato: ven 5 gen 2007, 19:21
Conoscete root-tail, è un comodissimo programma che ti permette di visualizzare i log sul desktop in modo tale da tenerli sempre sotto controllo. Nel repository non c'è e stavo cercando uno Slackbuild che facesse al caso nostro. Ho trovato questo qui:
L'ho avviato in /tmp solo che ad un certo punto mi chiede la password, probabilmente perché avviandolo non da root non riesce ad eseguire certi comandi. Unica cosa è che non va avviato da root. Cosa ne pensate? Consigli?
Codice: Seleziona tutto
#!/bin/sh
# Licence: Domaine publique
#
## Variables à modifier ##
NAMESRC=${NAMESRC:-root-tail}
VERSION=${VERSION:-1.2}
EXT=${EXT:-tar.gz}
NAMETGZ=${NAMETGZ:-$NAMESRC}
BUILD=${BUILD:-1}
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
ARCH=${ARCH:-i486}
WGET=${WGET:-http://www.goof.com/pcg/marc/data/$NAMESRC-$VERSION.$EXT}
## Fin des variables à modifier ##
set -e
if [ ! -r $NAMESRC-$VERSION.$EXT ]; then
wget "$WGET"
fi
CWD=`pwd`
PKG=$TMP/build/$NAMETGZ
NAME=`tar ft $NAMESRC-$VERSION.$EXT | head -1 | awk -F/ '{ print $1 }'`
TARGET=i486
if [ "$ARCH" = "i386" ]; then
CPUOPT="-O2 -march=i386 -mtune=i686"
elif [ "$ARCH" = "i486" ]; then
CPUOPT="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i586" ]; then
CPUOPT="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
CPUOPT="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "s390" ]; then
CPUOPT="-O2"
elif [ "$ARCH" = "x86_64" ]; then
CPUOPT="-O2"
fi
if [ $UID -eq 0 ]; then
echo "Do not run this SlackBuild as ROOT !"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP doesn't exist or is not a directory !"
exit 1
fi
# Compilation du programme
cd $TMP
echo "Building $NAMESRC-$VERSION.$EXT..."
tar xf $CWD/$NAMESRC-$VERSION.$EXT
cd $NAME
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
xmkmf -a
make
make install DESTDIR=$PKG
# Installation du slack-desc
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
# Installation du doinst.sh
if [ -r $CWD/doinst.sh ]; then
cat $CWD/doinst.sh > $PKG/install/doinst.sh
fi
# Installation de la documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 \
Changes \
README \
$PKG/usr/doc/$NAME
# Compression des pages de man
mkdir -p $PKG/usr/X11R6/man/man1/
cp $TMP/$NAME/root-tail.man $PKG/usr/X11R6/man/man1/
find `find $PKG -type d -name man` -type f | xargs gzip -9 2> /dev/null || echo "No man pages to compress"
# "Striping" des binaires et des bibliothèques
find $PKG | xargs file | grep "ELF 32-bit LSB executable" | cut -f 1 -d : | xargs strip --strip-all 2> /dev/null || echo "No ELF 32-bit LSB executable to strip"
# Création du paquetage
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMETGZ-$VERSION-$ARCH-$BUILD.tgz
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi