File qca-qt6-2.3.10.spec of Package qca-qt6-2.3.10

#
# spec file for package qca
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global flavor qt6%{nil}
%if "%{flavor}" == ""
%define pkgname_suffix %{nil}
ExclusiveArch:  do_not_build
%endif
%if "%{flavor}" == "qt5"
  %define qt5 1
  %define pkgname_suffix -qt5
  %define qt_min_version 5.14
  %define _plugindir %{_libqt5_plugindir}
%endif
# %%elif requires rpm 4.15...
%if "%{flavor}" == "qt6"
  %define qt6 1
  %define pkgname_suffix -qt6
  %define qt_min_version 6.0
  %define _plugindir %{_qt6_pluginsdir}
%endif
#
%define _soversion 2
%bcond_without pkcs11
Name:           qca%{pkgname_suffix}
Version:        2.3.10
Release:        lp155.2.2
Summary:        Qt Cryptographic Architecture 2
License:        LGPL-2.1-or-later
URL:            https://userbase.kde.org/QCA
Source0:        https://download.kde.org/stable/qca/%{version}/qca-%{version}.tar.xz
Source1:        https://download.kde.org/stable/qca/%{version}/qca-%{version}.tar.xz.sig
Source2:        qca.keyring
BuildRequires:  ca-certificates-mozilla
BuildRequires:  cmake
BuildRequires:  gpg2
BuildRequires:  libgcrypt-devel
BuildRequires:  libjpeg-devel
%if %{with pkcs11}
BuildRequires:  pkcs11-helper-devel
%endif
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
%if 0%{?qt5}
BuildRequires:  cmake(Qt5Core) >= %{qt_min_version}
BuildRequires:  cmake(Qt5Network) >= %{qt_min_version}
BuildRequires:  cmake(Qt5Test) >= %{qt_min_version}
%endif
%if 0%{?qt6}
BuildRequires:  cmake(Qt6Core) >= %{qt_min_version}
BuildRequires:  cmake(Qt6Core5Compat) >= %{qt_min_version}
BuildRequires:  cmake(Qt6Network) >= %{qt_min_version}
BuildRequires:  cmake(Qt6Test) >= %{qt_min_version}
%endif
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(libsasl2)
BuildRequires:  pkgconfig(nss)
BuildRequires:  pkgconfig(openssl) >= 1.1.1
Requires:       gpg2 >= 2.0.0
%if 0%{?qt5}
# The plugins used to be in the same package as the library
Obsoletes:      libqca-qt5 <= 2.3.2
%endif

%description
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.

%package -n libqca-%{flavor}-%{_soversion}
Summary:        QCA library
%if 0%{?qt5}
Provides:       libqca-qt5 = %{version}
Obsoletes:      libqca-qt5 < %{version}
%endif
Requires:       %{name} >= %{version}
Recommends:     %{name}-plugins

%description -n libqca-%{flavor}-%{_soversion}
The Qt cryptographic library.

%package devel
Summary:        Development files for the Qt Cryptographic Architecture 2
Requires:       libqca-%{flavor}-%{_soversion} = %{version}
%if 0%{?qt5}
Requires:       cmake(Qt5Core) >= %{qt_min_version}
Requires:       cmake(Qt5Network) >= %{qt_min_version}
Provides:       libqca-qt5-devel = %{version}
Obsoletes:      libqca-qt5-devel < %{version}
%endif
%if 0%{?qt6}
Requires:       cmake(Qt6Core) >= %{qt_min_version}
Requires:       cmake(Qt6Network) >= %{qt_min_version}
%endif

%description devel
This package provides a generic Qt cryptographic architecture,
including a library and a plugin for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES and AES.

%package plugins
Summary:        Various plugins for the Qt Cryptographic Architecture 2
%if 0%{?qt5}
Provides:       libqca-qt5-plugins = %{version}
Obsoletes:      libqca-qt5-plugins < %{version}
%endif

%description plugins
This package provides a generic Qt cryptographic architecture,
including a library and a plug-in for using all supported capabilities
of openssl, like SSL/TLS, X509, RSA, SHA1, MD5, Blowfish, 3DES, and
AES.

It can be extended by further plug-ins, for example, with qca-sasl for
SASL support.

%prep
%autosetup -p1 -n qca-%{version}
# Don't build examples
echo > examples/CMakeLists.txt

