2010-05-11 22:55:29 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# slackware package build script for runit
|
|
|
|
|
|
|
|
# written by David Miller dave at frop dot net
|
|
|
|
|
|
|
|
PRGNAM=runit
|
2010-05-13 00:41:41 +02:00
|
|
|
VERSION=${VERSION:-2.1.1}
|
2010-05-11 22:55:29 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:16:41 +02:00
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 22:55:29 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
|
|
|
|
mv admin/$PRGNAM-$VERSION $PRGNAM-$VERSION
|
|
|
|
rmdir admin
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
|
|
|
|
echo gcc $SLKCFLAGS -Wall > src/conf-cc
|
|
|
|
|
|
|
|
package/compile
|
|
|
|
package/check
|
|
|
|
|
2010-05-13 00:41:41 +02:00
|
|
|
install -d $PKG/usr/bin
|
|
|
|
install -m 755 command/* $PKG/usr/bin
|
|
|
|
install -D -m0750 etc/2 $PKG/sbin/runsvdir-start
|
2010-05-11 22:55:29 +02:00
|
|
|
|
2010-05-13 00:41:41 +02:00
|
|
|
install -d $PKG/usr/man/man8
|
|
|
|
install -m 644 man/* $PKG/usr/man/man8
|
2010-05-11 22:55:29 +02:00
|
|
|
|
2010-05-19 08:50:25 +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 22:55:29 +02:00
|
|
|
|
|
|
|
( 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
|
|
|
|
)
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a package/CHANGES package/README package/TODO package/COPYING package/THANKS \
|
|
|
|
doc/ etc/ $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
|
2010-05-13 00:41:41 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
2010-05-11 22:55:29 +02:00
|
|
|
|