# The naming scheme in non-Mandriva-based distros %if 0%{?mklibname:1} %define libname %{mklibname smb2 _%{major}} %define devname %{mklibname smb2 -d} %else %define devname %{name}-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.2 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 %if "%{_vendor}" != "redhat" && 0%{!?fedora:1} BuildRequires: ccache %endif BuildRequires: gcc BuildRequires: pkgconfig BuildRequires: pkgconfig(krb5-gssapi) %if %{with cmake} License: LGPL-2.0-or-later Group: System/Libraries BuildRequires: cmake %else Epoch: 0 License: GNU LGPL version 2.1 Group: System Environment/Libraries Provides: lib = %{version} BuildRequires: automake BuildRequires: autoconf >= 2.71 BuildRequires: make BuildRequires: libtool 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 -Wno-discarded-qualifiers -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" -o -name '*.la' \) -exec rm -f {} \; %endif %if ! %{with cmake} %clean rm -rf $RPM_BUILD_ROOT %endif ####################################################################### ## Files section ## ####################################################################### %files %defattr(-,root,root) %if 0%{?mklibname:1} # empty list %package -n %{libname} Summary: SMB2/3 client library Group: System/Libraries %description -n %{libname} Libsmb2 is a SMB2/3 client library %files -n %{libname} %endif %{_libdir}/libsmb2.so* %package -n %{devname} Summary: Development libraries for LibSMB2 %if %{with cmake} Group: Development/Libraries %else Group: Development %endif Requires: %{name} = %{version}-%{release} %description -n %{devname} development libraries for LibSMB2 %files -n %{devname} %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