slackbuilds_ponce/network/unfs3/unfs3.SlackBuild

83 lines
2.1 KiB
Text
Raw Normal View History

2010-05-11 15:01:38 +02:00
#!/bin/sh
# Slackware build script for UNFS3 (unfsd)
# Written by Menno Duursma <druiloor@zonnet.nl>
2010-05-11 15:01:38 +02:00
# Modified by the SlackBuilds.org project
# 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
VERSION=0.9.22
2010-05-11 15:01:38 +02:00
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
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"
LIBDIRSUFFIX=""
2010-05-11 15:01:38 +02:00
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
2010-05-11 15:01:38 +02:00
fi
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
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 \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--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
# 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
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
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}