From 9f392cc1b6e39b4cde757e18aa8259f2724e41fe Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Tue, 28 Oct 2008 16:09:59 -0500
Subject: Add nfs-utils and related programs

---
 abs/core-testing/libevent/PKGBUILD               |  22 ++++++
 abs/core-testing/nfs-utils/PKGBUILD              |  48 ++++++++++++
 abs/core-testing/nfs-utils/exports               |   8 ++
 abs/core-testing/nfs-utils/nfs-utils.install     |  38 ++++++++++
 abs/core-testing/nfs-utils/nfs.conf.d            |  20 +++++
 abs/core-testing/nfs-utils/nfsd                  |  91 +++++++++++++++++++++++
 abs/core-testing/nfs-utils/nfslock               |  50 +++++++++++++
 abs/core-testing/nfs-utils/start-statd.patch     |  21 ++++++
 abs/core-testing/nfsidmap/PKGBUILD               |  26 +++++++
 abs/core-testing/portmap/PKGBUILD                |  24 ++++++
 abs/core-testing/portmap/gcc3-errno_h.patch      |  18 +++++
 abs/core-testing/portmap/portmap                 |  38 ++++++++++
 abs/core-testing/portmap/portmap_5beta.patch.bz2 | Bin 0 -> 9958 bytes
 13 files changed, 404 insertions(+)
 create mode 100644 abs/core-testing/libevent/PKGBUILD
 create mode 100644 abs/core-testing/nfs-utils/PKGBUILD
 create mode 100644 abs/core-testing/nfs-utils/exports
 create mode 100644 abs/core-testing/nfs-utils/nfs-utils.install
 create mode 100644 abs/core-testing/nfs-utils/nfs.conf.d
 create mode 100755 abs/core-testing/nfs-utils/nfsd
 create mode 100755 abs/core-testing/nfs-utils/nfslock
 create mode 100644 abs/core-testing/nfs-utils/start-statd.patch
 create mode 100644 abs/core-testing/nfsidmap/PKGBUILD
 create mode 100644 abs/core-testing/portmap/PKGBUILD
 create mode 100644 abs/core-testing/portmap/gcc3-errno_h.patch
 create mode 100755 abs/core-testing/portmap/portmap
 create mode 100644 abs/core-testing/portmap/portmap_5beta.patch.bz2

