Use %bcond_without for libsmbclient

This commit is contained in:
Andreas Schneider 2020-10-19 15:53:32 +02:00
parent a31119d9e4
commit 0ac733db9b

View File

@ -3,9 +3,13 @@
# The testsuite is disabled by default. Set --with testsuite or bcond_without # The testsuite is disabled by default. Set --with testsuite or bcond_without
# to run the Samba torture testsuite. # to run the Samba torture testsuite.
%bcond_with testsuite %bcond_with testsuite
# ctdb is enabled by default, you can disable it with: --without clustering # ctdb is enabled by default, you can disable it with: --without clustering
%bcond_without clustering %bcond_without clustering
# Build a libsmbclient package by default
%bcond_without libsmbclient
%define samba_requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") %define samba_requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
%define main_release 13 %define main_release 13
@ -34,7 +38,6 @@
# https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/master/f/buildflags.md # https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/master/f/buildflags.md
%undefine _strict_symbol_defs_build %undefine _strict_symbol_defs_build
%global with_libsmbclient 1
%global with_libwbclient 1 %global with_libwbclient 1
%global with_vfs_cephfs 0 %global with_vfs_cephfs 0
@ -290,7 +293,7 @@ Requires(pre): %{name}-common = %{samba_depver}
Requires: %{name}-common = %{samba_depver} Requires: %{name}-common = %{samba_depver}
Requires: %{name}-common-libs = %{samba_depver} Requires: %{name}-common-libs = %{samba_depver}
Requires: %{name}-client-libs = %{samba_depver} Requires: %{name}-client-libs = %{samba_depver}
%if %with_libsmbclient %if %{with libsmbclient}
Requires: libsmbclient = %{samba_depver} Requires: libsmbclient = %{samba_depver}
%endif %endif
%if %with_libwbclient %if %with_libwbclient
@ -515,7 +518,7 @@ The %{name}-libs package contains the libraries needed by programs that link
against the SMB, RPC and other protocols provided by the Samba suite. against the SMB, RPC and other protocols provided by the Samba suite.
### LIBSMBCLIENT ### LIBSMBCLIENT
%if %with_libsmbclient %if %{with libsmbclient}
%package -n libsmbclient %package -n libsmbclient
Summary: The SMB client library Summary: The SMB client library
Requires(pre): %{name}-common = %{samba_depver} Requires(pre): %{name}-common = %{samba_depver}
@ -537,7 +540,7 @@ Requires: libsmbclient = %{samba_depver}
The libsmbclient-devel package contains the header files and libraries needed The libsmbclient-devel package contains the header files and libraries needed
to develop programs that link against the SMB client library in the Samba to develop programs that link against the SMB client library in the Samba
suite. suite.
#endif with_libsmbclient #endif {with libsmbclient}
%endif %endif
### LIBWBCLIENT ### LIBWBCLIENT
@ -575,7 +578,7 @@ Requires: python3-tevent
Requires: python3-tdb Requires: python3-tdb
Requires: python3-ldb Requires: python3-ldb
Requires: python3-dns Requires: python3-dns
%if %with_libsmbclient %if %{with libsmbclient}
Requires: libsmbclient = %{samba_depver} Requires: libsmbclient = %{samba_depver}
%endif %endif
%if %with_libwbclient %if %with_libwbclient
@ -637,7 +640,7 @@ Requires: %{name}-test-libs = %{samba_depver}
Requires: %{name}-dc-libs = %{samba_depver} Requires: %{name}-dc-libs = %{samba_depver}
%endif %endif
Requires: %{name}-libs = %{samba_depver} Requires: %{name}-libs = %{samba_depver}
%if %with_libsmbclient %if %{with libsmbclient}
Requires: libsmbclient = %{samba_depver} Requires: libsmbclient = %{samba_depver}
%endif %endif
%if %with_libwbclient %if %with_libwbclient
@ -848,7 +851,7 @@ xzcat %{SOURCE0} | gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} -
%global _libsmbclient %nil %global _libsmbclient %nil
%global _libwbclient %nil %global _libwbclient %nil
%if ! %with_libsmbclient %if %{without libsmbclient}
%global _libsmbclient smbclient, %global _libsmbclient smbclient,
%endif %endif
@ -880,7 +883,7 @@ export LDFLAGS="%{__global_ldflags} -fuse-ld=gold"
--with-pie \ --with-pie \
--with-relro \ --with-relro \
--without-fam \ --without-fam \
%if (! %with_libsmbclient) || (! %with_libwbclient) %if (%{without libsmbclient}) || (! %with_libwbclient)
--private-libraries=%{_samba_private_libraries} \ --private-libraries=%{_samba_private_libraries} \
%endif %endif
--with-system-mitkrb5 \ --with-system-mitkrb5 \
@ -1170,7 +1173,7 @@ fi
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%if %with_libsmbclient %if %{with libsmbclient}
%ldconfig_scriptlets -n libsmbclient %ldconfig_scriptlets -n libsmbclient
%endif %endif
@ -1555,10 +1558,10 @@ fi
#endif ! with_libwbclient #endif ! with_libwbclient
%endif %endif
%if ! %with_libsmbclient %if %{without libsmbclient}
%{_libdir}/samba/libsmbclient.so.* %{_libdir}/samba/libsmbclient.so.*
%{_mandir}/man7/libsmbclient.7* %{_mandir}/man7/libsmbclient.7*
#endif ! with_libsmbclient #endif without libsmbclient
%endif %endif
### COMMON ### COMMON
@ -1851,9 +1854,9 @@ fi
%{_libdir}/pkgconfig/dcerpc_server.pc %{_libdir}/pkgconfig/dcerpc_server.pc
%endif %endif
%if ! %with_libsmbclient %if %{without libsmbclient}
%{_includedir}/samba-4.0/libsmbclient.h %{_includedir}/samba-4.0/libsmbclient.h
#endif ! with_libsmbclient #endif without libsmbclient
%endif %endif
%if ! %with_libwbclient %if ! %with_libwbclient
@ -1896,7 +1899,7 @@ fi
%{_libdir}/samba/libxattr-tdb-samba4.so %{_libdir}/samba/libxattr-tdb-samba4.so
### LIBSMBCLIENT ### LIBSMBCLIENT
%if %with_libsmbclient %if %{with libsmbclient}
%files -n libsmbclient %files -n libsmbclient
%{_libdir}/libsmbclient.so.* %{_libdir}/libsmbclient.so.*
@ -1906,7 +1909,7 @@ fi
%{_libdir}/libsmbclient.so %{_libdir}/libsmbclient.so
%{_libdir}/pkgconfig/smbclient.pc %{_libdir}/pkgconfig/smbclient.pc
%{_mandir}/man7/libsmbclient.7* %{_mandir}/man7/libsmbclient.7*
#endif with_libsmbclient #endif {with libsmbclient}
%endif %endif
### LIBWBCLIENT ### LIBWBCLIENT