File libQuotientQt6.spec of Package libQuotientQt6

#
# spec file for package libQuotientQt6
#
# Copyright (c) 2022 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/
#


%define soversion 0_9

Name:           libQuotientQt6
Version:        0.9.5
Release:        0
Summary:        Library for Qt Matrix Clients
License:        LGPL-2.1-only
Group:          Development/Libraries/C and C++
URL:            https://github.com/quotient-im/libQuotient
Source0:        https://github.com/quotient-im/libQuotient/archive/%{version}/libQuotient-%{version}.tar.gz
BuildRequires:  cmake >= 3.26.0
%if 0%{?suse_version} < 1600
BuildRequires:  gcc13-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  pkgconfig
BuildRequires:  qt6-core-private-devel
BuildRequires:  cmake(Olm) >= 3.2.5
BuildRequires:  cmake(Qt6Keychain) >= 0.12
BuildRequires:  pkgconfig(Qt6Concurrent)
BuildRequires:  pkgconfig(Qt6Core) >= 6.4
BuildRequires:  pkgconfig(Qt6DBus)
BuildRequires:  pkgconfig(Qt6Gui)
BuildRequires:  pkgconfig(Qt6Multimedia)
BuildRequires:  pkgconfig(Qt6Network)
BuildRequires:  pkgconfig(Qt6Sql)
BuildRequires:  pkgconfig(Qt6Test)
BuildRequires:  pkgconfig(openssl)
Obsoletes:      libQuotient%{soversion} < %{version}
Provides:       libQuotient%{soversion} = %{version}

%description
Library for Qt-based Matrix chat clients. It is required by
Quaternion.

%package -n %{name}-%{soversion}
Summary:        Library for Qt Matrix Clients
Group:          System/Libraries

%description -n %{name}-%{soversion}
Library for Qt-based Matrix chat clients. It is required by
Quaternion.

%package devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name}-%{soversion} = %{version}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q -n libQuotient-%{version}

%build
export LDFLAGS="-pie"
export CFLAGS="%{optflags} -fPIE -pie"
export CXXFLAGS="%{optflags} -fPIE -pie"
%if 0%{?suse_version} < 1600
export CC=gcc-13
export CXX=g++-13
%endif
%cmake \
   -DBUILD_SHARED_LIBS=ON \
   -DBUILD_WITH_QT6=ON \
   -DUSE_INTREE_LIBQOLM=OFF \
   -DQuotient_ENABLE_E2EE=ON
%cmake_build

%install
%cmake_install

%post  -n %{name}-%{soversion} -p /sbin/ldconfig
%postun -n %{name}-%{soversion} -p /sbin/ldconfig

%files -n %{name}-%{soversion}
%doc README.md
%license COPYING
%{_libdir}/libQuotientQt6.so.*

%files devel
%doc README.md
%license COPYING
%dir %{_datadir}/ndk-modules
%{_bindir}/quotest
%{_libdir}/pkgconfig/QuotientQt6.pc
%{_libdir}/libQuotientQt6.so
%{_libdir}/cmake/QuotientQt6/
%{_includedir}/Quotient
%{_datadir}/ndk-modules/Android.mk

%changelog
openSUSE Build Service is sponsored by