diff --git a/abs/core-testing/libevent/PKGBUILD b/abs/core-testing/libevent/PKGBUILD
new file mode 100644
index 0000000..265699f
--- /dev/null
+++ b/abs/core-testing/libevent/PKGBUILD
@@ -0,0 +1,22 @@
+# $Id: PKGBUILD 13094 2008-09-25 22:07:09Z ronald $
+# Maintainer: 
+# Contributor: Judd <jvinet@zeroflux.org>
+
+pkgname=libevent
+pkgver=1.4.8
+pkgrel=2
+pkgdesc="a mechanism to execute a callback function"
+license=('GPL2')
+arch=('i686' 'x86_64')
+url="http://www.monkey.org/~provos/libevent/"
+depends=('glibc')
+source=(http://www.monkey.org/~provos/libevent-$pkgver-stable.tar.gz)
+options=(!libtool)
+md5sums=('e626c34f86746dffe8d055af0a84d08e')
+
+build() {
+  cd $srcdir/$pkgname-$pkgver-stable
+  ./configure --prefix=/usr --sysconfdir=/etc
+  make || return 1
+  make DESTDIR=$pkgdir install || return 1
+}
diff --git a/abs/core-testing/nfs-utils/PKGBUILD b/abs/core-testing/nfs-utils/PKGBUILD
new file mode 100644
index 0000000..32626c6
--- /dev/null
+++ b/abs/core-testing/nfs-utils/PKGBUILD
@@ -0,0 +1,48 @@
+# $Id: PKGBUILD 13100 2008-09-25 22:15:28Z ronald $
+# Maintainer: dorphell <dorphell@archlinux.org>
+# Contributor: John Proctor <jproctor@prium.net>
+# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
+
+pkgname=nfs-utils
+pkgver=1.1.3
+pkgrel=2
+pkgdesc="Support programs for Network File Systems"
+arch=('i686' 'x86_64')
+url='http://nfs.sourceforge.net'
+license=('GPL')
+backup=('etc/exports' 'etc/conf.d/nfs')
+depends=('glibc' 'tcp_wrappers' 'e2fsprogs' 'portmap' 'nfsidmap' 'libevent>=1.3e')
+source=(http://downloads.sourceforge.net/nfs/${pkgname}-${pkgver}.tar.gz
+	nfsd
+	nfslock
+	exports
+	nfs.conf.d
+	start-statd.patch)
+install=nfs-utils.install
+md5sums=('167d231850b00c7c63300747aeb94c38'
+         '5a9436e492e68efaf801b9c496684541'
+         '5d0d31f27f2319747d4499df11485ae7'
+         '1358d29a549dfc37b522c35e823c6813'
+         'b4aae6963ec25d226eb2d97214f5bb18'
+         '9c8aeff40ca25312328afe3b7fad293f')
+
+build() {
+  cd $srcdir/${pkgname}-${pkgver}
+  
+  # arch specific patch
+  patch -Np0 -i ../start-statd.patch || return 1
+  
+  ./configure --prefix=/usr --enable-nfsv3 --disable-gss \
+    --with-statedir=/var/lib/nfs --sysconfdir=/etc
+  
+  make || return 1
+  make DESTDIR=$pkgdir install || return 1
+
+  install -D -m 755 ../nfsd ${startdir}/pkg/etc/rc.d/nfsd
+  install -D -m 755 ../nfslock ${startdir}/pkg/etc/rc.d/nfslock
+  install -D -m 644 ../exports ${startdir}/pkg/etc/exports
+  install -D -m 644 ../nfs.conf.d ${startdir}/pkg/etc/conf.d/nfs
+  
+  install -d $pkgdir/var/lib/nfs/v4recovery
+}
+
diff --git a/abs/core-testing/nfs-utils/exports b/abs/core-testing/nfs-utils/exports
new file mode 100644
index 0000000..c9f93c6
--- /dev/null
+++ b/abs/core-testing/nfs-utils/exports
@@ -0,0 +1,8 @@
+# /etc/exports
+#
+# See exports(5) for a description.
+
+# use exportfs -arv to reread
+#/export    192.168.1.10(rw,no_root_squash)
+
+
diff --git a/abs/core-testing/nfs-utils/nfs-utils.install b/abs/core-testing/nfs-utils/nfs-utils.install
new file mode 100644
index 0000000..380fc99
--- /dev/null
+++ b/abs/core-testing/nfs-utils/nfs-utils.install
@@ -0,0 +1,38 @@
+
+
+post_install() {
+  cat << 'EOM'
+  
+  ==>
+  ==> PLEASE NOTE:
+  ==> Extended configuration options for NFS are available in
+  ==> /etc/conf.d/nfs.
+  ==>
+  ==> Please refer to http://wiki.archlinux.org/index.php/Nfs
+  ==> for further information.
+  ==>
+
+EOM
+}
+
+post_upgrade() {
+  cat << 'EOM'
+  
+  ==>
+  ==> PLEASE NOTE:
+  ==> Extended configuration options for NFS are now available in
+  ==> /etc/conf.d/nfs.
+  ==> If /etc/conf.d/nfsd remains on your system from an earlier
+  ==> installation, transfer its settings to /etc/conf.d/nfs and
+  ==> delete it.
+  ==>
+  ==> Please refer to http://wiki.archlinux.org/index.php/Nfs
+  ==> for further information.
+  ==>
+
+EOM
+}
+      
+op=$1
+shift
+$op $*
diff --git a/abs/core-testing/nfs-utils/nfs.conf.d b/abs/core-testing/nfs-utils/nfs.conf.d
new file mode 100644
index 0000000..73e396a
--- /dev/null
+++ b/abs/core-testing/nfs-utils/nfs.conf.d
@@ -0,0 +1,20 @@
+# Number of servers to be started up by default
+NFSD_OPTS=8
+
+# Options to pass to rpc.mountd
+# e.g. MOUNTDOPTS="-p 32767"
+MOUNTD_OPTS="--no-nfs-version 1 --no-nfs-version 2"
+
+# Options to pass to rpc.statd
+# N.B. statd normally runs on both client and server, and run-time
+# options should be specified accordingly. Specifically, the Arch
+# NFS init scripts require the --no-notify flag on the server,
+# but not on the client e.g.
+# STATD_OPTS="--no-notify -p 32765 -o 32766" -> server
+# STATD_OPTS="-p 32765 -o 32766" -> client
+STATD_OPTS=""
+
+# Options to pass to sm-notify
+# e.g. SMNOTIFY_OPTS="-p 32764"
+SMNOTIFY_OPTS=""
+
diff --git a/abs/core-testing/nfs-utils/nfsd b/abs/core-testing/nfs-utils/nfsd
new file mode 100755
index 0000000..ce891e2
--- /dev/null
+++ b/abs/core-testing/nfs-utils/nfsd
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+# source application-specific settings
+[ -f /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON_NAME=nfsd
+NFSD_PID=`pidof -o %PPID nfsd`
+MOUNTD_PID=`pidof -o %PPID /usr/sbin/rpc.mountd`
+case "$1" in
+  start)
+    stat_busy "Starting $DAEMON_NAME"
+    # Check for portmap
+    if [ ! -f /var/run/daemons/portmap ]; then 
+		echo "ERROR: portmap is not running"
+      stat_fail
+      exit 1
+    fi
+    # Check for nfslock
+    if [ ! -f /var/run/daemons/nfslock ]; then 
+		echo "ERROR: nfslock is not running"
+      stat_fail
+      exit 1
+    fi
+    # Check for /proc/fs/nfsd
+    if grep -qs nfsd /proc/filesystems ; then
+	if ! grep -qs "nfsd /proc/fs/nfsd" /proc/mounts ; then
+	    mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd
+	fi
+    fi
+    # Run exportfs
+    /usr/sbin/exportfs -r
+    # Run mountd
+    [ -z "$MOUNTD_PID" ] && /usr/sbin/rpc.mountd $MOUNTD_OPTS
+    if [ $? -gt 0 ]; then
+      stat_fail
+      exit 1
+    else
+      echo `pidof -o %PPID /usr/sbin/rpc.mountd` > /var/run/rpc.mountd.pid
+    fi
+    # Run nfsd
+    [ -z "$NFSD_PID" ] && /usr/sbin/rpc.nfsd $NFSD_OPTS
+    if [ $? -gt 0 ]; then
+      stat_fail
+      exit 1
+    else
+      echo `pidof -o %PPID nfsd` > /var/run/rpc.nfsd.pid
+    fi
+    # Run sm-notify
+    /usr/sbin/sm-notify $SMNOTIFY_OPTS
+    add_daemon $DAEMON_NAME
+    stat_done
+    ;;
+
+  stop)
+    stat_busy "Stopping $DAEMON_NAME"
+    [ ! -z "$MOUNTD_PID" ]  && kill $MOUNTD_PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+      exit 1
+    else
+      rm /var/run/rpc.mountd.pid &> /dev/null
+    fi
+    sleep 1
+    [ ! -z "$NFSD_PID" ]  && kill $NFSD_PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+      exit 1
+    else
+      kill -9 $NFSD_PID &> /dev/null
+      rm /var/run/rpc.nfsd.pid &> /dev/null
+    fi
+    if [ "$RUNLEVEL" = "0" ]; then
+      /usr/sbin/exportfs -au
+    fi
+    rm_daemon $DAEMON_NAME
+    stat_done
+    ;;
+
+  restart)
+    $0 stop
+    sleep 2
+    $0 start
+    ;;
+
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0
diff --git a/abs/core-testing/nfs-utils/nfslock b/abs/core-testing/nfs-utils/nfslock
new file mode 100755
index 0000000..f25ab3c
--- /dev/null
+++ b/abs/core-testing/nfs-utils/nfslock
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# source application-specific settings
+[ -f /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON_NAME=nfslock
+PID=`pidof -o %PPID /usr/sbin/rpc.statd`
+case "$1" in
+  start)
+    stat_busy "Starting $DAEMON_NAME"
+    # Check for /proc/fs/nfsd
+    if grep -qs nfsd /proc/filesystems ; then
+        if ! grep -qs "nfsd /proc/fs/nfsd" /proc/mounts ; then
+            mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd
+        fi
+    fi
+    [ -z "$PID" ] && /usr/sbin/rpc.statd $STATD_OPTS
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      echo `pidof rpc.statd` > /var/run/rpc.statd.pid
+      stat_done
+      add_daemon $DAEMON_NAME
+    fi
+    ;;
+
+  stop)
+    stat_busy "Stopping $DAEMON_NAME"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm /var/run/rpc.statd.pid &> /dev/null
+      rm_daemon $DAEMON_NAME
+      stat_done
+    fi
+    ;;
+
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0
diff --git a/abs/core-testing/nfs-utils/start-statd.patch b/abs/core-testing/nfs-utils/start-statd.patch
new file mode 100644
index 0000000..aaed93e
--- /dev/null
+++ b/abs/core-testing/nfs-utils/start-statd.patch
@@ -0,0 +1,21 @@
+--- utils/statd/start-statd	2007-05-11 04:40:57.000000000 +0100
++++ utils/statd/start-statd.new	2007-09-21 17:11:34.000000000 +0100
+@@ -1,9 +1,16 @@
+ #!/bin/sh
++
++# Original script provided by the NFS project
++# Modified for Arch Linux by Tom Killian
++
+ # nfsmount calls this script when mounting a filesystem with locking
+ # enabled, but when statd does not seem to be running (based on
+ # /var/run/rpc.statd.pid).
+ # It should run run statd with whatever flags are apropriate for this
+ # site.
+-PATH=/sbin:/usr/sbin
+-exec rpc.statd --no-notify
++
++# source application-specific settings
++[ -f /etc/conf.d/nfs ] && . /etc/conf.d/nfs
++
++exec /usr/sbin/rpc.statd $STATD_OPTS
+ 
diff --git a/abs/core-testing/nfsidmap/PKGBUILD b/abs/core-testing/nfsidmap/PKGBUILD
new file mode 100644
index 0000000..401c1e7
--- /dev/null
+++ b/abs/core-testing/nfsidmap/PKGBUILD
@@ -0,0 +1,26 @@
+# $Id: PKGBUILD 13097 2008-09-25 22:11:54Z ronald $
+# Maintainer: 
+# Contributor: Judd <jvinet@zeroflux.org>
+
+pkgname=nfsidmap
+pkgver=0.21
+pkgrel=2
+pkgdesc="Library to help mapping IDs, mainly for NFSv4"
+arch=('i686' 'x86_64')
+url="http://www.citi.umich.edu/projects/nfsv4/linux/"
+depends=('glibc' 'libldap')
+license=('custom:nfsidmap')
+options=(!libtool)
+source=(http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/libnfsidmap-$pkgver.tar.gz)
+md5sums=('56b05e30645353befbf73bd905270d4b')
+
+build() {
+  cd $srcdir/lib$pkgname-$pkgver
+  ./configure --prefix=/usr --sysconfdir=/etc
+  make || return 1
+  make DESTDIR=$pkgdir install || return 1
+
+  # install license
+  install -Dm644 COPYING \
+	$pkgdir/usr/share/licenses/nfsidmap/LICENSE || return 1
+}
diff --git a/abs/core-testing/portmap/PKGBUILD b/abs/core-testing/portmap/PKGBUILD
new file mode 100644
index 0000000..dc51a0c
--- /dev/null
+++ b/abs/core-testing/portmap/PKGBUILD
@@ -0,0 +1,24 @@
+# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $
+# Maintainer: dorphell <dorphell@archlinux.org>
+# Committer: Judd Vinet <jvinet@zeroflux.org>
+pkgname=portmap
+pkgver=6.0
+pkgrel=2
+pkgdesc="RPC connection manager"
+arch=(i686 x86_64)
+depends=('glibc')
+url="http://neil.brown.name/portmap/"
+license=('GPL')
+source=(http://neil.brown.name/portmap/portmap-6.0.tgz portmap)
+md5sums=('ac108ab68bf0f34477f8317791aaf1ff'
+         'ec37d014a47adc39e52e4bf31bf2a19a')
+
+build() {
+  cd $startdir/src/portmap_$pkgver
+  make || return 1
+  mkdir -p $startdir/pkg/sbin
+  mkdir -p $startdir/pkg/usr/share/man/man8
+  make BASEDIR=$startdir/pkg install
+  mkdir -p $startdir/pkg/etc/rc.d
+  cp ../portmap $startdir/pkg/etc/rc.d
+}
diff --git a/abs/core-testing/portmap/gcc3-errno_h.patch b/abs/core-testing/portmap/gcc3-errno_h.patch
new file mode 100644
index 0000000..a440e61
--- /dev/null
+++ b/abs/core-testing/portmap/gcc3-errno_h.patch
@@ -0,0 +1,18 @@
+--- portmap_5beta/portmap.c.orig	2002-12-31 22:13:17.000000000 +0200
++++ portmap_5beta/portmap.c	2002-12-31 22:13:50.000000000 +0200
+@@ -97,6 +97,7 @@
+ 
+ extern char *strerror();
+ #include <stdlib.h>
++#include <errno.h>
+ 
+ #ifndef LOG_PERROR
+ #define LOG_PERROR 0
+@@ -124,7 +125,6 @@
+ static void callit();
+ struct pmaplist *pmaplist;
+ int debugging = 0;
+-extern int errno;
+ 
+ #include "pmap_check.h"
+ 
diff --git a/abs/core-testing/portmap/portmap b/abs/core-testing/portmap/portmap
new file mode 100755
index 0000000..fb83a0a
--- /dev/null
+++ b/abs/core-testing/portmap/portmap
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /sbin/portmap`
+case "$1" in
+  start)
+    stat_busy "Starting Portmap"
+    [ -z "$PID" ] && /sbin/portmap
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      echo $PID > /var/run/portmap.pid
+      add_daemon portmap
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping Portmap"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm /var/run/portmap.pid
+      rm_daemon portmap
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0
diff --git a/abs/core-testing/portmap/portmap_5beta.patch.bz2 b/abs/core-testing/portmap/portmap_5beta.patch.bz2
new file mode 100644
index 0000000..ecaf95e
Binary files /dev/null and b/abs/core-testing/portmap/portmap_5beta.patch.bz2 differ
-- 
cgit v0.12