# The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif %global major 1 %bcond cmake %["%{_vendor}" != "openEuler" && 0%{!?suse_version:1}] Name: libsmb2 Summary: SMB2/3 client library Version: 6.3 Release: %mkrel 1 URL: http://www.github.com/sahlberg/libsmb2 Source: https://github.com/sahlberg/libsmb2/archive/refs/tags/%lib{oname}-%{version}.tar.gz#/%{name}-%{name}-%{version}.tar.gz BuildRequires: ccache BuildRequires: gcc BuildRequires: pkgconfig BuildRequires: pkgconfig(krb5-gssapi) %if %{with cmake} License: LGPL-2.0-or-later Group: System/Libraries BuildRequires: cmake Provides: %{mklibname smb 2_%{major}} = %{version}-%{release} Provides: %{name}%{?_isa} = %{version}-%{release} %else Epoch: 0 License: GNU LGPL version 2.1 Group: System Environment/Libraries BuildRequires: automake BuildRequires: autoconf >= 2.71 BuildRequires: make BuildRequires: libtool Provides: lib = %{version} Vendor: Ronnie Sahlberg Packager: ronniesahlberg@gmail.com Prefix: /usr BuildRoot: %{_tmppath}/%{name}-%{version}-root %endif %description Libsmb2 is a SMB2/3 client library ####################################################################### %prep %if %{with cmake} %autosetup -p1 -n %{name}-%{name}-%{version} %else %setup -q -n %{name}-%{name}-%{version} # setup the init script and sysconfig file %setup -T -D -n %{name}-%{name}-%{version} -q %endif %build ## always run autogen.sh %if %{with cmake} %cmake -DENABLE_GSSAPI=ON -DENABLE_LIBKRB5=OFF %cmake_build %else aclocal autoheader autoconf libtoolize -c -f -i automake --add-missing ## check for ccache if ccache -h >/dev/null 2>&1 ; then CC="ccache gcc" else CC="gcc" fi export CC CFLAGS="$RPM_OPT_FLAGS $EXTRA -O2 -D_GNU_SOURCE" %configure --without-libkrb5 %endif %install %if %{with cmake} %cmake_install %else # Clean up in case there is trash left from a previous build rm -rf $RPM_BUILD_ROOT # Create the target build directory hierarchy make DESTDIR=$RPM_BUILD_ROOT install # Remove "*.old" files find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \; %endif %if ! %{with cmake} %clean rm -rf $RPM_BUILD_ROOT %endif ####################################################################### ## Files section ## ####################################################################### %files %defattr(-,root,root) %{_libdir}/libsmb2.so* %package devel Summary: Development libraries for LibSMB2 %if %{with cmake} Group: Development/Libraries %else Group: Development %endif Requires: %{name} = %{version}-%{release} %description devel development libraries for LibSMB2 %files devel %defattr(-,root,root) %{_includedir}/smb2/libsmb2.h %{_includedir}/smb2/libsmb2-raw.h %{_includedir}/smb2/libsmb2-dcerpc.h %{_includedir}/smb2/libsmb2-dcerpc-lsa.h %{_includedir}/smb2/libsmb2-dcerpc-srvsvc.h %{_includedir}/smb2/smb2.h %{_includedir}/smb2/smb2-errors.h %if ! %{with cmake} %{_libdir}/libsmb2.a %else %{_libdir}/cmake/%{name}/*.cmake %endif %{_libdir}/pkgconfig/libsmb2.pc %changelog * Thu Oct 22 2026 : Version 6.3.0 - Security fixes for malformed or hostile server replies: bounds checks on lengths and offsets in the PDU, NTLMSSP and SPNEGO decoders, the FILE_ALL_INFORMATION name, header-only replies, QUERY_INFO replies without data and the DCE/RPC array and string counts used by share enumeration. * Mon Dec 16 2024 : Version 6.1.0 - Fix return code for smb2-ls on failure - Fix memory errors in smb2_opendir() - Add a macro te test for the version of the share-enum api * Wed Dec 11 2024 : Version 6.0.0 - Major rewrites to DCE-RPC - Initial support for building servers * Mon Jan 17 2022 : Version 4.0.0 - Add support for SMB3 encryption - Add support for Anonymous NTLMSSP logins - Add support for readlink. - Add API to notify application of changes to which filehandles are used by libsmb2. - Add support for Big Endian DCERPC and allow it to be controlled from the URL. - Add support for 3.1.1 signing - Add support for PS2(EE) and PS3 - Fixes to UCS2 when compose characters are used. - Various MacOS fixes - Fix a few NULL dereferences * Mon Jun 10 2019 : Version 3.0.0 - ESP32 support - Support specifying the port number in an SMB URL. - Add creation time to smb_stat - Abort all commands when the context is destroyed. - Free all file and directory handles when the context is destroyed. - Fix handling of O_TRUNC - Add more error codes. - Add support for SMB2_IOCTL - Handle DCE/RPC fragment reassembly for IOCTL(). * Sat Jul 7 2018 : Version 2.0.0 - SMB2/3 signing - Kerberos authentication - Builtin NTLMSSP authentication for when libkrb5 is not available - Share enumeration - CMake support - Various bugfixes * Sun Mar 5 2017 : Version 1.0.0 - Initial version