- Really use of the existing cifs init script; (bnc#697218). OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=85
208 lines
7.0 KiB
RPMSpec
208 lines
7.0 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
|
|
%if "%{_vendor}" == "suse"
|
|
%define NET_CFGDIR network
|
|
%else
|
|
%define NET_CFGDIR network-scripts
|
|
%endif
|
|
Source1: cifs.init
|
|
Source2: mkinitrd_scripts_boot-cifs.sh
|
|
Source3: mkinitrd_scripts_setup-cifs.sh
|
|
Source4: cifstab
|
|
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
|
|
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1221
|
|
mkdir -p \
|
|
${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/%{NET_CFGDIR}/if-{down,up}.d \
|
|
${RPM_BUILD_ROOT}/%{_sysconfdir}/samba \
|
|
${RPM_BUILD_ROOT}/%{_sbindir} \
|
|
${RPM_BUILD_ROOT}/var/run
|
|
install -m 0755 -p ${RPM_SOURCE_DIR}/cifs.init ${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d/cifs
|
|
install -m 0600 -p ${RPM_SOURCE_DIR}/cifstab ${RPM_BUILD_ROOT}/%{_sysconfdir}/samba/cifstab
|
|
ln -s %{_sysconfdir}/init.d/${cifs_init_script} ${RPM_BUILD_ROOT}/%{_sbindir}/rccifs
|
|
touch ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/%{NET_CFGDIR}/if-{down,up}.d/${script} \
|
|
${RPM_BUILD_ROOT}/var/run/cifs
|
|
%endif
|
|
# Hardlink duplicate files
|
|
%if 0%{?suse_version} > 1110
|
|
%fdupes ${RPM_BUILD_ROOT}
|
|
%endif
|
|
|
|
%pre
|
|
# non SUSE + post-12.2, update, no cifstab, but smbfstab
|
|
if [ ! 0%{?suse_version} -lt 1221 -a \
|
|
${1:-0} -gt 1 -a \
|
|
! -e /etc/samba/cifstab -a \
|
|
-f /etc/samba/smbfstab ]; then
|
|
cp -a /etc/samba/smbfstab /var/adm/backup/etc_samba_smbfstab-move
|
|
chkconfig -c smbfs && >/var/adm/backup/etc_samba_smbfs-enabled || :
|
|
fi
|
|
|
|
%post
|
|
if [ ${1:-0} -gt 1 -a -f /var/adm/backup/etc_samba_smbfstab-move -a ]; then
|
|
test -f /etc/samba/cifstab && \
|
|
mv /etc/samba/cifstab /etc/samba/cifstab.rpmnew
|
|
mv /var/adm/backup/etc_samba_smbfstab-move /etc/samba/cifstab
|
|
if [ -f /var/adm/backup/etc_samba_smbfs-enabled ]; then
|
|
chkconfig -a cifs >/dev/null
|
|
rm /var/adm/backup/etc_samba_smbfs-enabled
|
|
fi
|
|
fi
|
|
[ -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
|
|
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1221
|
|
%attr(0754,root,root) %config %{_sysconfdir}/init.d/cifs
|
|
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/samba/cifstab
|
|
%{_sbindir}/rccifs
|
|
%dir %{_sysconfdir}/samba
|
|
%ghost %{_localstatedir}/run/cifs
|
|
%endif
|
|
|
|
%files devel
|
|
%defattr(-,root,root)
|
|
%{_includedir}/cifsidmap.h
|
|
|
|
%changelog
|