Summary: Belledonne Communications' language recognition library
Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications
Name: belr
-Version: 4.5.15
+Version: 5.3.29
Release: 1
License: GPL v3+
Group: Libraries
#Source0Download: https://gitlab.linphone.org/BC/public/belr/-/tags
Source0: https://gitlab.linphone.org/BC/public/belr/-/archive/%{version}/%{name}-%{version}.tar.bz2
-# Source0-md5: 2535ccc46f621226d3bc44d7e2dd7f02
-Patch0: %{name}-static.patch
+# Source0-md5: 8fa28394bab7c78c5821ceb0caac95d8
URL: https://linphone.org/
-BuildRequires: bctoolbox-devel >= 0.0.5
-BuildRequires: cmake >= 3.1
-BuildRequires: libstdc++-devel >= 6:4.7
+BuildRequires: bctoolbox-devel >= 5.3.0
+BuildRequires: cmake >= 3.22
+BuildRequires: libstdc++-devel >= 6:7
BuildRequires: pkgconfig
BuildRequires: udev-devel
-Requires: bctoolbox >= 0.0.5
+Requires: bctoolbox >= 5.3.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary(pl.UTF-8): Pliki nagłówkowe biblioteki belr
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: bctoolbox-devel >= 0.0.5
-Requires: libstdc++-devel >= 6:4.7
+Requires: bctoolbox-devel >= 5.3.0
+Requires: libstdc++-devel >= 6:7
%description devel
Header files for belr library.
%prep
%setup -q
-%patch0 -p1
%build
-install -d build
-cd build
-%cmake .. \
- %{!?with_static_libs:-DENABLE_STATIC=OFF} \
- -DENABLE_TESTS=OFF
+%if %{with static_libs}
+%cmake -B builddir-static \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DCMAKE_INSTALL_DATADIR=share \
+ -DENABLE_UNIT_TESTS=OFF
+
+%{__make} -C builddir-static
+%endif
+
+# cmake build relies on relative CMAKE_INSTALL_DATADIR
+%cmake -B builddir \
+ -DCMAKE_INSTALL_DATADIR=share \
+ -DENABLE_UNIT_TESTS=OFF
-%{__make}
+%{__make} -C builddir
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} -C build install \
+%if %{with static_libs}
+%{__make} -C builddir-static install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%{__make} -C builddir install \
DESTDIR=$RPM_BUILD_ROOT
-# disable completeness check incompatible with split packaging
-%{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_libdir}/cmake/belr/belrTargets.cmake
+# dir for grammars (see CMakeLists.txt)
+install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars
# missing from cmake
test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc
%attr(755,root,root) %{_bindir}/belr-compiler
%attr(755,root,root) %{_bindir}/belr-parse
%attr(755,root,root) %{_libdir}/libbelr.so.1
+%dir %{_datadir}/belr
+%dir %{_datadir}/belr/grammars
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libbelr.so
%{_includedir}/belr
%{_pkgconfigdir}/belr.pc
-%{_libdir}/cmake/belr
+%{_libdir}/cmake/Belr
%if %{with static_libs}
%files static