source: npl/fileserver/nfs_utils/nfs-utils.SlackBuild.orig @ 1568e4c

gcc484perl-5.22
Last change on this file since 1568e4c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 4.9 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2011, 2013, 2016  Patrick J. Volkerding, Sebeka, MN, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23
24VERSION=1.3.3
25BUILD=${BUILD:-2}
26
27# Automatically determine the architecture we're building on:
28if [ -z "$ARCH" ]; then
29  case "$( uname -m )" in
30    i?86) export ARCH=i586 ;;
31    arm*) export ARCH=arm ;;
32    # Unless $ARCH is already set, use uname -m for all other archs:
33       *) export ARCH=$( uname -m ) ;;
34  esac
35fi
36
37NUMJOBS=${NUMJOBS:-" -j7 "}
38
39if [ "$ARCH" = "i586" ]; then
40  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
41elif [ "$ARCH" = "s390" ]; then
42  SLKCFLAGS="-O2"
43elif [ "$ARCH" = "x86_64" ]; then
44  SLKCFLAGS="-O2 -fPIC"
45else
46  SLKCFLAGS="-O2"
47fi
48
49CWD=$(pwd)
50TMP=${TMP:-/tmp}
51PKG=$TMP/package-nfs-utils
52
53rm -rf $PKG
54mkdir -p $TMP $PKG
55
56# Explode the package framework:
57cd $PKG
58explodepkg $CWD/_nfs-utils.tar.gz
59
60# Add startup script:
61cat $CWD/rc.nfsd > $PKG/etc/rc.d/rc.nfsd.new
62# Off by default, unless there's a previous version that's turned on:
63chmod 644 $PKG/etc/rc.d/rc.nfsd.new
64
65cd $TMP
66rm -rf nfs-utils-$VERSION
67tar xvf $CWD/nfs-utils-$VERSION.tar.xz || exit 1
68cd nfs-utils-$VERSION || exit 1
69
70zcat $CWD/nfs-utils.lwrap.needs.lnsl.diff.gz | patch -p1 --verbose || exit 1
71# Fix problems on machines without IPv6:
72zcat $CWD/ignore_unsupported_address_types_in_nfssvc_setfds.diff.gz | patch -p1 -l --verbose || exit 1
73
74chown -R root:root .
75find . \
76  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
77  -exec chmod 755 {} \; -o \
78  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
79  -exec chmod 644 {} \;
80
81
82CFLAGS="$SLKCFLAGS" \
83./configure \
84  --prefix=/usr \
85  --mandir=/usr/man \
86  --with-statedir=/var/lib/nfs \
87  --enable-mountconfig \
88  --enable-nfsv4=yes \
89  --enable-gss=no \
90  --with-krb5 \
91  --enable-tirpc=yes \
92  --disable-ipv6 \
93  --program-prefix= \
94  --program-suffix= \
95  --build=$ARCH-slackware-linux
96
97make $NUMJOBS || make || exit 1
98make install DESTDIR=$PKG || exit 1
99
100# Add nfsmount.conf and man page:
101cat ./utils/mount/nfsmount.conf > $PKG/etc/nfsmount.conf
102mkdir -p $PKG/usr/man/man5
103cat ./utils/mount/nfsmount.conf.man > $PKG/usr/man/man5/nfsmount.conf.5
104# Set default protocol version 3:
105#sed -i "s/# Defaultvers=4/Defaultvers=3/g" $PKG/etc/nfsmount.conf.new
106
107# These might be in use:
108( cd $PKG/var/lib/nfs
109  for config_file in etab rmtab state xtab ; do
110    mv ${config_file} ${config_file}.new
111  done
112)
113
114# No NFSv4 yet, so remove these:
115#rm -f $PKG/sbin/*nfs4
116
117# This should move to support /usr on NFS:
118mkdir -p $PKG/sbin
119mv $PKG/usr/sbin/rpc.statd $PKG/sbin
120( cd $PKG/usr/sbin ; ln -sf ../../sbin/rpc.statd . )
121
122# Chown /var/lib/nfs so that rpc.statd runs as rpc:rpc:
123chown -R rpc:rpc $PKG/var/lib/nfs
124
125find $PKG | xargs file | grep -e "executable" -e "shared object" \
126  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
127
128mkdir -p $PKG/usr/doc/nfs-utils-$VERSION
129cp -a \
130  COPYING* INSTALL NEWS README* \
131  $PKG/usr/doc/nfs-utils-$VERSION
132mkdir -p $PKG/usr/doc/nfs-utils-$VERSION/statd
133cp -a \
134  utils/statd/COPYING utils/statd/TODO \
135  $PKG/usr/doc/nfs-utils-$VERSION/statd
136
137# If there's a ChangeLog, installing at least part of the recent history
138# is useful, but don't let it get totally out of control:
139if [ -r ChangeLog ]; then
140  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
141  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
142  touch -r ChangeLog $DOCSDIR/ChangeLog
143fi
144
145# Compress and if needed symlink the man pages:
146if [ -d $PKG/usr/man ]; then
147  ( cd $PKG/usr/man
148    for manpagedir in $(find . -type d -name "man*") ; do
149      ( cd $manpagedir
150        for eachpage in $( find . -type l -maxdepth 1) ; do
151          ln -s $( readlink $eachpage ).gz $eachpage.gz
152          rm $eachpage
153        done
154        gzip -9 *.?
155      )
156    done
157  )
158fi
159
160mkdir -p $PKG/install
161cat $CWD/slack-desc > $PKG/install/slack-desc
162zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
163
164# Build the package:
165cd $PKG
166/sbin/makepkg -l y -c n $TMP/nfs-utils-$VERSION-$ARCH-$BUILD.txz
167
Note: See TracBrowser for help on using the repository browser.