%bcond_without avahi
%bcond_with merged_build # without samba3+samba4 merge
%bcond_without system_libtalloc
+%bcond_without system_libtdb
# http://wiki.samba.org/index.php/Franky
%bcond_with mks # with vfs-mks (mksd dependency not distributale)
%undefine with_ads
%endif
-%define libtalloc_ver 2:2.0.1
+%if %{with system_libtalloc}
+%define libtalloc_ver 2.0.1
+%else
+%define libtalloc_ver %{epoch}:%{version}-%{release}
+%endif
+
+%if %{with system_libtdb}
+%define libtdb_ver 2:1.2.9
+%else
+%define libtdb_ver %{epoch}:%{version}-%{release}
+%endif
-%define vscan_version 0.3.6c-beta5
+%define virusfilter_version 0.1.3
Summary: SMB server
Summary(cs.UTF-8): Server SMB
Summary(da.UTF-8): SMB server
Summary(uk.UTF-8): SMB клієнт та сервер
Summary(zh_CN.UTF-8): Samba 客户端和服务器
Name: samba
-Version: 3.5.11
+Version: 3.6.6
Release: 1
Epoch: 1
License: GPL v3
Group: Networking/Daemons
Source0: http://www.samba.org/samba/ftp/stable/%{name}-%{version}.tar.gz
-# Source0-md5: 81bbd16048c6ca40baea8c59126ee385
+# Source0-md5: 0bea52842d172231c0c0e23ee570d7af
Source1: smb.init
Source2: %{name}.pamd
Source3: swat.inetd
Source7: winbind.init
Source8: winbind.sysconfig
Source9: %{name}-rfc3454.txt
+Source10: https://github.com/downloads/fumiyas/samba-virusfilter/samba-virusfilter-%{virusfilter_version}.tar.bz2
+# Source10-md5: a3a30d5fbf309d356e8c5833db680c17
Patch0: %{name}-smbwrapper.patch
Patch1: %{name}-c++-nofail.patch
Patch2: %{name}-pthread.patch
BuildRequires: keyutils-devel
BuildRequires: libmagic-devel
BuildRequires: libnscd-devel
-%{?with_system_libtalloc:BuildRequires: libtalloc-devel >= %{libtalloc_ver}}
BuildRequires: libtool >= 2:1.4d
BuildRequires: make >= 3.81
BuildRequires: ncurses-devel >= 5.2
BuildRequires: readline-devel >= 4.2
BuildRequires: rpmbuild(macros) >= 1.304
BuildRequires: sed >= 4.0
+%{?with_system_libtalloc:BuildRequires: talloc-devel >= %{libtalloc_ver}}
+%{?with_system_libtdb:BuildRequires: tdb-devel >= %{libtdb_ver}}
BuildRequires: xfsprogs-devel
Requires(post,preun): /sbin/chkconfig
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-common = %{epoch}:%{version}-%{release}
%{?with_kerberos5:Requires: heimdal-libs}
Requires: libsmbclient = %{epoch}:%{version}-%{release}
-Obsoletes: mount-cifs
Obsoletes: smbfs
+Suggests: cifs-utils
%description client
Samba-client provides some SMB clients, which complement the build-in
Summary(ru.UTF-8): Файлы, используемые как сервером, так и клиентом Samba
Summary(uk.UTF-8): Файли, що використовуються як сервером, так і клієнтом Samba
Group: Networking/Daemons
-%if %{without system_libtalloc}
-Requires: libtalloc >= %{epoch}:%{version}-%{release}
-%else
-Requires: libtalloc >= %{libtalloc_ver}
-%endif
-Requires: tdb >= %{epoch}:%{version}-%{release}
+Requires: talloc >= %{libtalloc_ver}
+Requires: tdb >= %{libtdb_ver}
%description common
Samba-common provides files necessary for both the server and client
%{__sed} -i 's#%SAMBAVERSION%#%{version}#' docs/htmldocs/index.html
+# deprecated in gnutls 3.0
+%{__sed} -i -e "s/gnutls_transport_set_lowat(tls->session, 0);//" source4/lib/tls/tls.c
+%{__sed} -i -e "s/gnutls_transport_set_lowat(tlss->tls_session, 0);//" source4/lib/tls/tls_tstream.c
+
#cd examples/VFS
#mv README{,.vfs}
#cd ../..
install %{SOURCE9} source4/heimdal/lib/wind/rfc3454.txt
%build
+# use ld.bfd because gold doesn't understand linker script
+install -d our-ld
+ln -s %{_bindir}/ld.bfd our-ld/ld
+export PATH=$(pwd)/our-ld:$PATH
+
+
cd source3
%{__libtoolize}
%{__autoconf} -Im4 -I../m4 -I../lib/replace -Ilib/replace -I../source4
--with-acl-support \
--with-aio-support \
--with-automount \
- --with-cifsmount \
- --with-cifsumount \
- --with-cifsupcall \
--with-libsmbclient \
--with-lockdir=/var/lib/samba \
--with-pam \
%if %{with system_libtalloc}
--with-libtalloc=no \
--enable-external-libtalloc=yes \
+%endif
+%if %{with system_libtdb}
+ --with-libtdb=no \
+ --enable-external-libtdb=yes \
%endif
--without-included-popt \
- --%{?with_merged_build:en}%{!?with_merged_build:dis}able-merged-build \
- --enable-automatic-dependencies \
--enable-dso \
--%{?with_avahi:en}%{!?with_avahi:dis}able-avahi \
--disable-dnssd \
--with%{!?with_ldap:out}-ldap \
--with%{!?with_kerberos5:out}-krb5
-%{__make} -j1 everything pam_smbpass bin/smbget bin/mount.cifs bin/vfstest \
+%{__make} -j1 everything pam_smbpass bin/smbget bin/vfstest \
LD=ld
cd ../examples
DESTDIR=$RPM_BUILD_ROOT \
CONFIGDIR=$RPM_BUILD_ROOT%{_sysconfdir}/samba
-install source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_sbindir}
+install -p source3/script/mksmbpasswd.sh $RPM_BUILD_ROOT%{_sbindir}
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/samba
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/swat
-install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/samba
-install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/samba
-install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
-install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind
-install %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/winbind
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/samba
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/swat
+cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/samba
+cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/samba
+cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/samba/smb.conf
+install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind
+cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/winbind
-install nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2
+install -p nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so.2
ln -s libnss_winbind.so.2 $RPM_BUILD_ROOT/%{_lib}/libnss_winbind.so
-install nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so.2
+install -p nsswitch/libnss_wins.so $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so.2
ln -s libnss_wins.so.2 $RPM_BUILD_ROOT/%{_lib}/libnss_wins.so
-install source3/bin/wbinfo $RPM_BUILD_ROOT%{_bindir}
-install source3/bin/smbget $RPM_BUILD_ROOT%{_bindir}
-install source3/bin/vfstest $RPM_BUILD_ROOT%{_bindir}
+install -p source3/bin/wbinfo $RPM_BUILD_ROOT%{_bindir}
+install -p source3/bin/smbget $RPM_BUILD_ROOT%{_bindir}
+install -p source3/bin/vfstest $RPM_BUILD_ROOT%{_bindir}
-install source3/bin/libsmbclient.a $RPM_BUILD_ROOT%{_libdir}/libsmbclient.a
+cp -a source3/bin/libsmbclient.a $RPM_BUILD_ROOT%{_libdir}/libsmbclient.a
# smbwrapper
-install examples/libsmbclient/smbwrapper/smbwrapper.so $RPM_BUILD_ROOT%{_libdir}/smbwrapper.so
-install examples/libsmbclient/smbwrapper/smbsh $RPM_BUILD_ROOT%{_bindir}
-install examples/libsmbclient/smbwrapper/smbsh.1 $RPM_BUILD_ROOT%{_mandir}/man1
+install -p examples/libsmbclient/smbwrapper/smbwrapper.so $RPM_BUILD_ROOT%{_libdir}/smbwrapper.so
+install -p examples/libsmbclient/smbwrapper/smbsh $RPM_BUILD_ROOT%{_bindir}
+cp -p examples/libsmbclient/smbwrapper/smbsh.1 $RPM_BUILD_ROOT%{_mandir}/man1
# these are needed to build samba-pdbsql
-install -d $RPM_BUILD_ROOT%{_includedir}/%{name}/{tdb,nsswitch}
+install -d $RPM_BUILD_ROOT%{_includedir}/%{name}/nsswitch
cp -a source3/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
-cp -a lib/tdb/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}/tdb
cp -a nsswitch/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}/nsswitch
+%if %{without system_libtdb}
+install -d $RPM_BUILD_ROOT%{_includedir}/%{name}/tdb
+cp -a lib/tdb/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}/tdb
+%endif
touch $RPM_BUILD_ROOT/var/lib/samba/{wins.dat,browse.dat}
install examples/LDAP/samba.schema $RPM_BUILD_ROOT%{schemadir}
%endif
+%if %{with system_libtdb}
+# remove manuals of tdb if system lib used
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tdbbackup.8*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tdbdump.8*
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/tdbtool.8*
+%endif
+
%find_lang pam_winbind
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
# "This utility disabled until rewritten"
#%attr(755,root,root) %{_bindir}/setnttoken4
%endif
-%attr(755,root,root) %{_bindir}/ldb*
%attr(755,root,root) %{_bindir}/smbstatus
%attr(755,root,root) %{_bindir}/smbpasswd
+%attr(755,root,root) %{_bindir}/smbta-util
%attr(755,root,root) %{_bindir}/smbcontrol
+%dir %{_libdir}/%{name}/idmap
+%attr(755,root,root) %{_libdir}/%{name}/idmap/autorid.so
+%{_mandir}/man8/idmap_autorid.8*
%dir %{_libdir}/%{name}/pdb
%dir %{_vfsdir}
%attr(755,root,root) %{_vfsdir}/acl_tdb.so
%attr(755,root,root) %{_vfsdir}/acl_xattr.so
%attr(755,root,root) %{_vfsdir}/aio_fork.so
+%attr(755,root,root) %{_vfsdir}/crossrename.so
%attr(755,root,root) %{_vfsdir}/dirsort.so
%attr(755,root,root) %{_vfsdir}/fileid.so
+%attr(755,root,root) %{_vfsdir}/linux_xfs_sgid.so
%attr(755,root,root) %{_vfsdir}/preopen.so
%attr(755,root,root) %{_vfsdir}/shadow_copy2.so
%attr(755,root,root) %{_vfsdir}/smb_traffic_analyzer.so
%attr(755,root,root) %{_vfsdir}/streams_depot.so
%attr(755,root,root) %{_vfsdir}/streams_xattr.so
%attr(755,root,root) %{_vfsdir}/syncops.so
+%attr(755,root,root) %{_vfsdir}/time_audit.so
%attr(755,root,root) %{_vfsdir}/xattr_tdb.so
%{_mandir}/man8/vfs_acl_tdb.8*
%{_mandir}/man8/vfs_acl_xattr.8*
+%{_mandir}/man8/vfs_crossrename.8*
%{_mandir}/man8/vfs_dirsort.8*
%{_mandir}/man8/vfs_fileid.8*
%{_mandir}/man8/vfs_preopen.8*
%{_mandir}/man8/vfs_smb_traffic_analyzer.8*
%{_mandir}/man8/vfs_streams_xattr.8*
%{_mandir}/man8/vfs_streams_depot.8*
+%{_mandir}/man8/vfs_time_audit.8*
%{_mandir}/man8/vfs_xattr_tdb.8*
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/samba
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/samba
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.samba
-%{_mandir}/man1/ldb*.1*
%{_mandir}/man1/log2pcap.1*
%{_mandir}/man1/smbstatus.1*
%{_mandir}/man1/smbcontrol.1*
%attr(755,root,root) %{_bindir}/net4
%attr(755,root,root) %{_bindir}/nmblookup4
%attr(755,root,root) %{_bindir}/smbclient4
-%attr(755,root,root) %{_bindir}/mount.cifs4
-%attr(755,root,root) %{_bindir}/umount.cifs4
%attr(755,root,root) %{_bindir}/setnttoken4
%attr(755,root,root) %{_bindir}/smbtorture4
%endif
-%attr(755,root,root) /sbin/mount.cifs
-%attr(755,root,root) /sbin/umount.cifs
%attr(755,root,root) %{_bindir}/findsmb
%attr(755,root,root) %{_bindir}/net
%attr(755,root,root) %{_bindir}/nmblookup
%attr(755,root,root) %{_bindir}/smbsh
%attr(755,root,root) %{_bindir}/smbtar
%attr(755,root,root) %{_bindir}/smbtree
-%attr(755,root,root) %{_sbindir}/cifs.upcall
%attr(755,root,root) %{_libdir}/smbwrapper.so
%{_mandir}/man1/findsmb.1*
%{_mandir}/man1/nmblookup.1*
%{_mandir}/man1/smbtar.1*
%{_mandir}/man1/smbtree.1*
%{_mandir}/man8/net.8*
-%{_mandir}/man8/*mount.cifs.8*
-%{_mandir}/man8/cifs.upcall.8*
%files common
%defattr(644,root,root,755)
%{_includedir}/talloc.h
%endif
+%if %{without system_libtdb}
%files -n tdb
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/tdbbackup
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libtdb.so
%{_includedir}/tdb.h
+%endif
%files devel
%defattr(644,root,root,755)