Summary: A tool for automatically mounting and unmounting filesystems.
Summary(ja): 自動的にファイルシステムをマウント/アンマウントするツール
Name: autofs
Version: 5.1.0
Release: 1%{?_dist_release}
Epoch: 1
License: GPL
Group: System Environment/Daemons
Vendor: Project Vine
Distribution: Vine Linux
Packager: daisuke, kenta, shaolin

Source: ftp://ftp.kernel.org/pub/linux/daemons/autofs/v5/autofs-%{version}.tar.xz
# upstream patches
#Patch1: autofs-5.0.8-fix-undefined-authtype_requires_creds-err-if-ldap-en.patch
#Patch2: autofs-5.0.8-fix-master-map-type-check.patch
#Patch3: autofs-5.0.8-fix-task-manager-not-getting-signaled.patch

## Vine Patch(es)
Patch100: autofs-3.1.7-initdir.patch
Patch101: autofs-5.0.3-rc.autofs_LSB.patch
Patch102: autofs-5.0.8-fix-initscript-vine.patch

Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: openldap-devel
BuildRequires: bind-devel, libxml2-devel, openssl-devel
BuildRequires: util-linux-ng, nfs-utils, e2fsprogs
BuildRequires: flex, bison
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/chkconfig
Requires(postun): /sbin/service
Requires: kernel >= 2.6.17
Requires: bash, sed, gawk, coreutils, grep, module-init-tools, procps
Provides: autofs-ldap
Obsoletes: autofs-ldap <= 4.1.4-11vl2


%description
Autofs controls the operation of the automount daemons. The automount
daemons automatically mount filesystems when you use them and
unmount them after a period of inactivity. Filesystems can include
network filesystems, CD-ROMs, floppies and others.

Install this package if you want a program for automatically mounting
and unmounting filesystems. If your Vine Linux machine is on a
network, you should install autofs.

%description -l ja
autofs は automount デーモンの動作を制御します．
automount デーモンは，ファイルシステムを使う時に自動的にマウントし，
一定時間使わなければアンマウントしてくれます．
対象となるファイルシステムには NFS, CD-ROM, フロッピー等があります．

ファイルシステムを自動的にマウント/アンマウントさせたい場合は
このパッケージをインストールして下さい．Vine Linux をインストールした
マシンをネットワークに接続しているのならば，autofs をインストール
すると良いでしょう．


%prep
%setup -q
echo %{version}-%{release} > .version
#%patch1 -p1
#%patch2 -p1
#%patch3 -p1

## Vine Patch(es)
if [ "%{_initdir}" = "/etc/rc.d/init.d" ]; then
    patch -p1 -b --suffix .initdir < %{PATCH100}
fi
%patch101 -p1 -b .lsb
%patch102 -p1 -b .lsb

%build
CFLAGS="$RPM_OPT_FLAGS -ggdb"; export CFLAGS
%configure --without-hesiod --without-sasl \
           --disable-mount-locking --enable-ignore-busy
make initdir=/etc/rc.d/init.d STRIP=:
make -C redhat

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p -m755 $RPM_BUILD_ROOT%{_initdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}/autofs
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/{man5,man8}
mkdir -p -m755 $RPM_BUILD_ROOT%{_sbindir}
mkdir -p -m755 $RPM_BUILD_ROOT/etc/sysconfig

make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_ROOT
make -C redhat
install -m 755 -d $RPM_BUILD_ROOT/misc
install -m 755 redhat/autofs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs
install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT


%post
/sbin/chkconfig --add autofs


%postun
if [ $1 -ge 1 ] ; then
	/sbin/service autofs condrestart > /dev/null 2>&1 || :
fi

%preun
if [ "$1" = 0 ] ; then
	/sbin/service autofs stop > /dev/null 2>&1
	chkconfig --del autofs
fi


%files
%defattr(-,root,root)
%doc CHANGELOG COPYING COPYRIGHT CREDITS patches/*
%doc samples/*
%doc README README.*
%config %{_initdir}/autofs
%config(noreplace) /etc/autofs.conf
%config(noreplace,missingok) /etc/auto.master
%config(noreplace,missingok) /etc/auto.misc
%config(noreplace,missingok) /etc/auto.net
%config(noreplace,missingok) /etc/auto.smb
%config(noreplace) /etc/autofs_ldap_auth.conf
%config(noreplace) /etc/sysconfig/autofs
%{_sbindir}/automount
%dir /misc
%dir %{_libdir}/autofs
%{_libdir}/autofs/*.so
%{_mandir}/*/*


%changelog
* Tue Jun 17 2014 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.1.0-1
- new upstream release
- Patch[123] removed (already in the upstream)

* Sun Dec 01 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.0.8-2
- add Patch102 (autofs-5.0.8-fix-initscript-vine.patch)

