From 8c8a9fb90c606cd8fc852a60727291cf9dea051c Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 25 Aug 2000 17:38:47 +0000 Subject: [PATCH] Debian build support. --- ChangeLog | 6 ++ debian/changelog | 121 +++++++++++++++++++++++++++++ debian/control | 38 +++++++++ debian/copyright | 1 + debian/nfs-common.conffiles | 1 + debian/nfs-common.dirs | 4 + debian/nfs-common.files | 5 ++ debian/nfs-common.init | 73 +++++++++++++++++ debian/nfs-common.postinst | 17 ++++ debian/nfs-common.postrm | 7 ++ debian/nfs-common.prerm | 7 ++ debian/nfs-kernel-server.conffiles | 1 + debian/nfs-kernel-server.dirs | 3 + debian/nfs-kernel-server.init | 83 ++++++++++++++++++++ debian/nfs-kernel-server.postinst | 29 +++++++ debian/nfs-kernel-server.postrm | 8 ++ debian/nfs-kernel-server.prerm | 7 ++ debian/nhfsstone.dirs | 1 + debian/nhfsstone.files | 2 + debian/nhfsstone.postinst | 9 +++ debian/nhfsstone.prerm | 5 ++ debian/rules | 77 ++++++++++++++++++ 22 files changed, 505 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/nfs-common.conffiles create mode 100644 debian/nfs-common.dirs create mode 100644 debian/nfs-common.files create mode 100755 debian/nfs-common.init create mode 100755 debian/nfs-common.postinst create mode 100755 debian/nfs-common.postrm create mode 100755 debian/nfs-common.prerm create mode 100644 debian/nfs-kernel-server.conffiles create mode 100644 debian/nfs-kernel-server.dirs create mode 100755 debian/nfs-kernel-server.init create mode 100755 debian/nfs-kernel-server.postinst create mode 100755 debian/nfs-kernel-server.postrm create mode 100755 debian/nfs-kernel-server.prerm create mode 100644 debian/nhfsstone.dirs create mode 100644 debian/nhfsstone.files create mode 100644 debian/nhfsstone.postinst create mode 100644 debian/nhfsstone.prerm create mode 100755 debian/rules diff --git a/ChangeLog b/ChangeLog index 2c70cdd..8b6e4af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ +2000-08-25 Chip Salzenberg + + * debian/*: Complete Debian build support. + * etc/debian/*: Remove. + 2000-08-24 Neil Brown + * support/export/client.c(client_check): removed the "dot+1" as a ypdomain argument to innetgr as this is entirely bogus. It should always be NULL. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f773143 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,121 @@ +nfs-utils (1:0.1.9.1-2) frozen unstable; urgency=medium + + * Upstream fixes from H.J. Lu and Neil Brown. + + -- Chip Salzenberg Wed, 25 Aug 2000 10:30:00 -0700 + +nfs-utils (1:0.1.9.1-1) frozen unstable; urgency=high + + * New upstream version, fixes more logging errors. + * Fix Debian distribution list. + + -- Chip Salzenberg Wed, 5 Jul 2000 15:00:00 -0800 + +nfs-utils (1:0.1.8.2-2) unstable; urgency=high + + * Fix serious logging error in statd. + + -- Chip Salzenberg Wed, 28 Jun 2000 23:00:00 -0800 + +nfs-utils (1:0.1.8.2-1) unstable; urgency=low + + * New upstream version. + * During startup, start daemons before running exportfs. + + -- Chip Salzenberg Wed, 28 Jun 2000 15:00:00 -0800 + +nfs-utils (1:0.1.8.1-1) unstable; urgency=medium + + * New upstream version. + * Chdir to / before spawning daemons. (closes: #60837, #64857) + * Follow policy for init messages. (closes: #59184, #65519) + + -- Chip Salzenberg Mon, 12 Jun 2000 22:30:00 -0800 + +nfs-utils (1:0.1.8-1) unstable; urgency=low + + * New upstream version. + + -- Chip Salzenberg Sun, 4 Jun 2000 13:30:00 -0800 + +nfs-utils (1:0.1.7.1-1) unstable; urgency=medium + + * New upstream version. + * Use fewer sockets in mountd by sharing RPC transports, + even when it is run without '-p'. + + -- Chip Salzenberg Sat, 29 Apr 2000 20:45:00 -0800 + +nfs-utils (1:0.1.6-3) frozen unstable; urgency=medium + + * Fix kernel server shutdown order: mountd, nfsd, exportfs. + * Upstream: Fix 'mountd -p'. Use fewer UDP sockets + by sharing RPC transports. Display more mount flags. + + -- Chip Salzenberg Mon, 13 Mar 2000 14:45:00 -0800 + +nfs-utils (1:0.1.6-2) frozen unstable; urgency=medium + + * Split off nhfsstone into its own package, since it has + helper scripts and most people won't use it. + * Also include nhfsstone's helpers: nhfs{run,nums,graph}. + * Install man page for nhfsstone. (closes: #55194) + * Always run lockd on non-module kernels. (closes: #57841) + * Make init scripts config files. (closes: #55193) + * Handle "force-reload" in nfs-common's init script. (ditto) + * Fix line numbers in error messages. (closes: #57717) + * Write man page for rpc.lockd. (closes: #55192) + * Fix typo in exports(5) man page. (closes: #46933) + * Add /usr/doc -> /usr/share doc links. (closes: #54983) + * Add copyright file. (closes: #55195) + * Refresh sources from upstream. + * Refine dependencies. + + -- Chip Salzenberg Sat, 26 Feb 2000 02:00:00 -0800 + +nfs-utils (1:0.1.6-1) unstable; urgency=high + + * New upstream version. + * Make nfs-kernel-server conflict with and replace knfs. + + -- Chip Salzenberg Wed, 12 Jan 2000 19:30:00 -0800 + +nfs-utils (1:0.1.5-2) unstable; urgency=high + + * Rename packages to "nfs-common" and "nfs-kernel-server". + (Previous package names were only temporary anyway.) + * Prepend "1:" to version, to override existing nfs-common. + * Remove rpc.rquotad -- it's already packaged in "quota". + + -- Chip Salzenberg Wed, 29 Dec 1999 17:00:00 -0800 + +nfs-utils (0.1.5-1) unstable; urgency=medium + + * New upstream version. + * Allow for some kernels not requiring rpc.lockd. + + -- Chip Salzenberg Sun, 19 Dec 1999 11:40:00 -0800 + +nfs-utils (0.1.4-1) unstable; urgency=low + + * New upstream version. + * Don't disable NFSv3 by default. + + -- Chip Salzenberg Fri, 10 Dec 1999 23:00:00 -0800 + +nfs-utils (0.1.3-2) unstable; urgency=low + + * Conflict with standard NFS packages. + + -- Chip Salzenberg Fri, 3 Dec 1999 22:00:00 -0800 + +nfs-utils (0.1.3-1) unstable; urgency=low + + * New upstream version. + * Start following CVS tree at SourceForge. + + -- Chip Salzenberg Fri, 3 Dec 1999 20:00:00 -0800 + +Local variables: +mode: debian-changelog +End: diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a45f291 --- /dev/null +++ b/debian/control @@ -0,0 +1,38 @@ +Source: nfs-utils +Priority: standard +Section: net +Maintainer: Chip Salzenberg +Standards-Version: 3.1.1.1 + +Package: nfs-kernel-server +Architecture: any +Depends: nfs-common (>= 1:0.1.5), ${shlibs:Depends} +Provides: knfs, nfs-server +Conflicts: knfs, nfs-server +Replaces: knfs, nfs-server +Description: Kernel NFS server support + Use this package if you have a fairly recent kernel (2.2.13 or better) + and you want to use the kernel-mode NFS server. The user-mode NFS + server in the "nfs-server" package is slower but more featureful and + easier to debug than the kernel-mode server. + . + Upstream: SourceForge project "nfs", CVS module nfs-utils. + +Package: nhfsstone +Architecture: any +Depends: nfs-common, ${shlibs:Depends} +Description: NFS benchmark program. + . + Upstream: SourceForge project "nfs", CVS module nfs-utils. + +Package: nfs-common +Architecture: any +Depends: ${shlibs:Depends} +Provides: nfs-client +Conflicts: nfs-client +Replaces: nfs-client +Description: NFS support files common to client and server + Use this package on any machine that does NFS either as client or + server. Programs included: lockd, statd, showmount, and nfsstat. + . + Upstream: SourceForge project "nfs", CVS module nfs-utils. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..2d75428 --- /dev/null +++ b/debian/copyright @@ -0,0 +1 @@ +The copyright of this package is GPL, version 2 or later. diff --git a/debian/nfs-common.conffiles b/debian/nfs-common.conffiles new file mode 100644 index 0000000..7ad0f45 --- /dev/null +++ b/debian/nfs-common.conffiles @@ -0,0 +1 @@ +/etc/init.d/nfs-common diff --git a/debian/nfs-common.dirs b/debian/nfs-common.dirs new file mode 100644 index 0000000..5e54201 --- /dev/null +++ b/debian/nfs-common.dirs @@ -0,0 +1,4 @@ +etc/init.d +sbin +usr/sbin +var/lib/nfs diff --git a/debian/nfs-common.files b/debian/nfs-common.files new file mode 100644 index 0000000..2a4dd89 --- /dev/null +++ b/debian/nfs-common.files @@ -0,0 +1,5 @@ +usr/sbin/nfsstat +usr/share/man/man8/*lockd* +usr/share/man/man8/*statd* +usr/share/man/man8/nfsstat* +usr/share/man/man8/showmount* diff --git a/debian/nfs-common.init b/debian/nfs-common.init new file mode 100755 index 0000000..a9dcb5d --- /dev/null +++ b/debian/nfs-common.init @@ -0,0 +1,73 @@ +#!/bin/sh +# +# nfs-common This shell script takes care of starting and stopping +# common daemons required for NFS clients and servers. +# +# chkconfig: 345 20 80 +# description: NFS is a popular protocol for file sharing across \ +# TCP/IP networks. This service provides NFS file \ +# locking functionality. +# + +PREFIX= + +NEED_LOCKD=yes +if test -f /proc/ksyms +then + # We need to be conservative and run lockd, + # unless we can prove that it isn't required. + grep -q lockdctl /proc/ksyms || NEED_LOCKD=no +fi + +[ -x $PREFIX/sbin/rpc.statd ] || exit 0 +[ -x $PREFIX/sbin/rpc.lockd ] || [ "$NEED_LOCKD" = no ] || exit 0 + +# What is this? +DESC="NFS common utilities" + +# Make sure that daemon cwds are in root fs. +cd / + +# See how we were called. +case "$1" in + start) + printf "Starting $DESC:" + printf " statd" + start-stop-daemon --start --quiet \ + --exec $PREFIX/sbin/rpc.statd + if [ "$NEED_LOCKD" = yes ] + then + printf " lockd" + start-stop-daemon --start --quiet \ + --exec $PREFIX/sbin/rpc.lockd + fi + echo "." + ;; + + stop) + printf "Stopping $DESC:" + if [ "$NEED_LOCKD" = yes ] + then + printf " lockd" + start-stop-daemon --stop --oknodo --quiet \ + --name lockd --user root --signal 9 + fi + printf " statd" + start-stop-daemon --stop --oknodo --quiet \ + --exec $PREFIX/sbin/rpc.statd + echo "." + ;; + + restart | force-reload) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "Usage: nfs-common {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/nfs-common.postinst b/debian/nfs-common.postinst new file mode 100755 index 0000000..9814bc5 --- /dev/null +++ b/debian/nfs-common.postinst @@ -0,0 +1,17 @@ +#!/bin/sh -e + +case "$1" in + configure) + test ! -d /usr/share/doc/nfs-common || + test -L /usr/doc/nfs-common || + ln -sf ../share/doc/nfs-common /usr/doc/nfs-common + + update-rc.d nfs-common defaults 19 81 >/dev/null 2>&1 + + /etc/init.d/nfs-common start + ;; + + *) + /etc/init.d/nfs-common start + ;; +esac diff --git a/debian/nfs-common.postrm b/debian/nfs-common.postrm new file mode 100755 index 0000000..31d0f79 --- /dev/null +++ b/debian/nfs-common.postrm @@ -0,0 +1,7 @@ +#!/bin/sh + +case "$1" in + purge) + update-rc.d nfs-common remove >/dev/null 2>&1 + ;; +esac diff --git a/debian/nfs-common.prerm b/debian/nfs-common.prerm new file mode 100755 index 0000000..fbdc65a --- /dev/null +++ b/debian/nfs-common.prerm @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -x /etc/init.d/nfs-common ] && /etc/init.d/nfs-common stop + +rm -f /usr/doc/nfs-common + +exit 0 diff --git a/debian/nfs-kernel-server.conffiles b/debian/nfs-kernel-server.conffiles new file mode 100644 index 0000000..804d5da --- /dev/null +++ b/debian/nfs-kernel-server.conffiles @@ -0,0 +1 @@ +/etc/init.d/nfs-kernel-server diff --git a/debian/nfs-kernel-server.dirs b/debian/nfs-kernel-server.dirs new file mode 100644 index 0000000..3378996 --- /dev/null +++ b/debian/nfs-kernel-server.dirs @@ -0,0 +1,3 @@ +etc/init.d +usr/sbin +var/lib/nfs diff --git a/debian/nfs-kernel-server.init b/debian/nfs-kernel-server.init new file mode 100755 index 0000000..1626213 --- /dev/null +++ b/debian/nfs-kernel-server.init @@ -0,0 +1,83 @@ +#!/bin/sh +# +# nfs-kernel-server +# This shell script takes care of starting and stopping +# the kernel-mode NFS server. +# +# chkconfig: 345 60 20 +# description: NFS is a popular protocol for file sharing across TCP/IP \ +# networks. This service provides NFS server functionality, \ +# which is configured via the /etc/exports file. +# + +PREFIX=/usr +[ -x $PREFIX/sbin/rpc.nfsd ] || exit 0 +[ -x $PREFIX/sbin/rpc.mountd ] || exit 0 +[ -x $PREFIX/sbin/exportfs ] || exit 0 + +# What is this? +DESC="NFS kernel daemon" + +RPCNFSDCOUNT=8 # Number of servers to be started up by default +RPCMOUNTDOPTS= + +# Make sure that daemon cwds are in root fs. +cd / + +# See how we were called. +case "$1" in + start) + if grep -q '^/' /etc/exports; then + printf "Exporting directories for $DESC..." + $PREFIX/sbin/exportfs -r + echo "done." + + printf "Starting $DESC:" + printf " nfsd" + start-stop-daemon --start --quiet \ + --exec $PREFIX/sbin/rpc.nfsd -- $RPCNFSDCOUNT + printf " mountd" + $PREFIX/bin/rpcinfo -u localhost nfs 3 > /dev/null 2>&1 || + RPCMOUNTDOPTS="$RPCMOUNDOPTS --no-nfs-version 3" + start-stop-daemon --start --quiet \ + --exec $PREFIX/sbin/rpc.mountd -- $RPCMOUNTDOPTS + echo "." + else + echo "Not starting $DESC: No exports." + fi + ;; + + stop) + printf "Stopping $DESC: mountd" + start-stop-daemon --stop --oknodo --quiet \ + --exec $PREFIX/sbin/rpc.mountd + printf " nfsd" + start-stop-daemon --stop --oknodo --quiet \ + --name nfsd --user root --signal 2 + echo "." + + printf "Unexporting directories for $DESC..." + $PREFIX/sbin/exportfs -au + echo "done." + ;; + + reload | force-reload) + printf "Re-exporting directories for $DESC..." + $PREFIX/sbin/exportfs -r + echo "done." + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "Usage: nfs-kernel-server {start|stop|reload|force-reload|restart}" + exit 1 + ;; +esac + +exit 0 + diff --git a/debian/nfs-kernel-server.postinst b/debian/nfs-kernel-server.postinst new file mode 100755 index 0000000..cc035fa --- /dev/null +++ b/debian/nfs-kernel-server.postinst @@ -0,0 +1,29 @@ +#!/bin/sh -e + +case "$1" in + configure) + test ! -d /usr/share/doc/nfs-kernel-server || + test -L /usr/doc/nfs-kernel-server || + ln -sf ../share/doc/nfs-kernel-server /usr/doc/nfs-kernel-server + + mkdir -p /var/lib/nfs + touch /var/lib/nfs/xtab /var/lib/nfs/etab /var/lib/nfs/rmtab + if test -s /etc/exports + then + : do nothing + else + cat </etc/exports +# /etc/exports: the access control list for filesystems which may be exported +# to NFS clients. See exports(5). +EOF + fi + + update-rc.d nfs-kernel-server defaults 20 80 >/dev/null 2>&1 + + /etc/init.d/nfs-kernel-server start + ;; + + *) + /etc/init.d/nfs-kernel-server start + ;; +esac diff --git a/debian/nfs-kernel-server.postrm b/debian/nfs-kernel-server.postrm new file mode 100755 index 0000000..eb6d5f2 --- /dev/null +++ b/debian/nfs-kernel-server.postrm @@ -0,0 +1,8 @@ +#!/bin/sh + +case "$1" in + purge) + update-rc.d nfs-kernel-server remove >/dev/null 2>&1 + ;; +esac + diff --git a/debian/nfs-kernel-server.prerm b/debian/nfs-kernel-server.prerm new file mode 100755 index 0000000..f4b4be3 --- /dev/null +++ b/debian/nfs-kernel-server.prerm @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -x /etc/init.d/nfs-kernel-server ] && /etc/init.d/nfs-kernel-server stop + +rm -f /usr/doc/nfs-kernel-server + +exit 0 diff --git a/debian/nhfsstone.dirs b/debian/nhfsstone.dirs new file mode 100644 index 0000000..236670a --- /dev/null +++ b/debian/nhfsstone.dirs @@ -0,0 +1 @@ +usr/sbin diff --git a/debian/nhfsstone.files b/debian/nhfsstone.files new file mode 100644 index 0000000..5d2c329 --- /dev/null +++ b/debian/nhfsstone.files @@ -0,0 +1,2 @@ +usr/sbin/nhfs* +usr/share/man/man8/nhfs* diff --git a/debian/nhfsstone.postinst b/debian/nhfsstone.postinst new file mode 100644 index 0000000..39c3096 --- /dev/null +++ b/debian/nhfsstone.postinst @@ -0,0 +1,9 @@ +#!/bin/sh -e + +case "$1" in + configure) + test ! -d /usr/share/doc/nhfsstone || + test -L /usr/doc/nhfsstone || + ln -sf ../share/doc/nhfsstone /usr/doc/nhfsstone + ;; +esac diff --git a/debian/nhfsstone.prerm b/debian/nhfsstone.prerm new file mode 100644 index 0000000..00a899e --- /dev/null +++ b/debian/nhfsstone.prerm @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -f /usr/doc/nhfsstone + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..9f46a9c --- /dev/null +++ b/debian/rules @@ -0,0 +1,77 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# You can use gcc 2.7.2 if it's installed, +# but I don't think that's necessary any more. +#SETGCC := CC=$(notdir $(shell which gcc272 gcc 2>/dev/null | sed '1q')) + +# Temporary root +DEBTMP := $(shell pwd)/debian/tmp + +build: build-stamp +build-stamp: + dh_testdir + # Add here commands to compile the package. + $(SETGCC) ./configure \ + --mandir='$${prefix}/share/man' \ + --enable-secure-statd + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + # Add here commands to clean up after the build process. + -$(MAKE) distclean + dh_clean + +# Build architecture-independent files here. +binary-indep: build +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + # Add here commands to install the files into debian/tmp + $(MAKE) install_prefix='$(DEBTMP)' install + dh_movefiles + # Fixups Start Here # + cd debian && \ + for f in rpc.lockd rpc.statd showmount; do \ + mv tmp/usr/sbin/$$f nfs-common/sbin/$$f; \ + done; \ + rm -f tmp/usr/sbin/*quota*; \ + rm -f tmp/usr/share/man/man8/*quota*; \ + rm -rf tmp/var/lib/nfs/* + # Fixups End Here # + dh_installdocs ChangeLog README + dh_installexamples +# dh_installmenu + dh_installinit -n +# dh_installcron +# dh_installmanpages +# dh_undocumented + dh_installchangelogs + dh_strip + dh_suidregister + dh_compress + dh_fixperms + dh_installdeb +# dh_makeshlibs + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary -- 2.39.5