diff options
author | Donny Davies <woodchip@gentoo.org> | 2002-01-26 01:03:32 +0000 |
---|---|---|
committer | Donny Davies <woodchip@gentoo.org> | 2002-01-26 01:03:32 +0000 |
commit | be1c10821e90558dfee7d62778fefc445092eb46 (patch) | |
tree | 167aca2eb4a63d5aaa2aaf00975d526e6a01a138 /net-fs | |
parent | fix java compile problem .. karltk, did you uncomment that line? ... tested it ? (diff) | |
download | gentoo-2-be1c10821e90558dfee7d62778fefc445092eb46.tar.gz gentoo-2-be1c10821e90558dfee7d62778fefc445092eb46.tar.bz2 gentoo-2-be1c10821e90558dfee7d62778fefc445092eb46.zip |
This verson installs an rc6 compatible initscript into the right place.
Slightly cleaned the ebuild, cosmetic-wise.
Diffstat (limited to 'net-fs')
-rw-r--r-- | net-fs/autofs/autofs-3.1.7-r2.ebuild | 43 | ||||
-rw-r--r-- | net-fs/autofs/files/autofs.rc6 | 129 | ||||
-rw-r--r-- | net-fs/autofs/files/digest-autofs-3.1.7-r2 | 1 |
3 files changed, 173 insertions, 0 deletions
diff --git a/net-fs/autofs/autofs-3.1.7-r2.ebuild b/net-fs/autofs/autofs-3.1.7-r2.ebuild new file mode 100644 index 000000000000..f0e6f9d6cbe5 --- /dev/null +++ b/net-fs/autofs/autofs-3.1.7-r2.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author: Achim Gottinger <achim@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/autofs-3.1.7-r2.ebuild,v 1.1 2002/01/26 01:03:32 woodchip Exp $ + +S=${WORKDIR}/${P} +DESCRIPTION="Automounter" +SRC_URI="ftp://ftp.kernel.org/pub/linux/daemons/autofs/${P}.tar.bz2 + ftp://ftp.de.kernel.org/pub/linux/daemons/autofs/${P}.tar.bz2 + ftp://ftp.uk.kernel.org/pub/linux/daemons/autofs/${P}.tar.bz2" +DEPEND="virtual/glibc ldap? ( ~net-nds/openldap-1.2 )" + +src_unpack() { + unpack ${A} ; cd ${S}/include + patch -p0 < ${FILESDIR}/automount.diff || die +} + +src_compile() { + local myconf + use ldap || myconf="--without-openldap" + ./configure --host=${HOST} --prefix=/usr ${myconf} || die + emake || die +} + +src_install() { + into /usr + dosbin daemon/automount + insinto /usr/lib/autofs + insopts -m 755 + doins modules/*.so + + dodoc COPYING COPYRIGHT NEWS README* TODO + cd man + doman auto.master.5 autofs.5 autofs.8 automount.8 + + cd ../samples + dodir /etc/autofs + cp ${FILESDIR}/auto.master ${D}/etc/autofs + cp ${FILESDIR}/auto.misc ${D}/etc/autofs + + dodir /etc/init.d + cp ${FILESDIR}/autofs ${D}/etc/init.d +} diff --git a/net-fs/autofs/files/autofs.rc6 b/net-fs/autofs/files/autofs.rc6 new file mode 100644 index 000000000000..d8fd1a7337de --- /dev/null +++ b/net-fs/autofs/files/autofs.rc6 @@ -0,0 +1,129 @@ +#!/sbin/runscript +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs.rc6,v 1.1 2002/01/26 01:03:32 woodchip Exp $ + +# rc file for automount using a Sun-style "master map". +# We first look for a local /etc/auto.master, then a YP +# map with that name + +depend() { + need net +} + +opts="start stop status reload" + +# +# This function will build a list of automount commands to execute in +# order to activate all the mount points. It is used to figure out +# the difference of automount points in case of a reload +# +getmounts() { +# +# Check for local maps to be loaded +# +if [ -f /etc/autofs/auto.master ] +then + cat /etc/autofs/auto.master | sed -e '/^#/d' -e '/^$/d'| ( + while read dir map options + do + if [ ! -z "$dir" -a ! -z "$map" \ + -a x`echo "$map" | cut -c1` != 'x-' ] + then + map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'` + options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` + if [ -x $map ]; then + echo "/usr/sbin/automount $dir program $map $options $localoptions" + elif [ -f $map ]; then + echo "/usr/sbin/automount $dir file $map $options $localoptions" + else + echo "/usr/sbin/automount $dir `basename $map` $options $localoptions" + fi + fi + done + ) +fi + +# +# Check for YellowPage maps to be loaded +# +if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ] +then + ypcat -k auto.master | ( + while read dir map options + do + if [ ! -z "$dir" -a ! -z "$map" \ + -a x`echo "$map" | cut -c1` != 'x-' ] + then + map=`echo "$map" | sed -e 's/^auto_/auto./'` + if echo $options | grep -- '-t' >/dev/null 2>&1 ; then + mountoptions="--timeout $(echo $options | \ + sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')" + fi + options=`echo "$options" | sed -e ' + s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g + s/\(^\|[ \t]\)-/\1/g'` + echo "/usr/sbin/automount $dir yp $map $options $localoptions" + fi + done + ) +fi +} + +start() { + ebegin "Starting automounter" + getmounts | while read cmd mnt rest + do + echo -n " $mnt" + pidfile=/var/run/autofs`echo $mnt | sed 's/\//./'`.pid + start-stop-daemon --start --pidfile $pidfile --quiet \ + --exec /usr/sbin/automount -- $mnt $rest + # + # Automount needs a '--pidfile' or '-p' option. + # For now we look for the pid ourself. + # + ps ax | grep "[0-9]:[0-9][0-9] /usr/sbin/automount $mnt" | ( + read pid rest + echo $pid > $pidfile + echo "$mnt $rest" >> $pidfile + ) + done + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet --signal 12 --exec /usr/sbin/automount + eend $? +} + +status() { + echo "Configured Mount Points:" + echo "------------------------" + getmounts + echo "" + echo "Active Mount Points:" + echo "--------------------" + ps ax|grep "[0-9]:[0-9][0-9] automount " | ( + while read pid tt stat time command; do echo $command; done + ) +} + +reload() { + echo "Reloading automounter: checking for changes ... " + TMP=/var/run/autofs.tmp + getmounts >$TMP + for i in /var/run/autofs.*.pid + do + pid=`head -n 1 $i 2>/dev/null` + [ "$pid" = "" ] && continue + command=`tail +2 $i` + if ! grep -q "^$command" $TMP + then + echo "Stopping automounter: $command" + kill -USR2 $pid + fi + done + rm -f $TMP + svc_start +} diff --git a/net-fs/autofs/files/digest-autofs-3.1.7-r2 b/net-fs/autofs/files/digest-autofs-3.1.7-r2 new file mode 100644 index 000000000000..cce451a9a175 --- /dev/null +++ b/net-fs/autofs/files/digest-autofs-3.1.7-r2 @@ -0,0 +1 @@ +MD5 4f602f82442b48ce9c2e0005d59c3408 autofs-3.1.7.tar.bz2 57344 |