* Sun Nov 17 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.0.8-1
- new upstream release
- update upstream patches (Patch1-3)

* Sun Apr 17 2011 NAKAMURA Kenta <kenta@vinelinux.org> 5.0.5-2
- rebuilt on current VineSeed

* Sun Apr 18 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 5.0.5-1
- new upstream release
- update upstream patches (Patch0-27)

* Wed May 06 2009 NAKAMURA Kenta <kenta@vinelinux.org> 5.0.3-4
- added Patch101: autofs-5.0.3-rc.autofs_LSB.patch to support LSB Header

* Mon Jan 05 2009 NAKAMURA Kenta <kenta@vinelinux.org> 5.0.3-3
- rebuilt with openldap-2.4.11

* Sun Sep 21 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 5.0.3-2
- make autofs.init executable. (<BTS:wishes:0160>)

* Mon Sep 01 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 5.0.3-1vl5
- new upstream release
- update fedora patches

* Sat Aug 30 2008 Shu KONNO <owa@bg.wakwak.com> 4.1.4-12vl5
- applied new versioning policy, spec in utf-8

* Fri Apr 06 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 4.1.4-11vl5
- fix sort option on auto.net (<BTS:490>)

* Mon Sep 18 2006 NAKAMURA Kenta <kenta@vinelinux.org> 4.1.4-11vl4
- added patch15 and patch16 imported from Fedora Core 5

* Mon Sep 04 2006 NAKAMURA Kenta <kenta@vinelinux.org> 4.1.4-11vl3
- added Obsoletes: autofs-ldap
- added BuildPrereq: openldap-devel

* Sun Aug 27 2006 NAKAMURA Kenta <kenta@vinelinux.org> 4.1.4-11vl2
- removed --without-openldap configure option
- rebuilt with openldap-2.3.27-0vl1

* Sun Oct 30 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.1.4-11vl1
- updated based on Fedora
  * Wed Oct 26 2005  <jmoyer@redhat.com> - 1:4.1.4-11
  - Check the return code of is_local_addr in get_best_mount. (bz #169523)
  * Wed Oct 26 2005  <jmoyer@redhat.com> - 1:4.1.4-10
  - Fix a buffer overflow with large key lengths
  - change to the upstream reentrant syslog patch from the band-aid deferred
    syslog patch.
  - Get rid of the init script patch that hard-coded the release to redhat.
    This should be handled properly by all red hat distros.
  * Wed May  4 2005 Jeff Moyer <jmoyer@redhat.com> - 1:4.1.4-8
  - Add in the deferred syslog patch.  This fixes a hung automounter issue
    related to unsafe calls to syslog in signal handler context.
  * Tue May  3 2005 Jeff Moyer <jmoyer@redhat.com> - 1:4.1.4-7
  - I reversed the checking for multimount entries, breaking those configs!
    This update puts the code back the way it was before I broke it.
  * Tue Apr 26 2005 Jeff Moyer <jmoyer@redhat.com> - 1:4.1.4-6
  - Fix a race between mounting a share and updating the cache in the parent
    process.  If the mount completed first, the parent would not expire the
    stale entry, leaving it first on the list.  This causes map updates to not
    be recognized (well, worse, they are recognized after the first expire, but
    not subsequent ones).  Fixes a regression, bug #137026 (rhel3 bug).
  * Fri Apr 15 2005 Chris Feist <cfeist@redhat.com> - 1:4.1.4-5
  - Fixed regression with -browse not taking effect.
  * Wed Apr 13 2005 Jeff Moyer <jmoyer@redhat.com> - 1:4.1.4-4
  - Finish up with the merge breakage.
  - Temporary fix for the multimount detection code.  It seems half-baked.
  * Wed Apr 13 2005 Jeff Moyer <jmoyer@redhat.com> - 1:4.1.4-3
  - Fix up the one-auto-master patch.  My "improvements" had side-effects.
  * Wed Oct 27 2004 Chris Feist <cfeist@redhat.com> - 1:4.1.3-34
  - Added a patch to fix the automounter failing on ldap maps
    when it couldn't get the whole map.  (ie. when the search
    limit was lower than the number of results)
- updated Patch101
- s/Red Hat/Vines/ in description

* Wed Jun 23 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.1.7-42vl3
- fix init script (Patch102)
  not to create lock file when no mountpoints are defined

* Tue Oct 28 2003 Tomoya TAKA <taka@vinelinux.org> 3.1.7-42vl2
- do not compile/install autofs-ldap-auto-master