# The pgp test fails randomly
sed -i '/pgpunittest/d' unittest/CMakeLists.txt

%build
%if 0%{?qt5}
%cmake \
%else
%cmake_qt6 \
  -DBUILD_WITH_QT6=ON \
%endif
  -DBUILD_TESTS=ON \
  -DQCA_INSTALL_IN_QT_PREFIX=ON \
  -DQCA_BINARY_INSTALL_DIR:PATH="%{_bindir}" \
  -DQCA_MAN_INSTALL_DIR:PATH="%{_mandir}" \
  -DWITH_botan_PLUGIN=OFF

%if 0%{?qt5}
%cmake_build
%else
%qt6_build
%endif

%install
%if 0%{?qt5}
%cmake_install
%else
%qt6_install
%endif

%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH
%if 0%{?qt5}
export QT_PLUGIN_PATH=%{buildroot}%{_libqt5_plugindir}:%{_libqt5_plugindir}
%else
export QT_PLUGIN_PATH=%{buildroot}%{_qt6_pluginsdir}:%{_qt6_pluginsdir}
%endif
# The 'PGP' test fails randomly
%define _smp_mflags -j1
%ctest

%ldconfig_scriptlets -n libqca-%{flavor}-%{_soversion}

%files
%dir %{_plugindir}/crypto
%{_plugindir}/crypto/libqca-gcrypt.so
%{_plugindir}/crypto/libqca-gnupg.so
%{_plugindir}/crypto/libqca-logger.so
%{_plugindir}/crypto/libqca-ossl.so
%{_plugindir}/crypto/libqca-softstore.so

%files -n libqca-%{flavor}-%{_soversion}
%license COPYING
%doc README
%{_libdir}/libqca-%{flavor}.so.%{_soversion}
%{_libdir}/libqca-%{flavor}.so.%{version}

%files devel
%{_bindir}/mozcerts-%{flavor}
%{_bindir}/qcatool-%{flavor}
%{_includedir}/%{flavor}/Qca-%{flavor}/
%if 0%{?qt5}
%{_libdir}/%{flavor}/mkspecs/features/crypto.prf
%endif
%{_libdir}/cmake/Qca-%{flavor}/
%{_libdir}/libqca-%{flavor}.so
%if 0%{?qt5}
%{_libdir}/pkgconfig/qca2-%{flavor}.pc
%endif
%{_mandir}/man1/qcatool-%{flavor}.1%{?ext_man}

%files plugins
%{_plugindir}/crypto/libqca-cyrus-sasl.so
%{_plugindir}/crypto/libqca-nss.so
%if %{with pkcs11}
%{_plugindir}/crypto/libqca-pkcs11.so
%endif

%changelog
* Tue Jul 25 2023 Christophe Marin <christophe@krop.fr>
- Update to 2.3.7
  * OpenSSL3: don't quit if legacy provider is unavailable
* Wed May  3 2023 Christophe Marin <christophe@krop.fr>
- Update to 2.3.6. No changelog.
- Drop patches, merged upstream:
  * 0001-Remove-test-that-openssl-has-decided-it-s-wrong.patch
  * 0001-hashunittest-run-sha384longtest-only-for-providers-t.patch
* Mon Feb 20 2023 Christophe Marin <christophe@krop.fr>
- Disable the pgp test. It fails randomly.
* Mon Feb 20 2023 Otto Hollmann <otto.hollmann@suse.com>
- Remove test that openssl has decided it's wrong [boo#1208393]
  * Add 0001-Remove-test-that-openssl-has-decided-it-s-wrong.patch
* Wed Oct 26 2022 Fabian Vogt <fvogt@suse.com>
- BR ca-certificates-mozilla for the testsuite
- Have the devel package require the library
- Drop qca-2.3.0-fixDSA.patch, that was fixed in 2014 already by
  just disabling DSA
- Add upstream change:
  * 0001-hashunittest-run-sha384longtest-only-for-providers-t.patch
* Wed Oct 19 2022 Christophe Giboudeaux <christophe@krop.fr>
- Update to 2.3.5
  * find dependencies of Qca when the cmake package is used by a
    project
  * Handle openssl without case5 support
  * Update rootcerts.pem
  * SafeSocketNotifier: fix socket FD type and remove signal
    argument
