File bzrtp.spec of Package bzrtp

%define _cmakename BZRTP
%define sover   0
%define enable_tests 0
%define enable_postquantumcrypto 1
Name:           bzrtp
Version:        5.3.5
# Fedora release look standard from OpenSUSE build service:
# Release:      <CI_CNT>.<B_CNT>
# Release:      %%{?release_prefix}.<CI_CNT>.<B_CNT>
# where rpm macro %%{release_prefix} is defined in spec file
# Normally it looks like:
# Release:      63.fc38 for Fedora packages which is scripted as:
# Release:      0%%{?dist}
# OpenSUSE build service allows for this variant:
# Release:      63.1.fc38
# Release:       <CI_CNT>.<B_CNT>%%{?dist}
#
# Add this to Project Config to tag Fedora packages with fcXX:
# ------------------------------
# # reset release name
# onepercentage%%if 0onepercentage%%{?fedora_version}
# Release: <CI_CNT>.<B_CNT> spec:<CI_CNT>.<B_CNT>twopercentage%%{?dist}
# onepercentage%%endif
# ------------------------------
Release:        0
Summary:        ZRTP keys exchange protocol implementation
License:        GPL-3.0-or-later
Group:          Productivity/Telephony/Utilities
URL:            https://linphone.org/
Source:         https://gitlab.linphone.org/BC/public/bzrtp/-/archive/%{version}/%{name}-%{version}.tar.bz2
Source1:        baselibs.conf
# PATCH-FIX-OPENSUSE bzrtp-fix-pkgconfig.patch sor.alexei@meowr.ru -- Install libbzrtp.pc.
# Patch0:         bzrtp-0001-fix-pkgconfig.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  bctoolbox-devel >= 5.3.5
BuildRequires:  pkgconfig(bctoolbox) >= 5.3.0
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(sqlite3)
#%%if 0%%{?suse_version}
%if %{enable_postquantumcrypto}
BuildRequires:  libpostquantumcryptoengine-devel >= 5.2.94
%endif
BuildRequires:  liboqs-devel => 0.7.1
#%%endif

%description
bzrtp is an implementation of the ZRTP key exchange protocol.
The library written in C89.

%package -n lib%{name}%{sover}
Summary:        ZRTP key exchange protocol implementation
Group:          Productivity/Telephony/Utilities

%description -n lib%{name}%{sover}
bzrtp is an implementation of the ZRTP key exchange protocol.
The library written in C89.

%package devel
Summary:        Development files for libbzrtp
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{sover} = %{version}
#%%if 0%%{?suse_version}
Requires:  libpostquantumcryptoengine-devel >= 5.2.94
Requires:  liboqs-devel => 0.7.1
#%%endif

%description devel
The libbzrtp development package includes the header files,
libraries, development tools necessary for compiling and linking
application which will use libbzrtp.

%prep
%autosetup -p1

%build
# %if 0%{?suse_version}
%cmake \
%if %{enable_tests} == 0
  -DENABLE_UNIT_TESTS=OFF \
%endif
%if %{enable_postquantumcrypto}
  -DENABLE_PQCRYPTO=YES \
%endif
  -DENABLE_STATIC=OFF
#%else
#%cmake \
#  -DENABLE_STATIC=OFF
#%endif
%cmake_build

%install
%cmake_install

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

%files -n lib%{name}%{sover}
%{_libdir}/lib%{name}.so.%{sover}*

%files devel
%license LICENSE.txt
%doc README.md
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_datadir}/%{_cmakename}/
#%{_libdir}/pkgconfig/lib%{name}.pc

%changelog
openSUSE Build Service is sponsored by