* Sun Oct  5 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.1.7-42vl1
- based on Rawhide 3.1.7-42
  - Fri Apr 25 2003 Nalin Dahyabhai <nalin@redhat.com> 3.1.7-37
  - sync with current linux/auto_fs.h from the current kernel tree (#88562)
  - Tue Apr  2 2002 Nalin Dahyabhai <nalin@redhat.com> 3.1.7-28
  - try to properly handle nisplus maps (patch from Steve Foster via the
    autofs mailing list)
  - override the STRIP makefile variable to not strip binaries (that's the
    build root policy's job)
  - Wed Aug 29 2001 Nalin Dahyabhai <nalin@redhat.com> 3.1.7-21
  - don't inhibit starting if we have a subsys lock around -- that's the
    wrong thing to do anyway
  - don't create a subsys lock if we're unconfigured (#52755)
- rebuild with new toolchain
- s/Copyright/License/

* Tue Jan 29 2002 Toru Sagami <sagami@vinelinux.org> 3.1.7-2vl2
- make /etc/vine-release read by autofs.init

* Fri Jan 19 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 3.1.7-2vl1
- rebuilt for VineSeed
- use better macros (%%{_initdir})
- add Patch100 to cope with initdir :-(

* Thu Jan 18 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 3.1.7-2vl0
- based on 3.1.7-2 from Rawhide
- remove /etc/init.d from PreReq
- build without openldap and hesiod
- BuildPreReq: bind-devel again for Vine
- added Japanese summary and description

* Tue Jan  9 2001 Nalin Dahyabhai <nalin@redhat.com>
- fix option parsing in lookup_multi (I think)
- fix multi option handling in our hacked-up init script (reported by Thiago
  Bartolomei on the autofs mailing list)

* Wed Dec  6 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to 3.1.7
- add the man pages back in (fell out in 3.1.6)

* Tue Nov 28 2000 Nalin Dahyabhai <nalin@redhat.com>
- don't require /etc/auto.master to be there to start

* Mon Nov 27 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to 3.1.6
- disable hesiod support because the new bind-devel doesn't include it
- try to use nsswitch.conf for getting the contents of auto.master
- only convert YP map names auto_home and auto_mnt

* Fri Sep  8 2000 Nalin Dahyabhai <nalin@redhat.com>
- add -lresolv to build properly with OpenLDAP 2

* Wed Aug 23 2000 Nalin Dahyabhai <nalin@redhat.com>
- convert YP map names that start with "auto_" to "auto." (#16753)

* Wed Aug 16 2000 Nalin Dahyabhai <nalin@redhat.com>
- add an extra pause after the initial shutdown attempt

* Fri Aug 11 2000 Nalin Dahyabhai <nalin@redhat.com>
- patch init script to not shut down --submount mounts on reload
- remove temporary files again during reload

* Thu Aug 10 2000 Nalin Dahyabhai <nalin@redhat.com>
- revert to 3.1.5
- add 3.1.6pre1 patch to handle LDAP maps
- add Epoch: to upgrade from Raw Hide or Pinstripe
- update to 3.1.6pre2

* Fri Aug  4 2000 Nalin Dahyabhai <nalin@redhat.com>
- work around kernel insmod concurrency problem (#14972) by loading the module
  at start-time

* Wed Aug  2 2000 Nalin Dahyabhai <nalin@redhat.com>
- fix duplicate detection for false matches (e.g. "/user" == "/users") (#15183)

* Tue Aug  1 2000 Nalin Dahyabhai <nalin@redhat.com>
- merge ldap subpackage back into the main one and Obsolete: it
- clean up build warnings
- fix errors automounting ext2 filesystems due to uninitialized option string

* Sat Jul 15 2000 Bill Nottingham <notting@redhat.com>
- move initscript back

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jul 10 2000 Nalin Dahyabhai <nalin@redhat.com>
- move the init script to the right place

* Fri Jul  7 2000 Nalin Dahyabhai <nalin@redhat.com>
- add /net directory to the package

* Thu Jul  6 2000 Nalin Dahyabhai <nalin@redhat.com>
- do manual unmounting in shutdown script
- change initscripts prereq to /etc/init.d
- move autoconf invocation to setup section

* Wed Jul  5 2000 Nalin Dahyabhai <nalin@redhat.com>
- move condrestart to postun
- make condrestart check the right file to determine if already running

* Wed Jul  5 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- ignore errors in post script

* Tue Jul  4 2000 Matt Wilson <msw@redhat.com>
- use full path to chkconfig
- full *correct* path to chkconfig

* Tue Jun 27 2000 Nalin Dahyabhai <nalin@redhat.com>
- smoother starting/stopping on upgrades/removal

* Thu Jun 15 2000 Nalin Dahyabhai <nalin@redhat.com>
- be more aggressive when shutting down autofs
- add condrestart support

* Mon Jun  5 2000 Nalin Dahyabhai <nalin@redhat.com>
- move man pages to %{_mandir}

* Wed May 31 2000 Nalin Dahyabhai <nalin@redhat.com>
- tweak argument parsing (bug #11801)

* Mon May 22 2000 Nalin Dahyabhai <nalin@redhat.com>
- rebuild in new build environment

* Mon May  8 2000 Nalin Dahyabhai <nalin@redhat.com>
- fix duplicate detection logic (duh!)

* Tue May  2 2000 Nalin Dahyabhai <nalin@redhat.com>
- add config: and processname: tags to init script

* Sun Apr 30 2000 Nalin Dahyabhai <nalin@redhat.com>
- fix shutdown logic (test -z $pid fails with multiple autofs daemons)

* Wed Apr 26 2000 Nalin Dahyabhai <nalin@redhat.com>
- split off autofs4 for testing & development
- update patches for autofs4 for feeding back to autofs list
- make auto.master a noreplace file

* Mon Apr 17 2000 Nalin Dahyabhai <nalin@redhat.com>
- split lookup_ldap into a subpackage (bug #10874)

* Tue Apr 11 2000 Nalin Dahyabhai <nalin@redhat.com>
- add LDAP map support, requires openldap
- tweak init script patch to use fields 2+ for the map name instead of just 2

* Wed Apr 05 2000 Nalin Dahyabhai <nalin@redhat.com>
- fix bug #10402 by fixing the init script, hopefully for everybody
- merge patches for the init script into a single patch to send to hpa
- patch to build on 2.2 and late-series 2.3 kernels

* Tue Feb 29 2000 Nalin Dahyabhai <nalin@redhat.com>
- enable hesiod support over libbind

* Mon Feb 28 2000 Nalin Dahyabhai <nalin@redhat.com>
- fix init script bug when startup failed
- fix option passing in init script

* Sun Feb 13 2000 Nalin Dahyabhai <nalin@redhat.com>
- make autofs start after ypbind by moving start priority 18, stop to 82
- make sure that calls to "ps aux" include "www" to avoid snippage

* Wed Feb  2 2000 Nalin Dahyabhai <nalin@redhat.com>
- make sure all the docs get packaged
- make init script do status messages like others
- add "nosuid,nodev" to options for /misc/cd
- switch to using INSTALLROOT during make install

* Fri Jan 21 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to 3.1.4

* Mon Sep 20 1999 Cristian Gafton <gafton@redhat.com>
- use ps axw instead of ps ax in the init script

* Fri Sep 10 1999 Bill Nottingham <notting@redhat.com>
- chkconfig --del in %preun, not %postun

* Tue Sep 07 1999 Cristian Gafton <gafton@redhat.com>
- add patch from HJLu to handle NIS auto.master better

* Wed Aug 25 1999 Cristian Gafton <gafton@redhat.com>
- fix bug #4708

* Sat Aug 21 1999 Bill Nottingham <notting@redhat.com>
- fix perms on /usr/lib/autofs/* 
- add support for specifying maptype in auto.master

* Fri Aug 13 1999 Cristian Gafton <gafton@redhat.com>
- add patch from rth to avoid an infinite loop

* Wed Apr 28 1999 Cristian Gafton <gafton@redhat.com>
- use "autofs" instead of "automount" for /var/lock/subsys lock file

* Fri Apr 09 1999 Cristian Gafton <gafton@redhat.com>
- enahanced initscript to try to load maps over NIS
- changed the mount point back to misc (there is a reason we leave /mnt
  alone)
- patched back autofs.misc to the version shipped on 5.2 to avoid replacing
  yet one more config file for those who upgrade

* Wed Mar 24 1999 Preston Brown <pbrown@redhat.com>
- upgrade to 3.1.3, fixing smbfs stuff and other things
- changed mountpoint from /misc to /mnt

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 10)

* Mon Feb  8 1999 Bill Nottingham <notting@redhat.com>
- build for kernel-2.2/glibc2.1

* Tue Oct  6 1998 Bill Nottingham <notting@redhat.com>
- fix bash2 breakage in init script

* Sun Aug 23 1998 Jeff Johnson <jbj@redhat.com>
- typo in man page.

* Mon Jul 20 1998 Jeff Johnson <jbj@redhat.com>
- added sparc to ExclusiveArch.

* Thu May 07 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Thu Apr 30 1998 Cristian Gafton <gafton@redhat.com>
- updated to 3.1.1

* Wed Apr 22 1998 Michael K. Johnson <johnsonm@redhat.com>
- enhanced initscripts

* Fri Dec 05 1997 Michael K. Johnson <johnsonm@redhat.com>
- Link with -lnsl for glibc compliance.

* Thu Oct 23 1997 Michael K. Johnson <johnsonm@redhat.com>
- exclusivearch for i386 for now, since our kernel packages on
  other platforms don't include autofs yet.
- improvements to initscripts.

* Thu Oct 16 1997 Michael K. Johnson <johnsonm@redhat.com>
- Built package from 0.3.14 for 5.0
