]> git.pld-linux.org Git - packages/libsmb2.git/commitdiff
- initial auto/th/libsmb2-2.0.0-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 16 Mar 2019 16:43:49 +0000 (17:43 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 16 Mar 2019 16:43:49 +0000 (17:43 +0100)
libsmb2-heimdal.patch [new file with mode: 0644]
libsmb2.spec [new file with mode: 0644]

diff --git a/libsmb2-heimdal.patch b/libsmb2-heimdal.patch
new file mode 100644 (file)
index 0000000..4a0ec5c
--- /dev/null
@@ -0,0 +1,50 @@
+--- libsmb2-2.0.0/lib/krb5-wrapper.c.orig      2018-07-07 09:58:21.000000000 +0200
++++ libsmb2-2.0.0/lib/krb5-wrapper.c   2019-03-15 21:44:42.462181391 +0100
+@@ -53,7 +53,7 @@
+ #include <unistd.h>
+ #endif
+-#include <krb5/krb5.h>
++#include <krb5.h>
+ #include <gssapi/gssapi_krb5.h>
+ #include <gssapi/gssapi.h>
+ #include <stdio.h>
+@@ -154,7 +154,6 @@
+         char *nc_password = NULL;
+         gss_buffer_desc passwd;
+         gss_OID_set_desc mechOidSet;
+-        gss_OID_set_desc wantMech;
+         if (smb2->use_cached_creds) {
+                 /* Validate the parameters */
+@@ -268,6 +267,8 @@
+         }
+         if (smb2->sec != SMB2_SEC_UNDEFINED) {
++#if 0 /* FIXME: heimdal */
++                gss_OID_set_desc wantMech;
+                 wantMech.count = 1;
+                 if (smb2->sec == SMB2_SEC_KRB5) {
+                         wantMech.elements = discard_const(&spnego_mech_krb5);
+@@ -280,6 +281,10 @@
+                         krb5_set_gss_error(smb2, "gss_set_neg_mechs", maj, min);
+                         return NULL;
+                 }
++#else
++                krb5_set_gss_error(smb2, "gss_set_neg_mechs not supported for heimdal", maj, min);
++                return NULL;
++#endif
+         }
+         if (nc_password) {
+--- libsmb2-2.0.0/configure.ac.orig    2018-07-07 09:58:21.000000000 +0200
++++ libsmb2-2.0.0/configure.ac 2019-03-15 21:09:40.073571008 +0100
+@@ -74,7 +74,7 @@
+     AS_HELP_STRING([--without-libkrb5], [Do not link with libkrb5 and use builtin NTLMSSP module for authentication instead.]))
+ AS_IF([test "x$with_libkrb5" != "xno"],
+-      [MAYBE_LIBKRB5="-lgssapi_krb5"
++      [MAYBE_LIBKRB5="-lgssapi"
+        AC_DEFINE(HAVE_LIBKRB5,1,[Whether we use gssapi_krb5 or not])
+        AC_MSG_NOTICE(Build with gssapi_krb5 support)
+        # check for gssapi/gssapi.h
diff --git a/libsmb2.spec b/libsmb2.spec
new file mode 100644 (file)
index 0000000..6421016
--- /dev/null
@@ -0,0 +1,106 @@
+# TODO: switch to MIT Kerberos, heimdal is missing gss_set_neg_mechs()
+#
+# Conditional build:
+%bcond_without kerberos5       # system KRB5 library (or builtin NTLMSSP module if disabled)
+%bcond_without static_libs     # static library
+%bcond_with    krb5            # MIT Kerberos instead of Heimdal
+#
+Summary:       Client library for accessing SMB shares over a network
+Summary(pl.UTF-8):     Biblioteka kliencka do dostępu do udziałów SMB w sieci
+Name:          libsmb2
+Version:       2.0.0
+Release:       1
+License:       LGPL v2.1+
+Group:         Libraries
+#Source0Download: https://github.com/sahlberg/libsmb2/releases
+Source0:       https://github.com/sahlberg/libsmb2/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 7df639e1d5a4d01e7bfcaa2152946384
+Patch0:                %{name}-heimdal.patch
+URL:           https://github.com/sahlberg/libsmb2
+BuildRequires: autoconf >= 2.50
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: pkgconfig
+BuildRequires: popt-devel
+Suggests:      gssntlmssp
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Client library for accessing SMB shares over a network.
+
+%description -l pl.UTF-8
+Biblioteka kliencka do dostępu do udziałów SMB w sieci.
+
+%package devel
+Summary:       Header files for libsmb2 library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki libsmb2
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description devel
+Header files for libsmb2 library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki libsmb2.
+
+%package static
+Summary:       Static libsmb2 library
+Summary(pl.UTF-8):     Statyczna biblioteka libsmb2
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+
+%description static
+Static libsmb2 library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka libsmb2.
+
+%prep
+%setup -q
+%if %{without krb5}
+%patch0 -p1
+%endif
+
+%build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+       %{!?with_static_libs:--disable-static} \
+       %{!?with_kerberos5:--without-libkrb5}
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libsmb2.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post  -p /sbin/ldconfig
+%postun        -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc COPYING README
+%attr(755,root,root) %{_libdir}/libsmb2.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libsmb2.so.2
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libsmb2.so
+%{_includedir}/smb2
+%{_pkgconfigdir}/libsmb2.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libsmb2.a
+%endif
This page took 0.109869 seconds and 4 git commands to generate.