summaryrefslogtreecommitdiff
path: root/source/n/nfs-utils/nfs-utils.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/nfs-utils/nfs-utils.SlackBuild')
-rwxr-xr-xsource/n/nfs-utils/nfs-utils.SlackBuild41
1 files changed, 29 insertions, 12 deletions
diff --git a/source/n/nfs-utils/nfs-utils.SlackBuild b/source/n/nfs-utils/nfs-utils.SlackBuild
index e8800479..147a69b8 100755
--- a/source/n/nfs-utils/nfs-utils.SlackBuild
+++ b/source/n/nfs-utils/nfs-utils.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2008, 2009, 2010, 2011, 2013, 2016 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2011, 2013, 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,8 +20,10 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
-VERSION=1.3.3
+PKGNAM=nfs-utils
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
@@ -34,6 +36,14 @@ if [ -z "$ARCH" ]; then
esac
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i586" ]; then
@@ -46,30 +56,33 @@ else
SLKCFLAGS="-O2"
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-nfs-utils
rm -rf $PKG
mkdir -p $TMP $PKG
-# Explode the package framework:
-cd $PKG
-explodepkg $CWD/_nfs-utils.tar.gz
+# Add defaults file:
+mkdir -p $PKG/etc/default
+cat $CWD/nfs.default > $PKG/etc/default/nfs.new
# Add startup script:
+mkdir -p $PKG/etc/rc.d
cat $CWD/rc.nfsd > $PKG/etc/rc.d/rc.nfsd.new
# Off by default, unless there's a previous version that's turned on:
chmod 644 $PKG/etc/rc.d/rc.nfsd.new
+# Add /etc/exports:
+cp -a $CWD/exports $PKG/etc/exports.new
+chown root:root $PKG/etc/exports.new
+chmod 644 $PKG/etc/exports.new
+
cd $TMP
rm -rf nfs-utils-$VERSION
-tar xvf $CWD/nfs-utils-$VERSION.tar.xz || exit 1
+tar xvf $CWD/nfs-utils-$VERSION.tar.?z || exit 1
cd nfs-utils-$VERSION || exit 1
zcat $CWD/nfs-utils.lwrap.needs.lnsl.diff.gz | patch -p1 --verbose || exit 1
-# Fix problems on machines without IPv6:
-zcat $CWD/ignore_unsupported_address_types_in_nfssvc_setfds.diff.gz | patch -p1 -l --verbose || exit 1
chown -R root:root .
find . \
@@ -91,7 +104,7 @@ CFLAGS="$SLKCFLAGS" \
--enable-tirpc=yes \
--program-prefix= \
--program-suffix= \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -100,12 +113,13 @@ make install DESTDIR=$PKG || exit 1
cat ./utils/mount/nfsmount.conf > $PKG/etc/nfsmount.conf.new
mkdir -p $PKG/usr/man/man5
cat ./utils/mount/nfsmount.conf.man > $PKG/usr/man/man5/nfsmount.conf.5
+
# Set default protocol version 3:
sed -i "s/# Defaultvers=4/Defaultvers=3/g" $PKG/etc/nfsmount.conf.new
# These might be in use:
( cd $PKG/var/lib/nfs
- for config_file in etab rmtab state xtab ; do
+ for config_file in etab rmtab state ; do
mv ${config_file} ${config_file}.new
done
)
@@ -121,6 +135,9 @@ mv $PKG/usr/sbin/rpc.statd $PKG/sbin
# Chown /var/lib/nfs so that rpc.statd runs as rpc:rpc:
chown -R rpc:rpc $PKG/var/lib/nfs
+# Create log directory:
+mkdir -p $PKG/var/log/nfsd
+
find $PKG | xargs file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null