File lime.spec of Package lime

%define _cmakename Lime
%define soname  liblime
%define sover   0
%define enable_tests 0
Name:           lime
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:        Instant Message End-to-End Encryption Library
License:        GPL-3.0-or-later
Group:          Productivity/Networking/Instant Messenger
URL:            https://linphone.org/technical-corner/lime/
Source:         https://gitlab.linphone.org/BC/public/lime/-/archive/%{version}/%{name}-%{version}.tar.bz2
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  soci-devel
BuildRequires:  soci-sqlite3-devel
%if 0%{?fedora}
BuildRequires:  boost-devel
%endif
BuildRequires:  chrpath
BuildRequires:  pkgconfig
BuildRequires:  bctoolbox-devel >= 5.3.5
BuildRequires:  pkgconfig(bctoolbox) >= 5.3.0
BuildRequires:  belle-sip-devel >= 5.3.5
BuildRequires:  pkgconfig(belle-sip) >= 5.3.0
#BuildRequires:  libbelr1
BuildRequires:  belr-devel >= 5.3.5
#BuildRequires:  pkgconfig(belr) >= 5.3.0

%description
LIME is an encryption library for one-to-one and group instant
messaging, allowing users to exchange messages privately and
asynchronously. It supports multiple devices per user and multiple
users per device.

LIME offers two major security benefits to instant messaging users:
  * End-to-end encryption, which means that only you and your
    contact (and not even the server) can decrypt the content that
    you shared.
  * Perfect forward secrecy, which ensures that encrypted messages
    cannot be decrypted by a third party, even if a key is
    compromised in the future.

%package -n %{soname}%{sover}
Summary:        Instant Message End-to-End Encryption Library
Group:          Productivity/Networking/Instant Messenger

%description -n %{soname}%{sover}
LIME is an encryption library for one-to-one and group instant
messaging, allowing users to exchange messages privately and
asynchronously. It supports multiple devices per user and multiple
users per device.

LIME offers two major security benefits to instant messaging users:
  * End-to-end encryption, which means that only you and your
    contact (and not even the server) can decrypt the content that
    you shared.
  * Perfect forward secrecy, which ensures that encrypted messages
    cannot be decrypted by a third party, even if a key is
    compromised in the future.

%package devel
Summary:        Development files for lime
Group:          Development/Languages/C and C++
Requires:       %{soname}%{sover} = %{version}
Requires:       soci-devel
Requires:       soci-sqlite3-devel

%description devel
LIME is an encryption library for one-to-one and group instant
messaging, allowing users to exchange messages privately and
asynchronously. It supports multiple devices per user and multiple
users per device.

The soci development package includes the header files, libraries,
development tools necessary for compiling and linking applications
which will use lime.

%prep
%setup -q

%build
%cmake \
%if %{enable_tests} == 0
  -DENABLE_UNIT_TESTS=OFF \
%endif
  -DENABLE_STRICT=OFF     \
  -DENABLE_STATIC=OFF     \
%if 0%{?fedora}
  -DCMAKE_INSTALL_LIBDIR=lib64 \
%endif
  -DENABLE_C_INTERFACE=ON
%cmake_build

%install
%cmake_install
%if %{enable_tests}
chmod -x %{buildroot}%{_datadir}/%{name}_tester/data/*.pem
%endif

%if %{enable_tests}
chrpath -d %{buildroot}%{_bindir}/%{name}*
%endif
chrpath -d %{buildroot}%{_libdir}/%{soname}.so.%{sover}*

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

%files -n %{soname}%{sover}
%license LICENSE.txt
%{_libdir}/%{soname}.so.%{sover}*

%files devel
%license LICENSE.txt
%doc AUTHORS.md CHANGELOG.md README.md
%{_includedir}/%{name}/
%{_libdir}/%{soname}.so
%{_datadir}/%{_cmakename}/
%if %{enable_tests}
%{_bindir}/%{name}*
%{_datadir}/%{name}_tester/
%endif

%changelog
openSUSE Build Service is sponsored by