File cifs-utils.spec of Package cifs-utils.openSUSE_12.1_Update

#
# spec file for package cifs-utils
#
# 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/
#


Summary:        Utilities for doing and managing mounts of the Linux CIFS filesystem

Name:           cifs-utils
Version:        4.9
Release:        1
License:        GPLv3+
Group:          System/Filesystems
Url:            http://www.samba.org/linux-cifs/cifs-utils/
Source:         %{name}-%{version}.tar.bz2
Source1:        cifs.init
Source2:        mkinitrd_scripts_boot-cifs.sh
Source3:        mkinitrd_scripts_setup-cifs.sh
Patch1:         mount.cifs-properly-update-mtab.patch
Patch2:         mount.cifs-handle-errors-in-del_mtab.patch
%if 0%{?suse_version}
PreReq:         insserv %{?fillup_prereq} mkinitrd
%else
PreReq:         /sbin/chkconfig
%endif
%define         initdir %{_sysconfdir}/init.d
AutoReqProv:    on
Provides:       cifs-mount = %{version}
Obsoletes:      cifs-mount < %{version}
BuildRequires:  krb5-devel libcap-devel libtalloc-devel
%if 0%{?suse_version} > 1110
BuildRequires:  fdupes
%endif
%if 0%{?mandriva_version}
BuildRequires:  libkeyutils-devel
%endif
Requires:       keyutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The cifs-utils package consist of utilities for doing and managing mounts of
the Linux CIFS filesystem.

%prep
%setup -q
%patch1 -p0
%patch2 -p0

%build
%{?suse_update_config:%{suse_update_config -f}}
autoreconf --force --install
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE"
%{configure}
%{__make} %{?_smp_mflags}

%install
mkdir -p \
	${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d
%{__make} install \
	DESTDIR=${RPM_BUILD_ROOT}
%if 0%{?suse_version}
	mkdir -p ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/
	%{__install} -m 0755 ${RPM_SOURCE_DIR}/mkinitrd_scripts_boot-cifs.sh ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/boot-cifs.sh
	%{__install} -m 0755 ${RPM_SOURCE_DIR}/mkinitrd_scripts_setup-cifs.sh ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/setup-cifs.sh
%endif
# Hardlink duplicate files
%if 0%{?suse_version} > 1110
%fdupes ${RPM_BUILD_ROOT}
%endif

%preun
%if 0%{?suse_version}
%{stop_on_removal cifs}
%else
if [ $1 = 0 ] ; then
	test -x /sbin/chkconfig && /sbin/chkconfig --del cifs
fi
%endif

exit 0

%post
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
exit 0

%postun
%if 0%{?suse_version}
%{restart_on_update cifs}
%{insserv_cleanup}
%else
if [ "$1" -ge "1" ]; then
	%{initdir}/cifs restart >/dev/null
fi	
%endif
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
exit 0

%files
%defattr(-,root,root)
/sbin/mount.cifs
#/sbin/umount.cifs
%doc %{_mandir}/man8/mount.cifs.8.*
#%doc %{_mandir}/man8/umount.cifs.8.*
%{_sbindir}/cifs.upcall
%doc %{_mandir}/man8/cifs.upcall.8.*
%if 0%{?suse_version} > 1100
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/setup-cifs.sh
/lib/mkinitrd/scripts/boot-cifs.sh
%endif

%changelog
openSUSE Build Service is sponsored by