cifs-utils/cifs-utils.spec

164 lines
5.4 KiB
RPMSpec

#
# spec file for package cifs-utils
#
# Copyright (c) 2013 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: cifs-utils
Version: 5.9
Release: 0
Summary: Utilities for doing and managing mounts of the Linux CIFS filesyste
License: GPL-3.0+
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
Patch: 1a01f7c4b90695211d12291d7a24bec05b1f2922.diff
%if 0%{?suse_version}
PreReq: insserv %{?fillup_prereq} mkinitrd
%else
PreReq: /sbin/chkconfig
%endif
%define initdir %{_sysconfdir}/init.d
Provides: cifs-mount = %{version}
Obsoletes: cifs-mount < %{version}
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1140
BuildRequires: autoconf
%endif
BuildRequires: automake
%if 0%{?suse_version} > 1020
BuildRequires: keyutils-devel
%endif
BuildRequires: krb5-devel
%if 0%{?suse_version} > 1120
BuildRequires: libcap-ng-devel
%else
BuildRequires: libcap-devel
%endif
#!BuildIgnore: libtalloc
BuildRequires: libtalloc-devel
%if 0%{?suse_version} > 1110
BuildRequires: fdupes
%endif
%if 0%{?mandriva_version}
BuildRequires: libkeyutils-devel
%endif
%if 0%{?centos_version} > 599 || 0%{?fedora_version} > 14 || 0%{?rhel_version} > 599 || 0%{?suse_version} > 1020
BuildRequires: libwbclient-devel
%endif
%if 0%{?suse_version} > 1020
BuildRequires: pkg-config
%else
BuildRequires: pkgconfig
%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.
%package devel
Summary: Files needed for building plugins for cifs-utils
Group: Development/Libraries
%description devel
The SMB/CIFS protocol is a standard file sharing protocol widely deployed
on Microsoft Windows machines. This package contains the header file
necessary for building ID mapping plugins for cifs-utils.
%prep
%setup -q
%patch -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fpie"
export LDFLAGS="-pie"
%{configure}
%{__make} %{?_smp_mflags}
%install
mkdir -p \
${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d
%{__make} install \
DESTDIR=${RPM_BUILD_ROOT}
%if 0%{?centos_version} > 599 || 0%{?fedora_version} > 14 || 0%{?mandriva_version} > 201100 || 0%{?rhel_version} > 599 || 0%{?suse_version} > 1020
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
ln -s %{_libdir}/%{name}/idmapwb.so %{buildroot}%{_sysconfdir}/%{name}/idmap-plugin
%endif
mkdir -p %{buildroot}%{_sysconfdir}/request-key.d
install -m 644 -p contrib/request-key.d/cifs.idmap.conf %{buildroot}%{_sysconfdir}/request-key.d
install -m 644 -p contrib/request-key.d/cifs.spnego.conf %{buildroot}%{_sysconfdir}/request-key.d
%if 0%{?suse_version} > 1100
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
%post
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
exit 0
%postun
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
exit 0
%files
%defattr(-,root,root)
/sbin/mount.cifs
%if 0%{?centos_version} > 599 || 0%{?fedora_version} > 14 || 0%{?mandriva_version} > 201100 || 0%{?rhel_version} > 599 || 0%{?suse_version} > 1020
%{_bindir}/getcifsacl
%{_bindir}/setcifsacl
%{_sbindir}/cifs.idmap
%doc %{_mandir}/man1/getcifsacl.1.*
%doc %{_mandir}/man1/setcifsacl.1.*
%doc %{_mandir}/man8/cifs.idmap.8.*
%endif
%if 0%{?centos_version} > 499 || 0%{?fedora_version} > 14 || 0%{?mandriva_version} > 201100 || 0%{?rhel_version} > 499 || 0%{?suse_version} > 1020
%{_bindir}/cifscreds
%{_sbindir}/cifs.upcall
%doc %{_mandir}/man1/cifscreds.1.*
%doc %{_mandir}/man8/cifs.upcall.8.*
%endif
%doc %{_mandir}/man8/mount.cifs.8.*
%dir %{_sysconfdir}/request-key.d
%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
%config(noreplace) %{_sysconfdir}/request-key.d/cifs.idmap.conf
%config(noreplace) %{_sysconfdir}/request-key.d/cifs.spnego.conf
%if 0%{?centos_version} > 599 || 0%{?fedora_version} > 14 || 0%{?mandriva_version} > 201100 || 0%{?rhel_version} > 599 || 0%{?suse_version} > 1020
%dir %{_libdir}/cifs-utils
%dir %{_sysconfdir}/cifs-utils
%config(noreplace) %{_sysconfdir}/cifs-utils/idmap-plugin
%{_libdir}/%{name}/idmapwb.so
%doc %{_mandir}/man8/idmapwb.8.*
%endif
%files devel
%defattr(-,root,root)
%{_includedir}/cifsidmap.h
%changelog