3 %bcond_without static_libs # static library
5 Summary: Belledonne Communications' language recognition library
6 Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications
12 #Source0Download: https://gitlab.linphone.org/BC/public/belr/-/tags
13 Source0: https://gitlab.linphone.org/BC/public/belr/-/archive/%{version}/%{name}-%{version}.tar.bz2
14 # Source0-md5: 5779ada843c4c396250fded9a2520c12
15 Patch0: %{name}-static.patch
16 URL: https://linphone.org/
17 BuildRequires: bctoolbox-devel >= 0.0.5
18 BuildRequires: cmake >= 3.1
19 BuildRequires: libstdc++-devel >= 6:4.7
20 BuildRequires: pkgconfig
21 BuildRequires: udev-devel
22 Requires: bctoolbox >= 0.0.5
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 Belr is Belledonne Communications' language recognition library. It
27 aims at parsing any input formatted according to a language defined by
28 an ABNF grammar, such as the protocols standardized at IETF.
30 It is based on finite state machine theory and heavily relies on
31 recursivity from an implementation standpoint.
33 %description -l pl.UTF-8
34 Belr to biblioteka do rozpoznawania języków Belledonne Communications.
35 Jej celem jest analiza dowolnego wejścia sformatowanego zgodnie z
36 językiem zdefiniowanym przez gramatykę ABNF, np. protokołów
37 standaryzowanych przez IETF.
39 Biblioteka jest oparta na teorii automatów skończonych, implementacja
40 znacząco wykorzystuje rekusywność.
43 Summary: Header files for belr library
44 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki belr
45 Group: Development/Libraries
46 Requires: %{name} = %{version}-%{release}
47 Requires: bctoolbox-devel >= 0.0.5
48 Requires: libstdc++-devel >= 6:4.7
51 Header files for belr library.
53 %description devel -l pl.UTF-8
54 Pliki nagłówkowe biblioteki belr.
57 Summary: Static belr library
58 Summary(pl.UTF-8): Statyczna biblioteka belr
59 Group: Development/Libraries
60 Requires: %{name}-devel = %{version}-%{release}
65 %description static -l pl.UTF-8
66 Statyczna biblioteka belr.
75 # cmake build relies on relative CMAKE_INSTALL_DATADIR
77 -DCMAKE_INSTALL_DATADIR=share \
78 %{!?with_static_libs:-DENABLE_STATIC=OFF} \
84 rm -rf $RPM_BUILD_ROOT
86 %{__make} -C builddir install \
87 DESTDIR=$RPM_BUILD_ROOT
89 # dir for grammars (see CMakeLists.txt)
90 install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars
92 # disable completeness check incompatible with split packaging
93 %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_libdir}/cmake/belr/belrTargets.cmake
96 test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc
97 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
98 %{__sed} -e 's,@CMAKE_INSTALL_PREFIX@,%{_prefix},' \
99 -e 's,@PROJECT_NAME@,belr,' \
100 -e 's,@PROJECT_VERSION@,%{version},' \
101 -e 's,@CMAKE_INSTALL_FULL_LIBDIR@,%{_libdir},' \
102 -e 's,@LIBS_PRIVATE@,-lbctoolbox,' \
103 -e 's,@CMAKE_INSTALL_FULL_INCLUDEDIR@,%{_includedir},' \
104 belr.pc.in >$RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc
107 rm -rf $RPM_BUILD_ROOT
109 %post -p /sbin/ldconfig
110 %postun -p /sbin/ldconfig
113 %defattr(644,root,root,755)
114 %doc CHANGELOG.md README.md
115 %attr(755,root,root) %{_bindir}/belr-compiler
116 %attr(755,root,root) %{_bindir}/belr-parse
117 %attr(755,root,root) %{_libdir}/libbelr.so.1
118 %dir %{_datadir}/belr
119 %dir %{_datadir}/belr/grammars
122 %defattr(644,root,root,755)
123 %attr(755,root,root) %{_libdir}/libbelr.so
125 %{_pkgconfigdir}/belr.pc
126 %{_libdir}/cmake/belr
128 %if %{with static_libs}
130 %defattr(644,root,root,755)