File belcard.spec of Package belcard

%define soname  libbelcard
%define sover   1
%define enable_tests 0
Name:           belcard
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:        C++ library to manipulate vCard standard format files
License:        GPL-3.0-or-later
Group:          Development/Languages/C and C++
URL:            https://linphone.org/
Source:         https://gitlab.linphone.org/BC/public/belcard/-/archive/%{version}/%{name}-%{version}.tar.bz2
Source1:        baselibs.conf
# PATCH-FIX-OPENSUSE belcard-fix-pkgconfig.patch sor.alexei@meowr.ru -- Install belcard.pc.
# Patch0:         belcard-fix-pkgconfig.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libudev-devel
BuildRequires:  pkgconfig
BuildRequires:  bctoolbox-devel >= 5.3.5
BuildRequires:  pkgconfig(bctoolbox) >= 5.3.0
BuildRequires:  belr-devel >= 5.3.5
#BuildRequires:  pkgconfig(belr) >= 5.3.0

%description
Belcard is a C++ library to manipulate the vCard standard format files.

%package -n %{soname}%{sover}
Summary:        C++ library to manipulate vCard standard format files
Group:          Development/Languages/C and C++
Requires:       %{name}-data >= %{version}

%description -n %{soname}%{sover}
Belcard is a C++ library to manipulate the vCard standard format files.

%package data
Summary:        Belcard data files
Group:          Development/Languages/C and C++
Requires:       %{soname}%{sover} = %{version}
BuildArch:      noarch

%description data
Belcard is a C++ library to manipulate the vCard standard format files.

This package contains data files such as belr grammar.

%package devel
Summary:        Headers and libraries for the belcard library
Group:          Development/Languages/C and C++
Requires:       %{soname}%{sover} = %{version}

%description devel
Belcard is a C++ library to manipulate the vCard standard format files.

This package contains header files and development libraries needed
to develop applications using the belcard library.

%prep
%autosetup -p1

%build
%cmake \
%if %{enable_tests} == 0
  -DENABLE_TOOLS=OFF \
  -DENABLE_UNIT_TESTS=OFF \
%endif
  -DENABLE_STRICT=OFF \
  -DENABLE_STATIC=OFF
%cmake_build

%install
%cmake_install

%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 data
%dir %{_datadir}/belr/
%{_datadir}/belr/grammars/

%files devel
%license LICENSE.txt
%doc CHANGELOG.md README.md
%{_includedir}/%{name}/
%{_libdir}/%{soname}.so
#%%{_datadir}/%%{name}/
%{_datadir}/BelCard/
%if %{enable_tests}
%{_bindir}/%{name}*
%{_datadir}/%{name}-tester/
%endif
#%{_libdir}/pkgconfig/%{name}.pc

%changelog
openSUSE Build Service is sponsored by