rx-gpgme: don't build python bindings by default

This commit is contained in:
Raven 2024-05-22 11:28:09 +06:00
parent 1df44d1f99
commit 011cf18068

View File

@ -2,11 +2,11 @@
# No Qt5 on RHEL 10 and higher # No Qt5 on RHEL 10 and higher
%bcond_without qt5 %bcond_without qt5
%bcond_without qt6 %bcond_without qt6
%bcond_without python %bcond_with python
%global base_name gpgme %global base_name gpgme
%global gnupg2_min_ver 2.2.24 %global gnupg2_min_ver 2.2.24
%global libgpg_error_min_ver 1.36 %global libgpg_error_min_ver 1.40
# we are doing out of source build # we are doing out of source build
%global _configure ../configure %global _configure ../configure
@ -18,6 +18,7 @@
%global python3_pkgversion 3.11 %global python3_pkgversion 3.11
%global _syslibdir %{_libdir} %global _syslibdir %{_libdir}
%global _sysincludedir %{_includedir}
%global _prefix /opt/rx %global _prefix /opt/rx
%global _sysconfdir %{_prefix}/etc %global _sysconfdir %{_prefix}/etc
@ -56,8 +57,8 @@ Patch3001: 1001-qt-skip-test-remarks-for-gnupg2-2.4.patch
BuildRequires: make BuildRequires: make
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc #BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: clang
BuildRequires: gawk BuildRequires: gawk
BuildRequires: texinfo BuildRequires: texinfo
BuildRequires: rx-gnupg2 >= %{gnupg2_min_ver} BuildRequires: rx-gnupg2 >= %{gnupg2_min_ver}
@ -76,6 +77,8 @@ BuildRequires: cmake
Requires: rx-gnupg2 >= %{gnupg2_min_ver} Requires: rx-gnupg2 >= %{gnupg2_min_ver}
Provides: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
# On the following architectures workaround multiarch conflict of -devel packages: # On the following architectures workaround multiarch conflict of -devel packages:
%define multilib_arches %{ix86} x86_64 ia64 ppc ppc64 s390 s390x %{sparc} %define multilib_arches %{ix86} x86_64 ia64 ppc ppc64 s390 s390x %{sparc}
@ -102,6 +105,7 @@ Conflicts: gpgme-devel
Summary: C++ bindings/wrapper for GPGME Summary: C++ bindings/wrapper for GPGME
Provides: %{name}-pp = %{?epoch:%{epoch}:}%{version}-%{release} Provides: %{name}-pp = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: %{name}-pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n %{name}pp %description -n %{name}pp
@ -126,7 +130,8 @@ Summary: Qt5 API bindings/wrapper for GPGME
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Test)
Provides: rx-q%{base_name} Obsoletes: rx-q%{base_name} < %{?epoch:%{epoch}:}%{version}-%{release}
Provides: rx-q%{base_name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n rx-q%{base_name}-qt5 %description -n rx-q%{base_name}-qt5
%{summary}. %{summary}.
@ -207,14 +212,16 @@ sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpgme-config.in
sed -i 's/3.8/%{python3_pkgversion}/g' configure sed -i 's/3.8/%{python3_pkgversion}/g' configure
%build %build
export CC=clang
export CXX=clang++
# People neeed to learn that you can't run autogen.sh anymore # People neeed to learn that you can't run autogen.sh anymore
#./autogen.sh #./autogen.sh
# Since 1.16.0, we need to explicitly pass -D_LARGEFILE_SOURCE and # Since 1.16.0, we need to explicitly pass -D_LARGEFILE_SOURCE and
# -D_FILE_OFFSET_BITS=64 for the QT binding to build successfully on 32-bit # -D_FILE_OFFSET_BITS=64 for the QT binding to build successfully on 32-bit
# platforms. # platforms.
export CFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' export CFLAGS='-I%{_sysincludedir} -I%{_sysincludedir}/Qt6 %{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
export CXXFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' export CXXFLAGS='-I%{_sysincludedir} -I%{_sysincludedir}/Qt6 %{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
# Explicit new lines in C(XX)FLAGS can break naive build scripts # Explicit new lines in C(XX)FLAGS can break naive build scripts
export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')"
export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')"
@ -298,8 +305,8 @@ rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt
# Remove duplicate stuff # Remove duplicate stuff
rm -rf %{buildroot}%{_bindir}/%{base_name}-json rm -rf %{buildroot}%{_bindir}/%{base_name}-json
rm -fv %{buildroot}%{_libdir}/lib%{base_name}.so.11 #rm -fv %{buildroot}%{_libdir}/lib%{base_name}.so.11
rm -fv %{buildroot}%{_libdir}/lib%{base_name}pp.so.6 #rm -fv %{buildroot}%{_libdir}/lib%{base_name}pp.so.6
mkdir -p %{buildroot}%{_syslibdir}/cmake mkdir -p %{buildroot}%{_syslibdir}/cmake
ln -sf %{_libdir}/cmake/Gpgmepp %{buildroot}%{_syslibdir}/cmake/Gpgmepp ln -sf %{_libdir}/cmake/Gpgmepp %{buildroot}%{_syslibdir}/cmake/Gpgmepp
@ -320,7 +327,7 @@ popd
%files %files
%license COPYING* LICENSES %license COPYING* LICENSES
%doc AUTHORS NEWS README* %doc AUTHORS NEWS README*
%{_libdir}/lib%{base_name}.so.11.* %{_libdir}/lib%{base_name}.so.11*
%files devel %files devel
%{_bindir}/%{base_name}-config %{_bindir}/%{base_name}-config
@ -337,7 +344,7 @@ popd
%files -n %{name}pp %files -n %{name}pp
%doc lang/cpp/README %doc lang/cpp/README
%{_libdir}/lib%{base_name}pp.so.6.* %{_libdir}/lib%{base_name}pp.so.6*
%files -n %{name}pp-devel %files -n %{name}pp-devel
%{_includedir}/%{base_name}++/ %{_includedir}/%{base_name}++/