File autofs.spec of Package autofs.import5769

#
# spec file for package autofs
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           autofs
Url:            http://www.kernel.org/pub/linux/daemons/autofs/v5/
BuildRequires:  autoconf
BuildRequires:  bison
BuildRequires:  e2fsprogs
BuildRequires:  flex
BuildRequires:  krb5-devel
BuildRequires:  libtirpc-devel
BuildRequires:  libxml2-devel
BuildRequires:  module-init-tools
BuildRequires:  nfs-client
BuildRequires:  openldap2-devel
Version:        5.0.5
Release:        14.<RELEASE21>
Summary:        A Kernel-Based Automounter
License:        GPL-2.0+
Group:          System/Daemons
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         ftp://ftp.kernel.org/pub/linux/daemons/autofs/v5/%{name}-%{version}.tar.bz2
Source1:        sysconfig.autofs
Source3:        autofs.schema
Source4:        README.SuSE.ldap
Source5:        README.SuSE
Source7:        NetworkManager-autofs
Source8:        get-upstream-patches
%define patchdate 20110613
Patch0:         autofs-%{version}-upstream-patches-%{patchdate}.bz2
Patch1:         autofs-5.0.5-invalid-ghost-dirs.patch
Patch2:         autofs-5.0.5-fix-null-cache-deadlock.patch
Patch3:         autofs-5.0.5-fix-ipv6-name-for-lookup.patch
Patch4:         autofs-5.0.5-fix-libtirpc-ipv6-check.patch
Patch5:         autofs-5.0.6-fix-ipv6-name-for-lookup-fix.patch
Patch6:         autofs-5.0.6-fix-paged-query-more-results-check.patch
Patch7:         autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch
Patch8:         autofs-5.0.6-fix-result-null-check-in-read_one_map.patch
Patch9:         autofs-5.0.6-fix-ldap-result-leaks-on-error-paths.patch
Patch10:        autofs-5.0.6-fix-fix-ldap-result-leaks-on-error-paths.patch
Patch11:        autofs-5.0.6-code-analysis-fixes-1.patch
Patch12:        autofs-5.0.6-fix-wait-for-master-source-mutex.patch
Patch13:        autofs-5.0.6-fix-submount-shutdown-race.patch
Patch14:        autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch
Patch15:        autofs-5.0.6-fix-ipv6-name-lookup-check.patch
Patch16:        autofs-5.0.6-fix-ipv6-rpc-calls.patch
Patch17:        autofs-5.0.6-fix-ipv6-configure-check.patch
Patch18:        autofs-5.0.6-fix-rpc-build-error.patch
Patch19:        autofs-5.0.6-fix-libtirpc-name-typo.patch
Patch20:        autofs-5.0.6-task-use-after-free.patch
Patch100:       autofs-suse-auto_master_default.patch
Patch101:       autofs-suse-autofs_init.patch
Patch102:       autofs-suse-build.patch
PreReq:         %fillup_prereq %insserv_prereq aaa_base
Recommends:     nfs-client

%description
AutoFS is a kernel-based automounter for Linux.  It automatically
mounts filesystems when you use them, and unmounts them later when
you are not using them.  This can include network filesystems, CD-ROMs,
floppies, and so forth.



Authors:
--------
    H. Peter Anvin <hpa@transmeta.com>
    Ian Kent <raven@themaw.net>

%prep
%setup
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
#
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1

%build
SUSE_ASNEEDED=0
rm -f configure
autoconf -f
./configure %{_target_cpu}-suse-linux \
            --libdir=%{_libdir} --mandir=%{_mandir} \
            --with-confdir=/etc/sysconfig \
            --disable-mount-locking \
            --enable-forced-shutdown \
            --enable-ignore-busy \
            --with-libtirpc \
            --with-hesiod=no \
            --with-sasl
make all DONTSTRIP=1 LOCAL_CFLAGS="$RPM_OPT_FLAGS %(getconf LFS_CFLAGS)"

%install
make install INSTALLROOT=$RPM_BUILD_ROOT
ln -s ../../etc/init.d/autofs $RPM_BUILD_ROOT/usr/sbin/rcautofs
ln -s %{_mandir}/man8/autofs.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/rcautofs.8.gz
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %{S:1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.autofs
mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
install -m 755 %{S:7} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/autofs
# will be installed by fillup scripts 
rm -f $RPM_BUILD_ROOT/etc/sysconfig/autofs

%clean
rm -rf %{buildroot}

%post
if /sbin/chkconfig -c autofs 3; then
	%{insserv_force_if_yast autofs}
fi
%{fillup_only -n autofs}

%preun
%{stop_on_removal autofs}

%postun
%{restart_on_update autofs}
%{insserv_cleanup}

%files
%defattr (-, root, root)
/var/adm/fillup-templates/sysconfig.autofs
%config(noreplace) /etc/auto.master
%config(noreplace) /etc/auto.misc
%config(noreplace) /etc/auto.net
%config(noreplace) /etc/auto.smb
%config(noreplace) /etc/autofs_ldap_auth.conf
%config /etc/init.d/autofs
%dir /etc/NetworkManager
%dir /etc/NetworkManager/dispatcher.d
/etc/NetworkManager/dispatcher.d/autofs
%doc COPYRIGHT README README.changer README.ncpfs README.replicated-server
%doc README.smbfs README.v5.release autofs.schema README.active-restart
%doc README.SuSE README.SuSE.ldap 
%dir %{_libdir}/autofs/
%{_libdir}/autofs/
%{_mandir}/man5/*
%{_mandir}/man8/*
%{_sbindir}/rcautofs
%{_sbindir}/automount

%changelog
openSUSE Build Service is sponsored by