File autofs.spec of Package autofs.2291

# spec file for package autofs
# Copyright (c) 2016 SUSE LINUX 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

%if 0%{?suse_version} >= 1230
%define with_sssd 1
%define with_sssd 0

Name:           autofs
BuildRequires:  autoconf
BuildRequires:  bison
BuildRequires:  cyrus-sasl-devel
BuildRequires:  dbus-1-devel
BuildRequires:  e2fsprogs
BuildRequires:  flex
BuildRequires:  krb5-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libtirpc-devel
BuildRequires:  libxml2-devel
BuildRequires:  module-init-tools
BuildRequires:  nfs-client
BuildRequires:  openldap2-devel
BuildRequires:  pkg-config
BuildRequires:  systemd
%if %{with_sssd}
BuildRequires:  sssd
Version:        5.0.9
Release:        0
Summary:        A Kernel-Based Automounter
License:        GPL-2.0+
Group:          System/Daemons
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source1:        sysconfig.autofs
Source3:        autofs.schema
Source4:        README.SUSE.ldap
Source5:        README.SUSE
Source6:        autofs.service
Source7:        NetworkManager-autofs
Source8:        get-upstream-patches
# Upstream patches that will be in the next release
#%define patchdate 20140324
#Patch0:         autofs-%{version}-upstream-patches-%{patchdate}.bz2
# PATCH-FIX-UPSTREAM autofs-5.0.9-task-use-after-free.patch [bnc#727392]
Patch1:         autofs-5.0.9-task-use-after-free.patch
Patch2:         autofs-5.1.0-dont-pass-sloppy-option-for-other-than-nfs-mounts.patch
Patch3:         autofs-5.1.0-add-a-prefix-to-program-map-stdvars.patch
Patch4:         autofs-5.1.0-add-config-option-to-force-use-of-program-map-stdvars.patch
Patch5:         autofs-5.1.1-leave_auth_destroy.patch
Patch6:         autofs-improve-scalability-of-direct-mount-path-comp.patch
# PATCH-FIX-OPENSUSE autofs-suse-auto_master_default.patch
# PATCH-FIX-OPENSUSE autofs-5.0.9-suse-auto_master_default.patch
Patch100:       autofs-5.0.9-suse-auto_master_default.patch
Patch101:       autofs-use-libldap_r-instead-of-libldap-for-thread-safety.patch
Patch200:       autofs-debuginfo-fix.patch
Requires(pre):  %fillup_prereq
Requires(pre):  %insserv_prereq
Requires(pre):  aaa_base
Recommends:     nfs-client

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.

%setup -q
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
#%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch100 -p1
%patch101 -p1
%patch200 -p1


%configure %{_target_cpu}-suse-linux \
            --libdir=%{_libdir} --mandir=%{_mandir} \
            --with-confdir=/etc/sysconfig \
            --disable-mount-locking \
            --enable-forced-shutdown \
            --enable-ignore-busy \
            --with-systemd \
            --with-libtirpc \
            --with-hesiod=no \
make all DONTSTRIP=1 LOCAL_CFLAGS="%{optflags} %(getconf LFS_CFLAGS)" \

make install INSTALLROOT=%{buildroot}
install -d -m 755 %{buildroot}%{_sysconfdir}/auto.master.d
install -D -m 644 %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.autofs
install -D -m 755 %{SOURCE7} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/autofs
ln -s /usr/sbin/service %{buildroot}/usr/sbin/rcautofs
ln -s %{_mandir}/man8/autofs.8.gz %{buildroot}/%{_mandir}/man8/rcautofs.8.gz
install -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/autofs.service
# will be installed by fillup scripts
rm -f %{buildroot}%{_sysconfdir}/sysconfig/autofs

%service_add_pre %{name}.service

%{fillup_only -n autofs}
%service_add_post %{name}.service

%{stop_on_removal autofs}
%service_del_preun %{name}.service

%{restart_on_update autofs}
%service_del_postun %{name}.service

%defattr (-, root, root)
%config(noreplace) %{_sysconfdir}/auto.master
%config(noreplace) %{_sysconfdir}/auto.misc
%config(noreplace) %{_sysconfdir}/
%config(noreplace) %{_sysconfdir}/auto.smb
%config(noreplace) %{_sysconfdir}/autofs_ldap_auth.conf
%dir %{_sysconfdir}/auto.master.d
%dir %{_sysconfdir}/NetworkManager
%dir %{_sysconfdir}/NetworkManager/dispatcher.d
%doc COPYRIGHT README README.changer README.ncpfs README.replicated-server
%doc README.smbfs README.v5.release autofs.schema
%dir %{_libdir}/autofs/

openSUSE Build Service is sponsored by