[samba4/f17] Package libsmbclient and libwbclient internal.
asn
asn at fedoraproject.org
Fri Apr 20 13:32:14 UTC 2012
commit 451dc9f930d6e98db6175999ee4f73fc0902c63b
Author: Andreas Schneider <asn at cryptomilk.org>
Date: Fri Apr 20 13:05:36 2012 +0200
Package libsmbclient and libwbclient internal.
libsmbclient is the same library as provided by Samba3 and libwbclient
need to match the winbind protocol version. As long as we have Samba3
and Samba4 in the distribution we can't package them as publicly useable
libraries. Once we have only Samba4 we need to package them as system
shared libraries.
samba4-4.0.0-alpha20-lib-private.patch | 174 ++++++++++++++++++++++++++++++++
samba4.spec | 74 +++++++++++++-
2 files changed, 243 insertions(+), 5 deletions(-)
---
diff --git a/samba4-4.0.0-alpha20-lib-private.patch b/samba4-4.0.0-alpha20-lib-private.patch
new file mode 100644
index 0000000..b4121f8
--- /dev/null
+++ b/samba4-4.0.0-alpha20-lib-private.patch
@@ -0,0 +1,174 @@
+commit c09c288f7c239ec0d73091061d417e1562825c64
+Author: Andreas Schneider <asn at samba.org>
+AuthorDate: Mon Apr 16 17:07:05 2012 +0200
+Commit: Andreas Schneider <asn at cryptomilk.org>
+CommitDate: Tue Apr 17 16:17:35 2012 +0200
+
+ s3-waf: Fix client/smbclient dependencies.
+---
+ source3/wscript_build | 14 +++++++-------
+ 1 files changed, 7 insertions(+), 7 deletions(-)
+
+Index: samba-4.0.0alpha18/source3/wscript_build
+===================================================================
+--- samba-4.0.0alpha18.orig/source3/wscript_build
++++ samba-4.0.0alpha18/source3/wscript_build
+@@ -498,10 +498,10 @@ LIBNETAPI_SRC0 = '''lib/netapi/netapi.c
+
+ LIBNETAPI_SRC = '''${LIBNETAPI_SRC0}'''
+
+-CLIENT_SRC1 = '''client/client.c client/clitar.c
+- client/dnsbrowse.c'''
+-
+-CLIENT_SRC = '''${CLIENT_SRC1}'''
++CLIENT_SRC = '''
++ client/client.c
++ client/clitar.c
++ client/dnsbrowse.c'''
+
+ LIB_SMBCONF_SRC = 'lib/smbconf/smbconf_init.c lib/smbconf/smbconf_reg.c'
+
+@@ -1289,10 +1289,10 @@ bld.SAMBA3_BINARY('client/smbclient' + b
+ param
+ ndr-standard
+ SMBREADLINE
+- smbclient
++ libsmb
++ msrpc3
+ RPC_NDR_SRVSVC
+- cli_smb_common''',
+- vars=locals())
++ cli_smb_common''')
+
+ bld.SAMBA3_BINARY('net',
+ source=NET_SRC,
+Index: samba-4.0.0alpha18/nsswitch/libwbclient/wscript
+===================================================================
+--- /dev/null
++++ samba-4.0.0alpha18/nsswitch/libwbclient/wscript
+@@ -0,0 +1,31 @@
++#!/usr/bin/env python
++
++import Options, Logs
++
++# Remember to also update wbclient.h
++VERSION="0.9"
++
++def configure(conf):
++ if conf.CHECK_BUNDLED_SYSTEM_PKG('wbclient', minversion=VERSION):
++ conf.define('USING_SYSTEM_LIBWBCLIENT', 1)
++
++def build(bld):
++ if bld.CONFIG_SET('USING_SYSTEM_LIBWBCLIENT'):
++ Logs.info("\tSelected system libwbclient build")
++ return
++
++ Logs.info("\tSelected embedded libwbclient build")
++
++ bld.SAMBA_LIBRARY('wbclient',
++ source='''
++ wbc_guid.c
++ wbc_idmap.c
++ wbclient.c
++ wbc_pam.c
++ wbc_pwd.c
++ wbc_sid.c
++ wbc_util.c''',
++ deps='winbind-client',
++ pc_files='wbclient.pc',
++ public_headers='wbclient.h',
++ vnum=VERSION)
+Index: samba-4.0.0alpha18/nsswitch/libwbclient/wscript_build
+===================================================================
+--- samba-4.0.0alpha18.orig/nsswitch/libwbclient/wscript_build
++++ /dev/null
+@@ -1,9 +0,0 @@
+-#!/usr/bin/env python
+-
+-bld.SAMBA_LIBRARY('wbclient',
+- source='wbc_guid.c wbc_idmap.c wbclient.c wbc_pam.c wbc_pwd.c wbc_sid.c wbc_util.c',
+- deps='winbind-client',
+- pc_files='wbclient.pc',
+- public_headers='wbclient.h',
+- vnum='0'
+- )
+Index: samba-4.0.0alpha18/wscript
+===================================================================
+--- samba-4.0.0alpha18.orig/wscript
++++ samba-4.0.0alpha18/wscript
+@@ -93,6 +93,7 @@ def configure(conf):
+ conf.RECURSE('source4/auth')
+ conf.RECURSE('lib/nss_wrapper')
+ conf.RECURSE('nsswitch')
++ conf.RECURSE('nsswitch/libwbclient')
+ conf.RECURSE('lib/socket_wrapper')
+ conf.RECURSE('lib/uid_wrapper')
+ conf.RECURSE('lib/popt')
+Index: samba-4.0.0alpha18/nsswitch/libwbclient/wbclient.h
+===================================================================
+--- samba-4.0.0alpha18.orig/nsswitch/libwbclient/wbclient.h
++++ samba-4.0.0alpha18/nsswitch/libwbclient/wbclient.h
+@@ -68,9 +68,10 @@ const char *wbcErrorString(wbcErr error)
+ * 0.6: Made struct wbcInterfaceDetails char* members non-const
+ * 0.7: Added wbcSidToStringBuf()
+ * 0.8: Added wbcSidsToUnixIds() and wbcLookupSids()
++ * 0.9: Added support for WBC_ID_TYPE_BOTH
+ **/
+ #define WBCLIENT_MAJOR_VERSION 0
+-#define WBCLIENT_MINOR_VERSION 8
++#define WBCLIENT_MINOR_VERSION 9
+ #define WBCLIENT_VENDOR_VERSION "Samba libwbclient"
+ struct wbcLibraryDetails {
+ uint16_t major_version;
+Index: samba-4.0.0alpha18/buildtools/wafsamba/samba_bundled.py
+===================================================================
+--- samba-4.0.0alpha18.orig/buildtools/wafsamba/samba_bundled.py
++++ samba-4.0.0alpha18/buildtools/wafsamba/samba_bundled.py
+@@ -81,6 +81,10 @@ def LIB_MUST_BE_BUNDLED(conf, libname):
+ return ('ALL' in conf.env.BUNDLED_LIBS or
+ libname in conf.env.BUNDLED_LIBS)
+
++ at conf
++def LIB_MUST_BE_PRIVATE(conf, libname):
++ return ('ALL' in conf.env.PRIVATE_LIBS or
++ libname in conf.env.PRIVATE_LIBS)
+
+ @conf
+ def CHECK_PREREQUISITES(conf, prereqs):
+Index: samba-4.0.0alpha18/buildtools/wafsamba/wafsamba.py
+===================================================================
+--- samba-4.0.0alpha18.orig/buildtools/wafsamba/wafsamba.py
++++ samba-4.0.0alpha18/buildtools/wafsamba/wafsamba.py
+@@ -132,6 +132,9 @@ def SAMBA_LIBRARY(bld, libname, source,
+ enabled=True):
+ '''define a Samba library'''
+
++ if LIB_MUST_BE_PRIVATE(bld, libname):
++ private_library=True
++
+ if not enabled:
+ SET_TARGET_TYPE(bld, libname, 'DISABLED')
+ return
+Index: samba-4.0.0alpha18/buildtools/wafsamba/wscript
+===================================================================
+--- samba-4.0.0alpha18.orig/buildtools/wafsamba/wscript
++++ samba-4.0.0alpha18/buildtools/wafsamba/wscript
+@@ -27,6 +27,10 @@ def set_options(opt):
+ help=("comma separated list of bundled libraries. May include !LIBNAME to disable bundling a library. Can be 'NONE' or 'ALL' [auto]"),
+ action="store", dest='BUNDLED_LIBS', default='')
+
++ gr.add_option('--private-libraries',
++ help=("comma separated list of normally public libraries to build instead as private libraries. May include !LIBNAME to disable making a library private. Can be 'NONE' or 'ALL' [auto]"),
++ action="store", dest='PRIVATE_LIBS', default='')
++
+ extension_default = Options.options['PRIVATE_EXTENSION_DEFAULT']
+ gr.add_option('--private-library-extension',
+ help=("name extension for private libraries [%s]" % extension_default),
+@@ -230,6 +234,7 @@ def configure(conf):
+ conf.env.MODULESDIR = Options.options.MODULESDIR
+ conf.env.PRIVATELIBDIR = Options.options.PRIVATELIBDIR
+ conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',')
++ conf.env.PRIVATE_LIBS = Options.options.PRIVATE_LIBS.split(',')
+ conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',')
+ conf.env.DISABLE_SHARED = Options.options.disable_shared
+ conf.env.NONSHARED_BINARIES = Options.options.NONSHARED_BINARIES.split(',')
diff --git a/samba4.spec b/samba4.spec
index 28c1ca4..cb7b652 100644
--- a/samba4.spec
+++ b/samba4.spec
@@ -1,4 +1,4 @@
-%define main_release 41
+%define main_release 42
%define samba_version 4.0.0
%define talloc_version 2.0.7
@@ -9,6 +9,9 @@
%define samba_release %{main_release}%{pre_release}%{?dist}
+%define with_libsmbclient 0
+%define with_libwbclient 0
+
%define with_pam_smbpass 0
%define with_talloc 1
%define with_tevent 1
@@ -73,6 +76,7 @@ Patch2: samba4-samr-lsa-session_key.patch
Patch3: samba4-waf_target.patch
Patch4: samba4-external_ldap_callback.patch
Patch5: samba4-4.0.0-alpha19-CVE-2012-1182.patch
+Patch6: samba4-4.0.0-alpha20-lib-private.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@@ -165,7 +169,9 @@ of SMB/CIFS shares and printing to SMB/CIFS printers.
%package libs
Summary: Samba libraries
Group: Applications/System
+%if %with_libwbclient
Requires: libwbclient
+%endif
%description libs
The samba4-libs package contains the libraries needed by programs that
@@ -250,7 +256,9 @@ the local kerberos library to use the same KDC as samba and winbind use
%package winbind-clients
Summary: Samba winbind clients
Group: Applications/System
+%if %with_libwbclient
Requires: libwbclient
+%endif
Conflicts: samba-winbind-clients < %{samba_depver}
@@ -269,6 +277,7 @@ The samba-swat package includes the new SWAT (Samba Web Administration
Tool), for remotely managing Samba's smb.conf file using your favorite
Web browser.
+%if %with_libsmbclient
%package -n libsmbclient
Summary: The SMB client library
Group: Applications/System
@@ -291,7 +300,9 @@ Provides: libsmbclient-devel = %{samba_depver}
%description -n libsmbclient-devel
The libsmbclient-devel package contains the header files and libraries needed to
develop programs that link against the SMB client library in the Samba suite.
+%endif # with_libsmbclient
+%if %with_libwbclient
%package -n libwbclient
Summary: The winbind client library
Group: Applications/System
@@ -306,6 +317,7 @@ Requires: libwbclient = %{samba_depver}
%description -n libwbclient-devel
The libwbclient-devel package provides developer tools for the wbclient library.
+%endif # with_libwbclient
%package dc
Summary: Samba AD Domain Controller
@@ -333,6 +345,7 @@ link against the SMB, RPC and other protocols.
%patch3 -p1 -b .waf_target
%patch4 -p1 -b .external_callback
%patch5 -p1 -b .CVE-2012-1182
+%patch6 -p1 -b .private-lib
%build
%define _talloc_lib %nil
@@ -365,6 +378,29 @@ link against the SMB, RPC and other protocols.
%define _samba4_modules %{_samba4_idmap_modules},%{_samba4_pdb_modules},%{_samba4_auth_modules}
+# libsmbclient and libwbclient package
+
+#%if (! %with_libsmbclient) && (! %with_libwbclient)
+#%define _samba4_private_libraries smbclient,wbclient
+#%else if ! %with_libsmbclient
+#%define _samba4_private_libraries smbclient,
+#%else if ! %with_libwbclient
+#%define _samba4_private_libraries wbclient,
+#%endif
+
+%define _libsmbclient %nil
+%define _libwbclient %nil
+
+%if ! %with_libsmbclient
+%define _libsmbclient smbclient,smbsharemodes,
+%endif
+
+%if ! %with_libwbclient
+%define _libwbclient wbclient,
+%endif
+
+%define _samba4_private_libraries %{_libsmbclient}%{_libwbclient}
+
%configure \
--enable-fhs \
--with-piddir=/run \
@@ -378,6 +414,9 @@ link against the SMB, RPC and other protocols.
--with-shared-modules=%{_samba4_modules} \
--builtin-libraries=ccan \
--bundled-libraries=%{_samba4_libraries} \
+%if (! %with_libsmbclient) || (! %with_libwbclient)
+ --private-libraries=%{_samba4_private_libraries} \
+%endif
%if ! %with_pam_smbpass
--without-pam_smbpass
%endif
@@ -535,10 +574,6 @@ if [ $1 -ge 1 ] ; then
fi
%endif
-%post -n libsmbclient -p /sbin/ldconfig
-
-%postun -n libsmbclient -p /sbin/ldconfig
-
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
@@ -590,9 +625,17 @@ exit 0
%postun winbind-clients -p /sbin/ldconfig
+%if %with_libsmbclient
+%post -n libsmbclient -p /sbin/ldconfig
+
+%postun -n libsmbclient -p /sbin/ldconfig
+%endif # with_libsmbclient
+
+%if %with_libwbclient
%post -n libwbclient -p /sbin/ldconfig
%postun -n libwbclient -p /sbin/ldconfig
+%endif # with_libwbclient
%clean
rm -rf %{buildroot}
@@ -741,6 +784,19 @@ rm -rf %{buildroot}
%{_libdir}/samba/libtdb.so.%{tdb_version}
%endif
+%if ! %with_libsmbclient
+%{_libdir}/samba/libsmbclient.so.*
+%{_libdir}/samba/libsmbsharemodes.so.*
+%{_includedir}/samba-4.0/libsmbclient.h
+%{_includedir}/samba-4.0/smb_share_modes.h
+%endif # ! with_libsmbclient
+
+%if ! %with_libwbclient
+%{_libdir}/samba/libwbclient.so.*
+%{_libdir}/samba/libwinbind-client.so
+%{_includedir}/samba-4.0/wbclient.h
+%endif # ! with_libwbclient
+
%files common
%defattr(-,root,root)
#%{_libdir}/samba/charset ???
@@ -1121,6 +1177,7 @@ rm -rf %{buildroot}
#%{_mandir}/man8/swat.8*
#%attr(755,root,root) %{_libdir}/samba/*.msg
+%if %with_libsmbclient
%files -n libsmbclient
%defattr(-,root,root)
%attr(755,root,root) %{_libdir}/libsmbclient.so.*
@@ -1135,7 +1192,9 @@ rm -rf %{buildroot}
%{_libdir}/pkgconfig/smbclient.pc
#%{_libdir}/pkgconfig/smbsharemodes.pc
#%{_mandir}/man7/libsmbclient.7*
+%endif # with_libsmbclient
+%if %with_libwbclient
%files -n libwbclient
%defattr(-,root,root)
%{_libdir}/libwbclient.so.*
@@ -1146,8 +1205,13 @@ rm -rf %{buildroot}
%{_includedir}/samba-4.0/wbclient.h
%{_libdir}/libwbclient.so
%{_libdir}/pkgconfig/wbclient.pc
+%endif # with_libwbclient
%changelog
+* Fri Apr 20 2012 - Andreas Schneider <asn at redhat.com> - 4.0.0-42.alpha18
+- Package libsmbclient and libwbclient internal.
+- resolves: #814451
+
* Wed Apr 18 2012 Andreas Schneider <asn at redhat.com> - 4.0.0-41.alpha18
- Rename libsmbclient4 to libsmbclient.
More information about the scm-commits
mailing list