[packages/samba] - added no_libbsd patch and system_libbsd bcond

qboosh qboosh at pld-linux.org
Wed Apr 4 19:29:26 CEST 2018


commit 951298374567ad5831be48439a6f66bd2eeecd7e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Apr 4 19:29:24 2018 +0200

    - added no_libbsd patch and system_libbsd bcond

 samba-no_libbsd.patch | 35 +++++++++++++++++++++++++++++++++++
 samba.spec            |  7 +++++--
 2 files changed, 40 insertions(+), 2 deletions(-)
---
diff --git a/samba.spec b/samba.spec
index 7517e95..ffd33fe 100644
--- a/samba.spec
+++ b/samba.spec
@@ -8,7 +8,8 @@
 %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
@@ -57,6 +58,7 @@ Patch4:		unicodePwd-nthash-values-over-LDAP.patch
 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}
@@ -78,6 +80,7 @@ BuildRequires:	iconv
 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
@@ -121,7 +124,6 @@ BuildRequires:	tdb-devel >= %{tdb_ver}
 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}
@@ -533,6 +535,7 @@ wyeksportowania do PMCD.
 %{?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
diff --git a/samba-no_libbsd.patch b/samba-no_libbsd.patch
new file mode 100644
index 0000000..9603cce
--- /dev/null
+++ b/samba-no_libbsd.patch
@@ -0,0 +1,35 @@
+--- 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)
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/samba.git/commitdiff/951298374567ad5831be48439a6f66bd2eeecd7e



More information about the pld-cvs-commit mailing list