2010-05-11 15:01:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for UNFS3 (unfsd)
|
2010-05-12 17:44:22 +02:00
|
|
|
# Written by Menno Duursma <druiloor@zonnet.nl>
|
2010-05-11 15:01:38 +02:00
|
|
|
|
|
|
|
# Modified by the SlackBuilds.org project
|
|
|
|
|
2010-05-11 22:25:53 +02:00
|
|
|
# This program is free software. It comes without any warranty.
|
|
|
|
# Granted WTFPL, Version 2, as published by Sam Hocevar. See
|
|
|
|
# http://sam.zoy.org/wtfpl/COPYING for more details.
|
2010-05-11 15:01:38 +02:00
|
|
|
|
|
|
|
PRGNAM=unfs3
|
2010-05-12 17:44:22 +02:00
|
|
|
VERSION=0.9.22
|
2010-05-11 15:01:38 +02:00
|
|
|
ARCH=${ARCH:-i486}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 22:25:53 +02:00
|
|
|
|
2010-05-11 15:01:38 +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"
|
2010-05-13 00:38:36 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 15:01:38 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:38:36 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:25:53 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:38:36 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-11 15:01:38 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-11 22:25:53 +02:00
|
|
|
set -e # Exit on most errors
|
|
|
|
|
2010-05-11 15:01:38 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-11 22:25:53 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-05-11 15:01:38 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
# Note: the support for cluster tags compiled-in below can be
|
|
|
|
# enabled by way of a startup argument to unfsd.
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:38:36 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 22:25:53 +02:00
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--enable-cluster \
|
|
|
|
--disable-static \
|
|
|
|
--build=$ARCH-slackware-linux
|
2010-05-11 15:01:38 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install-strip DESTDIR=$PKG
|
|
|
|
|
2010-05-11 22:25:53 +02:00
|
|
|
# Add the init script
|
|
|
|
install -D -m 0755 unfsd.init $PKG/etc/rc.d/rc.unfsd.new
|
|
|
|
|
|
|
|
# Precreate lock directory, as the init script expects that to exist
|
|
|
|
mkdir -p $PKG/var/lock/subsys
|
|
|
|
|
|
|
|
( cd $PKG/usr/man || exit 1
|
2010-05-11 15:01:38 +02:00
|
|
|
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 [A-Z][A-Z]* doc/* contrib $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2010-05-11 22:25:53 +02:00
|
|
|
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README$TAG
|
2010-05-11 15:01:38 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh >$PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:38:36 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|