%bcond check 1 # No Qt5 on RHEL 10 and higher %bcond qt5 %[ 0%{?rhel} < 10 ] %bcond qt6 1 #global gnupg2_min_ver 2.2.24 #global libgpg_error_min_ver 1.36 Name: qgpgme Summary: GnuPG Made Easy - high level crypto API Version: 2.0.0 Release: 3%{?dist} License: GPL-2.0-or-later URL: https://gnupg.org/related_software/gpgme/ Source0: https://gnupg.org/ftp/gcrypt/gpgmepp/qgpgme-%{version}.tar.xz Source1: https://gnupg.org/ftp/gcrypt/gpgmepp/qgpgme-%{version}.tar.xz.sig Source2: https://gnupg.org/signature_key.asc # prevent soname .so.15 conflict for qgpgme with compat-qgpgme124-qt{5,6} Patch1: gpgme-2.0.1-soname2.patch #BuildRequires: make BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ #BuildRequires: gawk #BuildRequires: texinfo #BuildRequires: gnupg2 >= #{gnupg2_min_ver} #BuildRequires: gnupg2-smime #BuildRequires: libgpg-error-devel >= #{libgpg_error_min_ver} #BuildRequires: libassuan-devel >= 2.4.2 # to remove RPATH BuildRequires: chrpath %description GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications. It provides a high-level crypto API for encryption, decryption, signing, signature verification and key management. %if %{with qt5} %package -n %{name}-qt5 Summary: Qt5 API bindings/wrapper for GPGME Requires: gpgmepp%{?_isa} >= %{version} BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Test) %description -n %{name}-qt5 %{summary}. %endif %if %{with qt6} %package -n %{name}-qt6 Summary: Qt6 API bindings/wrapper for GPGME Requires: gpgmepp%{?_isa} >= %{version} BuildRequires: pkgconfig(Qt6Core) BuildRequires: pkgconfig(Qt6Test) %description -n %{name}-qt6 %{summary}. %endif %if %{with qt5} %package -n %{name}-qt5-devel Summary: Development libraries and header files for %{name}-qt5 Requires: %{name}-qt5%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: %{name}-devel = %{?epoch:%{epoch}:}%{version}-%{release} Provides: %{name}-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} # for fedora 39 Obsoletes: %{name}-devel < 1.20.0 %description -n %{name}-qt5-devel %{summary}. %endif %if %{with qt6} %package -n %{name}-qt6-devel Summary: Development libraries and header files for %{name}-qt6 Requires: %{name}-qt6%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description -n %{name}-qt6-devel %{summary}. %endif %prep %autosetup -N -p1 -S gendiff # verify sources %{gpgverify} --keyring=%{SOURCE2} --signature=%{SOURCE1} --data=%{SOURCE0} %autopatch -p1 %generate_buildrequires %build ## 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 # platforms. #export CFLAGS="#{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" #export CXXFLAGS="#{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ## Explicit new lines in C(XX)FLAGS can break naive build scripts #export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" #export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" # build qt5/6 bindings qgpgme %cmake -DENABLE_SHARED=yes -DENABLE_STATIC=no -DBUILD_WITH_QT5=%[%{with qt5}?"ON":"OFF"] -DBUILD_WITH_QT6=%[%{with qt6}]?:"ON":"OFF"] %cmake_build %install %cmake_install # unpackaged files rm -fv %{buildroot}%{_infodir}/dir rm -fv %{buildroot}%{_libdir}/lib*.la %if %{with qt5} chrpath -d %{buildroot}%{_libdir}/lib%{name}.so* %endif %if %{with qt6} chrpath -d %{buildroot}%{_libdir}/lib%{name}qt6.so* %endif %if %{with check} %check cd redhat-linux-build make test %endif %if %{with qt5} %files -n %{name}-qt5 %license COPYING %doc AUTHORS ChangeLog NEWS README %{_libdir}/lib%{name}.so.15* %endif %if %{with qt6} %files -n %{name}-qt6 %license COPYING %doc AUTHORS ChangeLog NEWS README %{_libdir}/lib%{name}qt6.so.15* %endif %if %{with qt5} %files -n %{name}-qt5-devel %{_includedir}/%{name}-qt5/ %{_libdir}/lib%{name}.so %{_libdir}/cmake/QGpgme/ %endif %if %{with qt6} %files -n %{name}-qt6-devel %{_includedir}/%{name}-qt6/ %{_libdir}/lib%{name}qt6.so %{_libdir}/cmake/QGpgmeQt6/ %endif %changelog * Wed Feb 04 2026 Michal Hlavinka - 2.0.0-3 - initial build