- Drop patch, merged upstream:
  * 0001-Make-filewatchunittest-much-quicker.patch
* Thu Oct 21 2021 Christophe Giboudeaux <christophe@krop.fr>
- Set LD_LIBRARY_PATH before running tests.
* Tue Sep 14 2021 Fabian Vogt <fabian@ritter-vogt.de>
- Run ctest in %%check
- Add patch to make %%check much quicker:
  * 0001-Make-filewatchunittest-much-quicker.patch
* Tue Sep 14 2021 Fabian Vogt <fabian@ritter-vogt.de>
- Update to 2.3.4:
  * OpenSSL 3 support
  * Don't create pkgconfig files for Qt 6 builds
  * Minor test fix
* Fri Jun 18 2021 Fabian Vogt <fabian@ritter-vogt.de>
- Mention soversion in %%files
- Require main plugins from the library (for now, boo#1187447)
- Recommend optional plugins from the library
* Wed Jun 16 2021 Wolfgang Bauer <wbauer@tmo.at>
- Recommend the main package in the Qt5 flavor as well
* Fri Jun  4 2021 Christophe Giboudeaux <christophe@krop.fr>
- Rename libqca-qt5 to qca and use flavors to build Qt5 and Qt6
  variants.
* Thu Jun  3 2021 Wolfgang Bauer <wbauer@tmo.at>
- Update to 2.3.3:
  * Add Qt6 support. Use -DQT6=ON when running cmake
  * Minimum Qt5 supported version updated to 5.14
  * Minor doc fixes
- Rebase qca-2.3.0-fixDSA.patch
* Thu Feb 11 2021 Christophe Giboudeaux <christophe@krop.fr>
- Add a keyring file
- Use cmake() syntax for Qt build requirements
* Fri Feb  5 2021 Paolo Stivanin <info@paolostivanin.com>
- Update to 2.3.2:
  * Add macOS framework major version
  * qca-gcrypt: Add support for HKDF
  * Minimum Qt updated to 5.9
  * Fixed compilation with gcc 11
- Rebase qca-2.3.0-fixDSA.patch
* Mon Jul  6 2020 Wolfgang Bauer <wbauer@tmo.at>
- Update to 2.3.1
  * fixes memleaks and crashes
* Tue Mar 10 2020 Antonio Larrosa <alarrosa@suse.com>
- Remove baselibs.conf
* Wed Feb 26 2020 Wolfgang Bauer <wbauer@tmo.at>
- Update to 2.3.0
  * Qt5 is the only supported Qt series now
  * OpenSSL <= 1.1.0 is no longer supported
  * Various botan bugfixes
  * More dynamic test coverage of backend capabilities
  * no longer tries to setuid when the effective uid is not root
- Rename qca-2.2.1-fixDSA.patch to qca-2.3.0-fixDSA.patch and
  rebase it
- Update minimum required Qt5 and cmake versions
* Mon Sep  9 2019 Christophe Giboudeaux <christophe@krop.fr>
- Drop the obsolete libqca2 package.
- Run spec-cleaner
* Fri Apr 26 2019 Fabian Vogt <fabian@ritter-vogt.de>
- Fix source URL
* Fri Apr 26 2019 Wolfgang Bauer <wbauer@tmo.at>
- Update to 2.2.1
  * support for openssl 1.1
  * support for AES GCM and AES CCM modes
  * new base64 convenience functions
  * new botan2 support
  * new hkdf support
  * various build improvements and (deprecation) cleanups
- Drop patches merged upstream:
  * 0001-Revert-tlsunittest-disable-some-ciphers.patch
  * 0002-Disable-missed-openssl-cipher-suites.patch
  * 0003-Add-support-for-OpenSSL-1.1.0.patch
  * ansi.diff
- Rename qca-2.1.3-fixDSA.patch to qca-2.2.1-fixDSA.patch and
  rebase it
- Re-enable pkcs11, there is no openssl conflict anymore
- Don't hardcode the certstore path anymore, ca-certificates is
  BuldRequired so this can be detected automatically
* Thu Oct 25 2018 Jason Sikes <jsikes@suse.de>
- Fix segfault when creating DSA keys
  * [qca-2.1.3-fixDSA.patch]
  * bsc#1108634
* Wed Dec 27 2017 jengelh@inai.de
- Diversify subpackage descriptions.
* Wed Dec 20 2017 fabian@ritter-vogt.de
- Add patches to support OpenSSL 1.1.0:
  * 0001-Revert-tlsunittest-disable-some-ciphers.patch
  * 0002-Disable-missed-openssl-cipher-suites.patch
  * 0003-Add-support-for-OpenSSL-1.1.0.patch
- Fix provides in main package
* Thu Oct 19 2017 meissner@suse.com
- buildignore openssl-1_0_0 to avoid conflicts during the
  openssl 1.1 effort.
* Mon Oct  9 2017 vcizek@suse.com
- Hardcode certstore path on Tumbleweed, in order to avoid
  BuildRequires: ca-certificates, which will create a conflict,
  because it requires openssl-1_1_0 (bsc#1055310)
* Sun Oct  1 2017 wbauer@tmo.at
- Update to 2.1.3
  * No changelog provided
- Drop libqca-qt5-2.1.1-explicit-signed-char.patch, merged upstream
- Update Url
* Fri Sep 29 2017 wbauer@tmo.at
- Remove libbotan-devel build requirement, we explicitly disable
  building the botan plugin anyway (boo#1055322)
* Fri Aug 25 2017 fvogt@suse.com
- Force building against openSSL 1.0 (boo#1055310)
- Disable PKCS11 on TW to avoid openssl conflicts
* Wed May 25 2016 antoine.belvire@laposte.net
- Fix build on PowerPC with GCC 6:
  * Add libqca-qt5-2.1.1-explicit-signed-char.patch
* Sat Oct  3 2015 hrvoje.senjan@gmail.com
- Update to 2.1.1
  * No changelog provided
- Drop Use-Q_SLOTS-Q_SIGNALS.patch and 0001-Add-missing-QIODevice-include.patch
* Sat Sep 26 2015 hrvoje.senjan@gmail.com
- Added Use-Q_SLOTS-Q_SIGNALS.patch from upstream: allow building
  without QT_NO_KEYWORDS define
* Sat Jan 10 2015 hrvoje.senjan@gmail.com
- Update to 2.1.0.3
  * Allow co-installability with Qt4 build
- Remove conflict with libqca2-devel
- Bump required cmake version to 2.8.12
- Added ansi.diff, rh#1182200
- Added 0001-Add-missing-QIODevice-include.patch, fixes build with
  Qt 5.5
* Sat Nov  8 2014 hrvoje.senjan@gmail.com
- Update to 2.1.0
  * Ported to Qt5 (Qt4 alsa supported)
  * New building system. CMake instead of qmake
  * Added CTR symetric cipher support to qca core
  * Added no padding encryption algorithm to qca core
  * qcatool2 renamed to qcatool
  * fixed crash in qcatool when only options provided on command
    line without any commands
  * Use plugins installation path as hard-coded runtime plugins
    search path
  * Added new functiion pluginPaths
  * Added functions to get runtime QCA version
  * Fixed 'no watch file' warnings in FileWatch
  * Added EME_PKCS1v15_SSL Encryption Algorithm
  * New implementation of SafeTimer to prevent crashes
  * Updated certificates for unittests
  * RSA Keys are permutable, can encrypt with private
    and decrypt with public
  * Add unloadProvider() function for symmetry
    with insertProvider()
  * Overloaded "makeKey" to derive a password depending
    on a time factor
  * Remove pointer to deinit() routine from QCoreApplication
    at deinitialization
  * Fix a couple of crashes where all plugins
    might not be available
  * Fix operating on keys with unrelated expired subkeys
  * Fixed timers in Synchronizer class
  * Dropped randomunittest
  * Fixed many unittests
  * qca-gnupg: internal refactoring
  * qca-gnupg: try both gpg and gpg2 to find gnupg executable
  * qca-gnupg: fixed some encodings problem
  * qca-ossl: no DSA_* dl groups in FIPS specification
  * qca-ossl: added missed signatures to CRLContext
  * qca-ossl: fixed certs time zone
  * qca-nss: fixed KeyLenght for Cipher
  * qca-botan: fixed getting result size for ciphers
* Thu Aug 14 2014 hrvoje.senjan@gmail.com
- Activate libqca-qt5 package
openSUSE Build Service is sponsored by