From c4e6399a13df3f5548331c46a5e4362e2508ee5d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 12 Jun 2004 00:19:08 +0000 Subject: fix #30522 #37004 #49444 --- net-fs/nfs-utils/ChangeLog | 13 +- net-fs/nfs-utils/Manifest | 16 +-- net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r2 | 1 - net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r3 | 1 + net-fs/nfs-utils/files/nfs-4 | 170 ----------------------- net-fs/nfs-utils/files/nfs-5 | 170 +++++++++++++++++++++++ net-fs/nfs-utils/files/nfs.confd | 7 + net-fs/nfs-utils/nfs-utils-1.0.6-r2.ebuild | 91 ------------ net-fs/nfs-utils/nfs-utils-1.0.6-r3.ebuild | 94 +++++++++++++ 9 files changed, 292 insertions(+), 271 deletions(-) delete mode 100644 net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r2 create mode 100644 net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r3 delete mode 100644 net-fs/nfs-utils/files/nfs-4 create mode 100644 net-fs/nfs-utils/files/nfs-5 delete mode 100644 net-fs/nfs-utils/nfs-utils-1.0.6-r2.ebuild create mode 100644 net-fs/nfs-utils/nfs-utils-1.0.6-r3.ebuild diff --git a/net-fs/nfs-utils/ChangeLog b/net-fs/nfs-utils/ChangeLog index 323884b6fca0..61ab4fb7bc1b 100644 --- a/net-fs/nfs-utils/ChangeLog +++ b/net-fs/nfs-utils/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for net-fs/nfs-utils # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.39 2004/06/08 19:04:04 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.40 2004/06/12 00:19:08 vapier Exp $ + +*nfs-utils-1.0.6-r3 (11 Jun 2004) + + 11 Jun 2004; Mike Frysinger : + While i'm here, might as well fix more things :P. + Run make for the depend target so that we can then build everything + else in parallel. Add tweakable exportfs timeout to nfs init script + #37004 by Vlastimil Holer. Enable the '--enable-secure-statd' option + by default (seems to work fine on my nfs3 machines) #49444 by Juergen + Nagel. Make sure the emtpy state dirs dont get autocleaned #30522 by + Brave Cobra. *nfs-utils-1.0.6-r2 (08 Jun 2004) diff --git a/net-fs/nfs-utils/Manifest b/net-fs/nfs-utils/Manifest index 5f0905baa9ca..f35171236068 100644 --- a/net-fs/nfs-utils/Manifest +++ b/net-fs/nfs-utils/Manifest @@ -1,26 +1,26 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 3c3b89231ab45f846428906f6e52e111 ChangeLog 6156 +MD5 5733c1142e36bf0f2109c6f70f11a4cc ChangeLog 6673 MD5 e19ce29f89eef0b231f1b1249edb6607 nfs-utils-1.0.5-r1.ebuild 1933 MD5 6426a8f24a2ef06619766fe95870acae nfs-utils-1.0.6.ebuild 2542 MD5 9cee4adcef8a47ea4ee35090f7f89b0a metadata.xml 225 MD5 2902bf7f7367c016200b9716b1757266 nfs-utils-1.0.6-r1.ebuild 2504 -MD5 43f73d8c38d860dd8cf02afc01793e02 nfs-utils-1.0.6-r2.ebuild 2617 -MD5 4a9e6d0c2096e14929fb0f90c2c4db2b files/nfs-4 5187 +MD5 890474b26767fd7fb67ed9793f6237cb nfs-utils-1.0.6-r3.ebuild 2716 MD5 3219e53cb07ef64536526153158b7ab2 files/digest-nfs-utils-1.0.5-r1 67 MD5 3a3d8bd1a03bbf2c51a4e77a3516febd files/digest-nfs-utils-1.0.6 67 MD5 a02eed87e5d581e56feb0f6dfd18e6df files/exports 66 MD5 54cfb747aeae0de5ae5856024465d69f files/nfs-2 4743 -MD5 d5d28d5c015b22e7c0d6b1d35ab5baff files/nfs.confd 265 +MD5 3da96ccc6af7da277d20e11c4178a37d files/nfs.confd 544 MD5 22ffe6ab0f66c1b67b80b4b8dd2b23d9 files/nfsmount 1156 MD5 3a3d8bd1a03bbf2c51a4e77a3516febd files/digest-nfs-utils-1.0.6-r1 67 MD5 19501f6de1fee02698a6e0524ec15bf4 files/nfs-3 5142 -MD5 3a3d8bd1a03bbf2c51a4e77a3516febd files/digest-nfs-utils-1.0.6-r2 67 +MD5 3a3d8bd1a03bbf2c51a4e77a3516febd files/digest-nfs-utils-1.0.6-r3 67 +MD5 72660577b3ffd1d51743938e0a054027 files/nfs-5 5168 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.9.8 (GNU/Linux) -iD8DBQFAxg2tHTu7gpaalycRAqM6AKCCcPxyF+Pjtv6hvQG1q+vh0lZBJACgmm37 -ecev62HgMpUsI+XCqgzBkl0= -=Fw0x +iD8DBQFAykwPHTu7gpaalycRAgaUAJ9557/os45wm4gdf+/BQqAOSVOvZgCfXnJ/ +nJjFKo1OvW2xUAmz+uK3m4o= +=C30r -----END PGP SIGNATURE----- diff --git a/net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r2 b/net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r2 deleted file mode 100644 index 319c3d94379e..000000000000 --- a/net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r2 +++ /dev/null @@ -1 +0,0 @@ -MD5 f17e9983457e1cf61c37f0be4493fce6 nfs-utils-1.0.6.tar.gz 265964 diff --git a/net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r3 b/net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r3 new file mode 100644 index 000000000000..319c3d94379e --- /dev/null +++ b/net-fs/nfs-utils/files/digest-nfs-utils-1.0.6-r3 @@ -0,0 +1 @@ +MD5 f17e9983457e1cf61c37f0be4493fce6 nfs-utils-1.0.6.tar.gz 265964 diff --git a/net-fs/nfs-utils/files/nfs-4 b/net-fs/nfs-utils/files/nfs-4 deleted file mode 100644 index d10b0b4b16c5..000000000000 --- a/net-fs/nfs-utils/files/nfs-4 +++ /dev/null @@ -1,170 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfs-4,v 1.1 2004/06/08 19:04:04 vapier Exp $ - -#--------------------------------------------------------------------------- -# This script starts/stops the following -# rpc.statd if necessary (also checked by init.d/nfsmount) -# rpc.rquotad if exists (from quota package) -# rpc.nfsd -# rpc.mountd -#--------------------------------------------------------------------------- - -# NB: Config is in /etc/conf.d/nfs - -opts="start stop restart reload" - -# This variable is used for controlling whether or not to run exportfs -ua; -# see stop() for more information -restarting=yes - -# The binary locations -exportfs=/usr/sbin/exportfs -statd=/sbin/rpc.statd -rquotad=/usr/sbin/rpc.rquotad -nfsd=/usr/sbin/rpc.nfsd -mountd=/usr/sbin/rpc.mountd - -depend() { - local myneed="net portmap" - if [ -x /sbin/idmapd ] ; then - if grep -q rpc_pipefs /proc/filesystems &>/dev/null; then - myneed="${myneed} idmapd" - fi - fi - need ${myneed} - after quota -} - -start_statd() { - # Don't start rpc.statd if already started by init.d/nfsmount - killall -0 rpc.statd &>/dev/null && return 0 - ebegin "Starting NFS statd" - start-stop-daemon --start --quiet --exec \ - $statd -- $RPCSTATDOPTS 1>&2 - eend $? "Error starting NFS statd" -} - -stop_statd() { - # Don't stop rpc.statd if it's in use by init.d/nfsmount. - mount -t nfs | grep -q . && return 0 - # Make sure it's actually running - killall -0 rpc.statd &>/dev/null || return 0 - # Okay, all tests passed, stop rpc.statd - ebegin "Stopping NFS statd" - start-stop-daemon --stop --quiet --exec $statd 1>&2 - eend $? "Error stopping NFS statd" -} - -start() { - # This is the new "kernel 2.6 way" to handle the exports file - if grep -q nfsd /proc/filesystems &>/dev/null; then - if ! grep -q "nfsd /proc/fs/nfs" /proc/mounts &>/dev/null; then - ebegin "Mounting nfsd filesystem in /proc" - mount -t nfsd nfsd /proc/fs/nfs - eend $? "Error mounting nfsd filesystem in /proc" - fi - fi - # now that nfsd is mounted inside /proc, we can safely start mountd later - - start_statd - - # Exportfs likes to hang if networking isn't working. - # If that's the case, then try to kill it so the - # bootup process can continue. - if grep -q '^/' /etc/exports &>/dev/null; then - ebegin "Exporting NFS directories" - $exportfs -r 1>&2 & - pid=$! - ( sleep 30; kill -9 $pid &>/dev/null ) & - wait $pid - eend $? "Error exporting NFS directories" - fi - - if [ -x $rquotad ]; then - ebegin "Starting NFS rquotad" - start-stop-daemon --start --quiet --exec \ - $rquotad -- $RPCRQUOTADOPTS 1>&2 - eend $? "Error starting NFS rquotad" - fi - - ebegin "Starting NFS daemon" - start-stop-daemon --start --quiet --exec \ - $nfsd -- $RPCNFSDCOUNT 1>&2 - eend $? "Error starting NFS daemon" - - # Start mountd - ebegin "Starting NFS mountd" - start-stop-daemon --start --quiet --exec \ - $mountd -- $RPCMOUNTDOPTS 1>&2 - eend $? "Error starting NFS mountd" -} - -stop() { - # Don't check NFSSERVER variable since it might have changed, - # instead use --oknodo to smooth things over - ebegin "Stopping NFS mountd" - start-stop-daemon --stop --quiet --oknodo \ - --exec $mountd 1>&2 - eend $? "Error stopping NFS mountd" - - # nfsd sets its process name to [nfsd] so don't look for $nfsd - ebegin "Stopping NFS daemon" - start-stop-daemon --stop --quiet --oknodo \ - --name nfsd --user root --signal 2 1>&2 - eend $? "Error stopping NFS daemon" - - if [ -x $rquotad ]; then - ebegin "Stopping NFS rquotad" - start-stop-daemon --stop --quiet --oknodo \ - --exec $rquotad 1>&2 - eend $? "Error stopping NFS rquotad" - fi - - # When restarting the NFS server, running "exportfs -ua" probably - # isn't what the user wants. Running it causes all entries listed - # in xtab to be removed from the kernel export tables, and the - # xtab file is cleared. This effectively shuts down all NFS - # activity, leaving all clients holding stale NFS filehandles, - # *even* when the NFS server has restarted. - # - # That's what you would want if you were shutting down the NFS - # server for good, or for a long period of time, but not when the - # NFS server will be running again in short order. In this case, - # then "exportfs -r" will reread the xtab, and all the current - # clients will be able to resume NFS activity, *without* needing - # to umount/(re)mount the filesystem. - if [ "$restarting" = no ]; then - ebegin "Unexporting NFS directories" - # Exportfs likes to hang if networking isn't working. - # If that's the case, then try to kill it so the - # shutdown process can continue. - $exportfs -ua 1>&2 & - pid=$! - ( sleep 30; kill -9 $pid &>/dev/null ) & - wait $pid - eend $? "Error unexporting NFS directories" - fi - - stop_statd -} - -reload() { - # Exportfs likes to hang if networking isn't working. - # If that's the case, then try to kill it so the - # bootup process can continue. - ebegin "Reloading /etc/exports" - $exportfs -r 1>&2 & - pid=$! - ( sleep 30; kill -9 $pid &>/dev/null ) & - wait $pid - eend $? "Error exporting NFS directories" -} - -restart() { - # See long comment in stop() regarding "restarting" and exportfs -ua - restarting=yes - svc_stop - svc_start -} diff --git a/net-fs/nfs-utils/files/nfs-5 b/net-fs/nfs-utils/files/nfs-5 new file mode 100644 index 000000000000..e99a563eb3b4 --- /dev/null +++ b/net-fs/nfs-utils/files/nfs-5 @@ -0,0 +1,170 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfs-5,v 1.1 2004/06/12 00:19:08 vapier Exp $ + +#--------------------------------------------------------------------------- +# This script starts/stops the following +# rpc.statd if necessary (also checked by init.d/nfsmount) +# rpc.rquotad if exists (from quota package) +# rpc.nfsd +# rpc.mountd +#--------------------------------------------------------------------------- + +# NB: Config is in /etc/conf.d/nfs + +opts="start stop restart reload" + +# This variable is used for controlling whether or not to run exportfs -ua; +# see stop() for more information +restarting=yes + +# The binary locations +exportfs=/usr/sbin/exportfs +statd=/sbin/rpc.statd +rquotad=/usr/sbin/rpc.rquotad +nfsd=/usr/sbin/rpc.nfsd +mountd=/usr/sbin/rpc.mountd + +depend() { + local myneed="net portmap" + if [ -x /sbin/idmapd ] ; then + if grep -q rpc_pipefs /proc/filesystems &>/dev/null; then + myneed="${myneed} idmapd" + fi + fi + need ${myneed} + after quota +} + +start_statd() { + # Don't start rpc.statd if already started by init.d/nfsmount + killall -0 rpc.statd &>/dev/null && return 0 + ebegin "Starting NFS statd" + start-stop-daemon --start --quiet --exec \ + $statd -- $RPCSTATDOPTS 1>&2 + eend $? "Error starting NFS statd" +} + +stop_statd() { + # Don't stop rpc.statd if it's in use by init.d/nfsmount. + mount -t nfs | grep -q . && return 0 + # Make sure it's actually running + killall -0 rpc.statd &>/dev/null || return 0 + # Okay, all tests passed, stop rpc.statd + ebegin "Stopping NFS statd" + start-stop-daemon --stop --quiet --exec $statd 1>&2 + eend $? "Error stopping NFS statd" +} + +waitfor_exportfs() { + local pid=$1 + ( sleep ${EXPORTFSTIMEOUT}; kill -9 $pid &>/dev/null ) & + wait $1 +} + +start() { + # This is the new "kernel 2.6 way" to handle the exports file + if grep -q nfsd /proc/filesystems &>/dev/null; then + if ! grep -q "nfsd /proc/fs/nfs" /proc/mounts &>/dev/null; then + ebegin "Mounting nfsd filesystem in /proc" + mount -t nfsd nfsd /proc/fs/nfs + eend $? "Error mounting nfsd filesystem in /proc" + fi + fi + # now that nfsd is mounted inside /proc, we can safely start mountd later + + start_statd + + # Exportfs likes to hang if networking isn't working. + # If that's the case, then try to kill it so the + # bootup process can continue. + if grep -q '^/' /etc/exports &>/dev/null; then + ebegin "Exporting NFS directories" + $exportfs -r 1>&2 & + waitfor_exportfs $! + eend $? "Error exporting NFS directories" + fi + + if [ -x $rquotad ]; then + ebegin "Starting NFS rquotad" + start-stop-daemon --start --quiet --exec \ + $rquotad -- $RPCRQUOTADOPTS 1>&2 + eend $? "Error starting NFS rquotad" + fi + + ebegin "Starting NFS daemon" + start-stop-daemon --start --quiet --exec \ + $nfsd -- $RPCNFSDCOUNT 1>&2 + eend $? "Error starting NFS daemon" + + # Start mountd + ebegin "Starting NFS mountd" + start-stop-daemon --start --quiet --exec \ + $mountd -- $RPCMOUNTDOPTS 1>&2 + eend $? "Error starting NFS mountd" +} + +stop() { + # Don't check NFSSERVER variable since it might have changed, + # instead use --oknodo to smooth things over + ebegin "Stopping NFS mountd" + start-stop-daemon --stop --quiet --oknodo \ + --exec $mountd 1>&2 + eend $? "Error stopping NFS mountd" + + # nfsd sets its process name to [nfsd] so don't look for $nfsd + ebegin "Stopping NFS daemon" + start-stop-daemon --stop --quiet --oknodo \ + --name nfsd --user root --signal 2 1>&2 + eend $? "Error stopping NFS daemon" + + if [ -x $rquotad ]; then + ebegin "Stopping NFS rquotad" + start-stop-daemon --stop --quiet --oknodo \ + --exec $rquotad 1>&2 + eend $? "Error stopping NFS rquotad" + fi + + # When restarting the NFS server, running "exportfs -ua" probably + # isn't what the user wants. Running it causes all entries listed + # in xtab to be removed from the kernel export tables, and the + # xtab file is cleared. This effectively shuts down all NFS + # activity, leaving all clients holding stale NFS filehandles, + # *even* when the NFS server has restarted. + # + # That's what you would want if you were shutting down the NFS + # server for good, or for a long period of time, but not when the + # NFS server will be running again in short order. In this case, + # then "exportfs -r" will reread the xtab, and all the current + # clients will be able to resume NFS activity, *without* needing + # to umount/(re)mount the filesystem. + if [ "$restarting" = no ]; then + ebegin "Unexporting NFS directories" + # Exportfs likes to hang if networking isn't working. + # If that's the case, then try to kill it so the + # shutdown process can continue. + $exportfs -ua 1>&2 & + waitfor_exportfs $! + eend $? "Error unexporting NFS directories" + fi + + stop_statd +} + +reload() { + # Exportfs likes to hang if networking isn't working. + # If that's the case, then try to kill it so the + # bootup process can continue. + ebegin "Reloading /etc/exports" + $exportfs -r 1>&2 & + waitfor_exportfs $! + eend $? "Error exporting NFS directories" +} + +restart() { + # See long comment in stop() regarding "restarting" and exportfs -ua + restarting=yes + svc_stop + svc_start +} diff --git a/net-fs/nfs-utils/files/nfs.confd b/net-fs/nfs-utils/files/nfs.confd index 51089dabbdf9..fef0151232df 100644 --- a/net-fs/nfs-utils/files/nfs.confd +++ b/net-fs/nfs-utils/files/nfs.confd @@ -1,3 +1,7 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfs.confd,v 1.5 2004/06/12 00:19:08 vapier Exp $ + # Config file for /etc/init.d/nfs # Number of servers to be started up by default @@ -10,3 +14,6 @@ RPCMOUNTDOPTS="" # Options to pass to rpc.statd # ex. RPCSTATDOPTS="-p 32765 -o 32766" RPCSTATDOPTS="" + +# Timeout (in seconds) for exportfs +EXPORTFSTIMEOUT=30 diff --git a/net-fs/nfs-utils/nfs-utils-1.0.6-r2.ebuild b/net-fs/nfs-utils/nfs-utils-1.0.6-r2.ebuild deleted file mode 100644 index e66186d5be1d..000000000000 --- a/net-fs/nfs-utils/nfs-utils-1.0.6-r2.ebuild +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 1999-2004 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/nfs-utils-1.0.6-r2.ebuild,v 1.1 2004/06/08 19:04:04 vapier Exp $ - -inherit gnuconfig - -DESCRIPTION="NFS client and server daemons" -HOMEPAGE="http://nfs.sourceforge.net/" -SRC_URI="mirror://sourceforge/nfs/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~ppc ~sparc ~mips ~arm ~hppa ~amd64 ~ppc64 ~s390" -IUSE="tcpd" - -DEPEND="tcpd? ( sys-apps/tcp-wrappers )" -RDEPEND="${DEPEND} - >=net-nds/portmap-5b-r6 - >=sys-apps/util-linux-2.11f" - -src_compile() { - use ppc64 && gnuconfig_update - econf \ - --mandir=/usr/share/man \ - --with-statedir=/var/lib/nfs \ - --disable-rquotad \ - --enable-nfsv3 \ - || die "Configure failed" - - if ! use tcpd; then - sed -i "s:\(-lwrap\|-DHAVE_TCP_WRAPPER\)::" config.mk - fi - - # parallel make still fails - emake -j1 || die "Failed to compile" -} - -src_install() { - make install install_prefix=${D} MANDIR=${D}/usr/share/man \ - || die "Failed to install" - - # Don't overwrite existing xtab/etab, install the original - # versions somewhere safe... more info in pkg_postinst - dodir /usr/lib/nfs - mv ${D}/var/lib/nfs/* ${D}/usr/lib/nfs - keepdir /var/lib/nfs - keepdir /var/lib/nfs/v4root - - # Install some client-side binaries in /sbin - dodir /sbin - mv ${D}/usr/sbin/rpc.{lockd,statd} ${D}/sbin - - dodoc ChangeLog README - docinto linux-nfs ; dodoc linux-nfs/* - - insinto /etc ; doins ${FILESDIR}/exports - - exeinto /etc/init.d - newexe ${FILESDIR}/nfs-4 nfs - newexe ${FILESDIR}/nfsmount nfsmount - - insinto /etc/conf.d - newins ${FILESDIR}/nfs.confd nfs -} - -pkg_postinst() { - # Install default xtab and friends if there's none existing. - # In src_install we put them in /usr/lib/nfs for safe-keeping, but - # the daemons actually use the files in /var/lib/nfs. This fixes - # bug 30486 - local f - for f in ${ROOT}/usr/lib/nfs/*; do - [[ -f ${ROOT}/var/lib/nfs/${f##*/} ]] && continue - einfo "Copying default ${f##*/} from /usr/lib/nfs to /var/lib/nfs" - cp -a ${f} ${ROOT}/var/lib/nfs/ - done - - echo - einfo "NFS V2 and V3 servers now default to \"sync\" IO if ${P}" - einfo "(or later) is installed." - einfo "More info at ${HOMEPAGE} (see questions 5, 12, 13, and 14)." - echo - einfo "If you plan on using NFS V4 then you should emerge the idmapd" - einfo "package now." - echo - ewarn "PLEASE note: Since the latest NFS utils has changed the server" - ewarn "default to \"sync\" IO, then if no behavior is specified in the" - ewarn "export list, thus assuming the default behavior, a warning will" - ewarn "be generated at export time." - echo -} diff --git a/net-fs/nfs-utils/nfs-utils-1.0.6-r3.ebuild b/net-fs/nfs-utils/nfs-utils-1.0.6-r3.ebuild new file mode 100644 index 000000000000..c3b795fbbe85 --- /dev/null +++ b/net-fs/nfs-utils/nfs-utils-1.0.6-r3.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/nfs-utils-1.0.6-r3.ebuild,v 1.1 2004/06/12 00:19:08 vapier Exp $ + +inherit gnuconfig + +DESCRIPTION="NFS client and server daemons" +HOMEPAGE="http://nfs.sourceforge.net/" +SRC_URI="mirror://sourceforge/nfs/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc ~mips ~arm ~hppa ~amd64 ~ppc64 ~s390" +IUSE="tcpd" + +DEPEND="tcpd? ( sys-apps/tcp-wrappers )" +RDEPEND="${DEPEND} + >=net-nds/portmap-5b-r6 + >=sys-apps/util-linux-2.11f" + +src_compile() { + gnuconfig_update + econf \ + --mandir=/usr/share/man \ + --with-statedir=/var/lib/nfs \ + --disable-rquotad \ + --enable-nfsv3 \ + --enable-secure-statd \ + || die "Configure failed" + + if ! use tcpd; then + sed -i "s:\(-lwrap\|-DHAVE_TCP_WRAPPER\)::" config.mk + fi + + # parallel make fails for depend target + make depend || die "failed to make depend" + emake || die "Failed to compile" +} + +src_install() { + make install install_prefix=${D} MANDIR=${D}/usr/share/man \ + || die "Failed to install" + + # Don't overwrite existing xtab/etab, install the original + # versions somewhere safe... more info in pkg_postinst + dodir /usr/lib/nfs + keepdir /var/lib/nfs/{sm,sm.bak} + mv ${D}/var/lib/nfs/* ${D}/usr/lib/nfs + keepdir /var/lib/nfs + keepdir /var/lib/nfs/v4root + + # Install some client-side binaries in /sbin + dodir /sbin + mv ${D}/usr/sbin/rpc.{lockd,statd} ${D}/sbin + + dodoc ChangeLog README + docinto linux-nfs ; dodoc linux-nfs/* + + insinto /etc ; doins ${FILESDIR}/exports + + exeinto /etc/init.d + newexe ${FILESDIR}/nfs-5 nfs + newexe ${FILESDIR}/nfsmount nfsmount + + insinto /etc/conf.d + newins ${FILESDIR}/nfs.confd nfs +} + +pkg_postinst() { + # Install default xtab and friends if there's none existing. + # In src_install we put them in /usr/lib/nfs for safe-keeping, but + # the daemons actually use the files in /var/lib/nfs. This fixes + # bug 30486 + local f + for f in ${ROOT}/usr/lib/nfs/*; do + [[ -f ${ROOT}/var/lib/nfs/${f##*/} ]] && continue + einfo "Copying default ${f##*/} from /usr/lib/nfs to /var/lib/nfs" + cp -a ${f} ${ROOT}/var/lib/nfs/ + done + + echo + einfo "NFS V2 and V3 servers now default to \"sync\" IO if ${P}" + einfo "(or later) is installed." + einfo "More info at ${HOMEPAGE} (see questions 5, 12, 13, and 14)." + echo + einfo "If you plan on using NFS V4 then you should emerge the idmapd" + einfo "package now." + echo + ewarn "PLEASE note: Since the latest NFS utils has changed the server" + ewarn "default to \"sync\" IO, then if no behavior is specified in the" + ewarn "export list, thus assuming the default behavior, a warning will" + ewarn "be generated at export time." + echo +} -- cgit v1.2.3-65-gdbad