--- /dev/null
+--- samba-4.7.6/lib/replace/wscript.orig 2018-04-01 20:31:57.522637016 +0200
++++ samba-4.7.6/lib/replace/wscript 2018-04-01 23:00:11.129202131 +0200
+@@ -281,17 +281,6 @@
+
+ strlcpy_in_bsd = False
+
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+- checklibc=True):
+- strlcpy_in_bsd = True
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+--- samba-4.7.6/lib/crypto/wscript_configure.orig 2017-09-17 21:15:34.000000000 +0200
++++ samba-4.7.6/lib/crypto/wscript_configure 2018-04-01 23:00:39.302535142 +0200
+@@ -2,12 +2,6 @@
+ import Options
+ import Utils
+
+-if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
+- checklibc=True):
+- conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
+- checklibc=True)
+- conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
+- checklibc=True)
+ conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h',
+ checklibc=True)
+
%bcond_without dmapi # DMAPI support
%bcond_without systemd # systemd integration
%bcond_with system_heimdal # Use system Heimdal libraries [since samba 4.4.x build fails with heimdal 1.5.x/7.x]
-%bcond_without system_libs # system libraries (talloc,tdb,tevent,ldb)
+%bcond_with system_libbsd # system libbsd for MD5 and strl* functions
+%bcond_without system_libs # system libraries from SAMBA project (talloc,tdb,tevent,ldb)
%bcond_without ctdb_pcp # Performance Co-Pilot support for CTDB
# turn on when https://bugzilla.samba.org/show_bug.cgi?id=11764 is fixed
%bcond_with replace
Patch5: %{name}-heimdal.patch
Patch6: server-role.patch
Patch7: %{name}-bug-9816.patch
+Patch8: %{name}-no_libbsd.patch
URL: https://www.samba.org/
BuildRequires: acl-devel
%{?with_avahi:BuildRequires: avahi-devel}
BuildRequires: keyutils-devel
BuildRequires: libaio-devel
BuildRequires: libarchive-devel >= 3.1.2
+%{?with_system_libbsd:BuildRequires: libbsd-devel}
BuildRequires: libcap-devel
BuildRequires: libcom_err-devel
BuildRequires: libmagic-devel
BuildRequires: tevent-devel >= %{tevent_ver}
%endif
BuildRequires: uid_wrapper >= 1.1.0
-BuildConflicts: libbsd-devel
Requires(post,preun): /sbin/chkconfig
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
%{?with_system_heimdal:%patch5 -p1}
%patch6 -p1
%patch7 -p1
+%{!?with_system_libbsd:%patch8 -p1}
%{__sed} -i -e 's|#!/usr/bin/env python|#!/usr/bin/python|' source4/scripting/bin/samba*
%{__sed} -i -e 's|#!/usr/bin/env perl|#!/usr/bin/perl|' pidl/pidl