--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/01_minimum/nfs.txz/old/nfs_utils-20161006/PlamoBuild.nfs_utils-1.3.4 2016-10-06 08:07:19.000000000 +0900 @@ -1,15 +1,16 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="https://www.kernel.org/pub/linux/utils/nfs-utils/1.3.4/nfs-utils-1.3.4.tar.xz + https://raw.githubusercontent.com/pld-linux/nfs-utils/master/nfs-utils-heimdal.patch" +pkgbase=nfs_utils +vers=1.3.4 arch=`uname -m` build=P1 -src=$pkgbase-$vers -patchfiles="" -OPT_CONFIG="" -DOCS="README" +src=nfs-utils-$vers +patchfiles="nfs-utils-heimdal.patch" +OPT_CONFIG="--disable-nfsv4 --disable-gss --with-krb5=/usr/heimdal" +DOCS="README NEWS INSTALL COPYING" ###################################################################### fscheck() { @@ -233,6 +234,14 @@ esac done done + cd $B + cp -p configure{,.orig} + cat <<- "EOF" | patch configure + 19966c19966 + < -f $dir/lib/libroken.a; then + --- + > \( -f $dir/lib/libroken.so -o -f $dir/lib64/libroken.so \); then + EOF for i in `seq 0 $((${#B[@]} - 1))` ; do cd ${B[$i]} if [ -f Makefile ] ; then @@ -272,6 +281,39 @@ make install DESTDIR=$P fi done + cat <<- "EOF" > $P/sbin/nfs4_setup.sh + #!/bin/sh + # + # Simple NFSv4 setup scripts for NFS mount by hands + # If you don't invoke rpc.idmapd, NFSv4's UID/username mapping + # function doesn't work and cannot chown files on NFS + + modprobe sunrpc + mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs + /usr/bin/rpcbind + /usr/sbin/rpc.nfsd 4 + /usr/sbin/rpc.mountd + /usr/sbin/rpc.idmapd + /usr/sbin/rpc.statd + EOF + chmod 755 $P/sbin/nfs4_setup.sh + mv $P/usr/sbin/{sm-notify,rpc.statd} $C + mv $C/{sm-notify,rpc.statd} $P/usr/sbin + ln -s /bin/ture $P/usr/sbin/rpc.gssd + mkdir -m 700 $P/var/lib/nfs/{rpc_pipefs,v4recovery} + chown nobody $P/var/lib/nfs/{rpc_pipefs,v4recovery} + mkdir $P/etc + cat <<- "EOF" > $P/etc/idmapd.conf + [General] + Verbosity = 1 + Pipefs-Directory = /var/lib/nfs/rpc_pipefs + Domain = localdomain + + [Mapping] + + Nobody-User = nobody + Nobody-Group = nogroup + EOF touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -295,9 +337,29 @@ ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done convert - tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` - tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + cat <<- EOF >> $P/install/doinst.sh + #%% begin initialize $pkg + EOF + cat <<- "EOF" | unexpand >> $P/install/doinst.sh + if [ -z `grep "^nfs" etc/services` ] ; then + echo "adding nfs service into /etc/services" + cat <<- "EOF" >> etc/services + nfs 2049/tcp + nfs 2049/udp + EOF + fi + #%% end + EOF + touch -t `date '+%m%d0900'` $P/install/doinst.sh + tar cvpf $pkg.tar -C $P `cd $P ; find sbin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/sbin | tail -n+2` + tar rvpf $pkg.tar -C $P var/lib/nfs + tar rvpf $pkg.tar -C $P etc/idmapd.conf + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man5 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man7 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man8 | tail -n+2` tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh touch -t `date '+%m%d0900'` $pkg.tar ; xz $pkg.tar ; touch $pkg.tar.xz mv $pkg.tar.xz $pkg.txz read -p "Do you want to keep work files? [y/N] " ans