File autofs.spec of Package autofs

#
# spec file for package autofs
#
# Copyright (c) 2011 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:  bison e2fsprogs flex module-init-tools nfs-client
BuildRequires:  krb5-devel libtirpc-devel libxml2-devel openldap2-devel
License:        GPLv2+
Group:          System/Daemons
Version:        5.0.6
Release:        2
Summary:        A Kernel-Based Automounter
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         ftp://ftp.kernel.org/pub/linux/daemons/autofs/v5/%{name}-%{version}.tar.bz2
Source1:        sysconfig.autofs
Source2:        autofs.init
Source3:        autofs.schema
Source4:        README.SUSE.ldap
Source5:        README.SUSE
Source7:        NetworkManager-autofs
Source8:        get-upstream-patches
%define patchdate 20110703
Patch0:         autofs-%{version}-upstream-patches-%{patchdate}.bz2
Patch1:         autofs-5.0.6-invalid-ghost-dirs.patch
Patch2:         autofs-5.0.5-fix-paged-query-more-results-check.patch
Patch3:         autofs-5.0.5-fix-result-null-check-in-read_one_map.patch
Patch4:         autofs-5.0.5-fix-ldap-result-leaks.patch
Patch10:        autofs-suse-auto_master_default.patch
Patch11:        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.

%prep
%setup
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
#
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch10 -p1
%patch11 -p1

%build
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)" \
	%{?_smp_mflags}

%install
make install INSTALLROOT=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %{S:1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.autofs
install -m 755 %{S:2} $RPM_BUILD_ROOT/etc/init.d/autofs
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/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

%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