summaryrefslogtreecommitdiff
path: root/net-fs
diff options
context:
space:
mode:
authorBrad Teaford Cowan <bcowan@gentoo.org>2002-11-18 02:00:18 +0000
committerBrad Teaford Cowan <bcowan@gentoo.org>2002-11-18 02:00:18 +0000
commitc4b4cf6a0da8bbdbfb560969066e010f435cf52f (patch)
treef168fc6424b45d921c95bd2234f5a5c7dfd0bb10 /net-fs
parentUpdated dependancies to include WindowMaker. See bug #10354 (diff)
downloadgentoo-2-c4b4cf6a0da8bbdbfb560969066e010f435cf52f.tar.gz
gentoo-2-c4b4cf6a0da8bbdbfb560969066e010f435cf52f.tar.bz2
gentoo-2-c4b4cf6a0da8bbdbfb560969066e010f435cf52f.zip
ldap fixes
Diffstat (limited to 'net-fs')
-rw-r--r--net-fs/autofs/ChangeLog9
-rw-r--r--net-fs/autofs/autofs-3.1.7-r5.ebuild72
-rw-r--r--net-fs/autofs/files/autofs.rc8204
-rw-r--r--net-fs/autofs/files/digest-autofs-3.1.7-r51
-rw-r--r--net-fs/autofs/files/ldap_config.patch25
5 files changed, 310 insertions, 1 deletions
diff --git a/net-fs/autofs/ChangeLog b/net-fs/autofs/ChangeLog
index 8d23868e3c71..1dea025d6aa0 100644
--- a/net-fs/autofs/ChangeLog
+++ b/net-fs/autofs/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-fsautofsChangeLog/
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.10 2002/10/27 05:21:15 bcowan Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.11 2002/11/18 02:00:18 bcowan Exp $
+
+*autofs-3.1.7-r5 (17 Nov 2002)
+
+ 17 Nov 2002; Brad Cowan <bcowan@gebtoo.org> autofs-3.1.7-r5.ebuild,
+ files/digest-autofs-3.1.7-r5, files/ldap_config.patch, files/autofs.rc8 :
+
+ More ldap fixes, init script still needs some tweaking.
*autofs-3.1.7-r4 (27 Oct 2002)
diff --git a/net-fs/autofs/autofs-3.1.7-r5.ebuild b/net-fs/autofs/autofs-3.1.7-r5.ebuild
new file mode 100644
index 000000000000..9a6c73575598
--- /dev/null
+++ b/net-fs/autofs/autofs-3.1.7-r5.ebuild
@@ -0,0 +1,72 @@
+# 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/autofs-3.1.7-r5.ebuild,v 1.1 2002/11/18 02:00:18 bcowan Exp $
+
+IUSE="ldap"
+
+S=${WORKDIR}/${P}
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+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="ldap? ( >=net-nds/openldap-1.2 )"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ patch -p0 < ${FILESDIR}/ldap_config.patch || die
+
+ cd ${S}/include
+ patch -p0 < ${FILESDIR}/automount.diff || die
+
+ cd ${S}/daemon
+ mv Makefile Makefile.orig
+ sed -e 's/LIBS \= \-ldl/LIBS \= \-ldl \-lnsl \$\{LIBLDAP\}/' Makefile.orig > Makefile
+}
+
+src_compile() {
+ local myconf
+ use ldap || myconf="--without-openldap"
+
+ ./configure \
+ --host=${HOST} \
+ --prefix=/usr \
+ ${myconf} || die
+ make || 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
+
+ exeinto /etc/init.d ; newexe ${FILESDIR}/autofs.rc8 autofs
+ insinto /etc/conf.d ; newins ${FILESDIR}/autofs.confd autofs
+}
+
+pkg_postinst() {
+
+ einfo "Note: If you plan on using autofs for automounting"
+ einfo "remote NFS mounts without having the NFS daemon running"
+ einfo "please add portmap to your default run-level."
+ echo ""
+ einfo "Also the normal autofs status has been renamed stats"
+ einfo "as there is already a predefined Gentoo status"
+} \ No newline at end of file
diff --git a/net-fs/autofs/files/autofs.rc8 b/net-fs/autofs/files/autofs.rc8
new file mode 100644
index 000000000000..7ec686a3a377
--- /dev/null
+++ b/net-fs/autofs/files/autofs.rc8
@@ -0,0 +1,204 @@
+#!/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.rc8,v 1.1 2002/11/18 02:00:18 bcowan 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
+
+DAEMON=/usr/sbin/automount
+
+depend() {
+ need net ypbind
+ use portmap
+}
+
+opts="start stop status stats reload restart"
+
+#
+# Check for all maps that are to be loaded
+#
+function getschemes()
+{
+ grep ^automount: /etc/nsswitch.conf | sed -e 's/^.*://' -e 's/\[.*\]/ /g'
+}
+
+function getfilemounts()
+{
+ if [ -f /etc/autofs/auto.master ] ; then
+ cat /etc/autofs/auto.master | sed -e '/^#/d' -e '/^$/d'
+ fi
+}
+
+function getnismounts()
+{
+ /usr/bin/ypcat -k auto.master 2> /dev/null | sed -e '/^#/d' -e '/^$/d'
+}
+
+function getldapmounts()
+{
+ if [ -x /usr/lib/autofs/autofs-ldap-auto-master ]; then
+ /usr/lib/autofs/autofs-ldap-auto-master 2> /dev/null
+ fi
+}
+
+function getrawmounts()
+{
+ for scheme in `getschemes` ; do
+ case "$scheme" in
+ files)
+ getfilemounts
+ ;;
+ nis*)
+ getnismounts
+ ;;
+ ldap*)
+ getldapmounts
+ ;;
+ esac
+ done
+}
+
+
+#
+# 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
+#
+function getmounts()
+{
+ knownmaps=" "
+ getrawmounts | (
+ while read dir map options
+ do
+ # These checks screen out duplicates and skip over directories
+ # where the map is '-'.
+ if [ ! -z "$dir" -a ! -z "$map" \
+ -a x`echo "$map" | cut -c1` != 'x-' \
+ -a "`echo "$knownmaps" | grep $dir/`" = "" ]
+ then
+ # If the options include a -t or --timeout parameter, then
+ # pull those particular options out.
+ # echo DAEMONOPTIONS OPTIONS $daemonoptions $options
+ startupoptions=
+ if echo $options | grep -q -- '-t' ; then
+ startupoptions="--timeout $(echo $daemonoptions $options | \
+ sed 's/.*--*t\(imeout\)*[ \t=]*\([0-9][0-9]*\).*$/\2/g')"
+ fi
+ # Other option flags are intended for maps.
+ mapoptions="$(echo "$daemonoptions $options" |\
+ sed 's/--*t\(imeout\)*[ \t=]*\([0-9][0-9]*\)//g')"
+ # Break up the maptype and map, if the map type is specified
+ maptype=`echo $map | cut -f1 -d:`
+ # Handle degenerate map specifiers
+ if [ "$maptype" = "$map" ] ; then
+ if [ -x "$map" ]; then
+ maptype=program
+ elif [ -x "/etc/$map" ]; then
+ maptype=program
+ map=`echo /etc/$map | sed 's^//^/^g'`
+ elif [ -f "$map" ]; then
+ maptype=file
+ elif [ -f "/etc/$map" ]; then
+ maptype=file
+ map=`echo /etc/$map | sed 's^//^/^g'`
+ elif [ "$map" = "hesiod" -o "$map" = "userhome" ] ; then
+ maptype=$map
+ map=
+ elif [ "$map" = "multi" ] ; then
+ maptype=$map
+ map=
+ else
+ maptype=yp
+ map=`basename $map | sed -e s/^auto_home/auto.home/ -e s/^auto_mnt/auto.mnt/`
+ fi
+ fi
+ map=`echo $map | cut -f2- -d:`
+
+ echo STARTUPOPTIONS $startupoptions > /tmp/debug
+ echo DIR $dir >> /tmp/debug
+ echo MAPTYPE $maptype >> /tmp/debug
+ echo MAP $map >> /tmp/debug
+ echo MAPOPTIONS $mapoptions >> /tmp/debug
+ echo LOCALOPTIONS $localoptions >> /tmp/debug
+
+ echo "$DAEMON $dir $maptype $map $mapoptions $localoptions" | sed -e 's/ / /g' -e 's/ / /g'
+
+ # echo ------------------------
+ fi
+ knownmaps=" $dir/ $knownmaps"
+ done
+ )
+}
+
+
+start() {
+ ebegin "Starting automounter"
+ getmounts | while read cmd timeout mnt rest
+ do
+ #FIXME: this works but it really sucks
+ if echo $timeout|grep -v -- '--timeout' >/dev/null ; then
+ rest="$mnt $rest"
+ mnt="$timeout"
+ timeout=""
+ fi
+
+ echo -n " $mnt"
+ pidfile=/var/run/autofs`echo $mnt | sed 's/\//./g'`.pid
+ start-stop-daemon --start --pidfile $pidfile --quiet \
+ --exec /usr/sbin/automount -- $timeout $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 $timeout \?$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 $?
+}
+
+stats() {
+ 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
+}
+
+restart() {
+ svc_stop
+ svc_start
+} \ No newline at end of file
diff --git a/net-fs/autofs/files/digest-autofs-3.1.7-r5 b/net-fs/autofs/files/digest-autofs-3.1.7-r5
new file mode 100644
index 000000000000..c8410dc43753
--- /dev/null
+++ b/net-fs/autofs/files/digest-autofs-3.1.7-r5
@@ -0,0 +1 @@
+MD5 4f602f82442b48ce9c2e0005d59c3408 autofs-3.1.7.tar.bz2 57000
diff --git a/net-fs/autofs/files/ldap_config.patch b/net-fs/autofs/files/ldap_config.patch
new file mode 100644
index 000000000000..02e27b44d683
--- /dev/null
+++ b/net-fs/autofs/files/ldap_config.patch
@@ -0,0 +1,25 @@
+--- configure.in.orig 2002-11-09 15:10:55.000000000 +0000
++++ configure.in 2002-11-09 15:46:01.000000000 +0000
+@@ -104,17 +104,19 @@
+ elif test -z "$withval" -o "$withval" = 'yes'
+ then
+ : Search for LDAP in normal directory path
++ HAVE_LDAP=1
++ LIBLDAP="-lldap -lresolv -llber"
+ else
+ : Search for LDAP in specific directory
+ LDFLAGS="$LDFLAGS -L${withval}/lib"
+- LIBLDAP="-L${withval}/lib"
++ LIBLDAP="-L${withval}/lib -lldap -llber -lresolv"
+ LDAP_FLAGS="-I${withval}/include"
+ fi
+ )
+ if test -z "$HAVE_LDAP"; then
+ HAVE_LDAP=0
+- AC_CHECK_LIB(ldap, ldap_init, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber", ,
+- -llber)
++ AC_CHECK_LIB(ldap, ldap_init, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv", ,
++ -llber -lresolv)
+ fi
+
+ AC_SUBST(LDAP_FLAGS)