update to 1.20.0 and enable qt6 build

Update to 1.20.0 required for a poppler update and Qt6 builds for KDE Gear rpms using Plasma 6.

The change is oriented on the archilinux build requiring a source copy and separate options compiling with qt5 or qt6.

The qgpgme and qgpgme-devel packages have been changed for each build preserving build compaitbility with the qt5 use.
qgpgme -> qgpgme-qt5
qgpgpe-devel: slit into header files qpgpgme-common-devel and qgpgme-qt5-devel, qgpgme-qt6-devel for the Qt6 builds.

When used with Qt6 builds, use BuildRequires: qgpgme-qt6-devel to draw in the right libs and dependencies.
This commit is contained in:
FAS Marie Loise Nolden 2023-06-16 10:32:28 +00:00
parent 14a530b154
commit ae00a96f33

View File

@ -6,7 +6,7 @@
Name: gpgme Name: gpgme
Summary: GnuPG Made Easy - high level crypto API Summary: GnuPG Made Easy - high level crypto API
Version: 1.17.1 Version: 1.20.0
Release: %autorelease Release: %autorelease
# MIT: src/cJSON.{c,h} (used by gpgme-json) # MIT: src/cJSON.{c,h} (used by gpgme-json)
@ -25,27 +25,16 @@ Patch1003: 0001-fix-stupid-ax_python_devel.patch
# Allow extra options to be passed to setup.py during installation # Allow extra options to be passed to setup.py during installation
Patch1004: 0002-setup_py_extra_opts.patch Patch1004: 0002-setup_py_extra_opts.patch
## upstream patches dealing with date and time overflow on 32-bit machines
# Before gpgme 1.18.0
Patch2001: 0001-qt-Prevent-u32-overflow-when-calculating-expiration.patch
Patch2002: 0002-qt-tests-Allow-1-day-offset-for-expiration-date.patch
# After gpgme 1.18.0
Patch2003: 0003-qt-Make-sure-expiration-time-is-interpreted-as-unsigned.patch
Patch2004: 0004-qt-tests-Log-the-actual-error-code-if-the-assertion-fails.patch
Patch2005: 0005-qt-tests-Make-sure-expiration-time-is-interpreted-as-unsigned.patch
Patch2006: 0006-qt-tests-Make-test-pass-on-32-bit-systems.patch
Patch2007: 0007-cpp-Fix-handling-of-no-key-or-invalid-time-situation.patch
## temporary downstream fixes ## temporary downstream fixes
# Skip lang/qt/tests/t-remarks on gnupg 2.4+ # Skip lang/qt/tests/t-remarks on gnupg 2.4+
Patch3001: 1001-qt-skip-test-remarks-for-gnupg2-2.4.patch Patch3001: 1001-qt-skip-test-remarks-for-gnupg2-2.4.patch
#BuildRequires: autoconf
#BuildRequires: automake
BuildRequires: make BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gawk BuildRequires: gawk
BuildRequires: texinfo
BuildRequires: gnupg2 >= %{gnupg2_min_ver} BuildRequires: gnupg2 >= %{gnupg2_min_ver}
BuildRequires: gnupg2-smime BuildRequires: gnupg2-smime
BuildRequires: libgpg-error-devel >= %{libgpg_error_min_ver} BuildRequires: libgpg-error-devel >= %{libgpg_error_min_ver}
@ -96,32 +85,57 @@ Provides: gpgme-pp-devel = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: gpgme-pp-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Provides: gpgme-pp-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}-devel%{?_isa} Requires: %{name}-devel%{?_isa}
# For automatic provides
BuildRequires: cmake
%description -n %{name}pp-devel %description -n %{name}pp-devel
%{summary} %{summary}
%if %{with qt} %if %{with qt}
%package -n q%{name} %package -n q%{name}-qt5
Summary: Qt API bindings/wrapper for GPGME 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)
Obsoletes: q%{name} < 1.20.0
Provides: q%{name}
%description -n q%{name} %description -n q%{name}-qt5
%{summary}. %{summary}.
%package -n q%{name}-devel %package -n q%{name}-qt6
Summary: Development libraries and header files for %{name} Summary: Qt6 API bindings/wrapper for GPGME
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6Test)
%description -n q%{name}-qt6
%{summary}.
%package -n q%{name}-common-devel
Summary: Common development header files for %{name}-qt5 and %{name}-qt6
Requires: %{name}pp-devel%{?_isa}
%description -n q%{name}-common-devel
%{summary}.
%package -n q%{name}-qt5-devel
Summary: Development libraries and header files for %{name}-qt5
# before libqgpgme.so symlink was moved to avoid conflict # before libqgpgme.so symlink was moved to avoid conflict
Conflicts: kdepimlibs-devel < 4.14.10-17 Conflicts: kdepimlibs-devel < 4.14.10-17
Requires: q%{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: q%{name}-qt5%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}pp-devel%{?_isa} Requires: q%{name}-common-devel%{?_isa}
# For automatic provides Obsoletes: q%{name}-devel < 1.20.0
BuildRequires: cmake Provides: q%{name}-devel = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: q%{name}-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n q%{name}-devel %description -n q%{name}-qt5-devel
%{summary}.
%package -n q%{name}-qt6-devel
Summary: Development libraries and header files for %{name}-qt6
Requires: q%{name}-qt6%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: q%{name}-common-devel%{?_isa}
%description -n q%{name}-qt6-devel
%{summary}. %{summary}.
%endif %endif
@ -148,6 +162,10 @@ sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpgme-config.in
# https://github.com/gpg/gpgme/pull/4 # https://github.com/gpg/gpgme/pull/4
sed -i 's/3.8/%{python3_version}/g' configure sed -i 's/3.8/%{python3_version}/g' configure
# copy to a qt6 build directory as both can't be build in the same directory
cd ..
cp -r gpgme-%{version} gpgme-%{version}-qt6
%build %build
# 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
@ -162,15 +180,25 @@ export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')"
export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')"
export SETUPTOOLS_USE_DISTUTILS=local export SETUPTOOLS_USE_DISTUTILS=local
# qt5
%configure --disable-static --disable-silent-rules --enable-languages=cpp,%{?with_qt:qt,}python %configure --disable-static --disable-silent-rules --enable-languages=cpp,%{?with_qt:qt,}python
%make_build %make_build
# qt6
cd ../gpgme-%{version}-qt6
%configure --disable-static --disable-silent-rules --enable-languages=cpp,%{?with_qt:qt6,}python
%make_build
%install %install
# When using distutils from setuptools 60+, ./setup.py install use # When using distutils from setuptools 60+, ./setup.py install use
# the .egg format. This forces setuptools to use .egg-info format. # the .egg format. This forces setuptools to use .egg-info format.
# SETUP_PY_EXTRA_OPTS is introduced by the Patch1004 above. # SETUP_PY_EXTRA_OPTS is introduced by the Patch1004 above.
export SETUPTOOLS_USE_DISTUTILS=local export SETUPTOOLS_USE_DISTUTILS=local
export SETUP_PY_EXTRA_OPTS="--single-version-externally-managed --root=/" export SETUP_PY_EXTRA_OPTS="--single-version-externally-managed --root=/"
# qt5
%make_install
# qt6
cd ../gpgme-%{version}-qt6
%make_install %make_install
# unpackaged files # unpackaged files
@ -193,7 +221,10 @@ chrpath -d %{buildroot}%{_bindir}/%{name}-tool
chrpath -d %{buildroot}%{_bindir}/%{name}-json chrpath -d %{buildroot}%{_bindir}/%{name}-json
chrpath -d %{buildroot}%{_libdir}/lib%{name}pp.so* chrpath -d %{buildroot}%{_libdir}/lib%{name}pp.so*
%if %{with qt} %if %{with qt}
# qt5
chrpath -d %{buildroot}%{_libdir}/libq%{name}.so* chrpath -d %{buildroot}%{_libdir}/libq%{name}.so*
# qt6
chrpath -d %{buildroot}%{_libdir}/libq%{name}qt6.so*
%endif %endif
# autofoo installs useless stuff for uninstall # autofoo installs useless stuff for uninstall
@ -234,15 +265,24 @@ make check
%{_libdir}/cmake/Gpgmepp/ %{_libdir}/cmake/Gpgmepp/
%if %{with qt} %if %{with qt}
%files -n q%{name} %files -n q%{name}-qt5
%doc lang/qt/README %doc lang/qt/README
%{_libdir}/libq%{name}.so.15* %{_libdir}/libq%{name}.so.15*
%files -n q%{name}-devel %files -n q%{name}-qt6
%{_libdir}/libq%{name}qt6.so.15*
%files -n q%{name}-common-devel
%{_includedir}/q%{name}/ %{_includedir}/q%{name}/
%{_includedir}/QGpgME/ %{_includedir}/QGpgME/
%files -n q%{name}-qt5-devel
%{_libdir}/libq%{name}.so %{_libdir}/libq%{name}.so
%{_libdir}/cmake/QGpgme/ %{_libdir}/cmake/QGpgme/
%files -n q%{name}-qt6-devel
%{_libdir}/libq%{name}qt6.so
%{_libdir}/cmake/QGpgmeQt6/
%endif %endif
%files -n python3-gpg %files -n python3-gpg