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: 8fa28394bab7c78c5821ceb0caac95d8
15 URL: https://linphone.org/
16 BuildRequires: bctoolbox-devel >= 5.3.0
17 BuildRequires: cmake >= 3.22
18 BuildRequires: libstdc++-devel >= 6:7
19 BuildRequires: pkgconfig
20 BuildRequires: udev-devel
21 Requires: bctoolbox >= 5.3.0
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 Belr is Belledonne Communications' language recognition library. It
26 aims at parsing any input formatted according to a language defined by
27 an ABNF grammar, such as the protocols standardized at IETF.
29 It is based on finite state machine theory and heavily relies on
30 recursivity from an implementation standpoint.
32 %description -l pl.UTF-8
33 Belr to biblioteka do rozpoznawania języków Belledonne Communications.
34 Jej celem jest analiza dowolnego wejścia sformatowanego zgodnie z
35 językiem zdefiniowanym przez gramatykę ABNF, np. protokołów
36 standaryzowanych przez IETF.
38 Biblioteka jest oparta na teorii automatów skończonych, implementacja
39 znacząco wykorzystuje rekusywność.
42 Summary: Header files for belr library
43 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki belr
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
46 Requires: bctoolbox-devel >= 5.3.0
47 Requires: libstdc++-devel >= 6:7
50 Header files for belr library.
52 %description devel -l pl.UTF-8
53 Pliki nagłówkowe biblioteki belr.
56 Summary: Static belr library
57 Summary(pl.UTF-8): Statyczna biblioteka belr
58 Group: Development/Libraries
59 Requires: %{name}-devel = %{version}-%{release}
64 %description static -l pl.UTF-8
65 Statyczna biblioteka belr.
71 %if %{with static_libs}
72 %cmake -B builddir-static \
73 -DBUILD_SHARED_LIBS=OFF \
74 -DCMAKE_INSTALL_DATADIR=share \
75 -DENABLE_UNIT_TESTS=OFF
77 %{__make} -C builddir-static
80 # cmake build relies on relative CMAKE_INSTALL_DATADIR
82 -DCMAKE_INSTALL_DATADIR=share \
83 -DENABLE_UNIT_TESTS=OFF
88 rm -rf $RPM_BUILD_ROOT
90 %if %{with static_libs}
91 %{__make} -C builddir-static install \
92 DESTDIR=$RPM_BUILD_ROOT
95 %{__make} -C builddir install \
96 DESTDIR=$RPM_BUILD_ROOT
98 # dir for grammars (see CMakeLists.txt)
99 install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars
102 test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc
103 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
104 %{__sed} -e 's,@CMAKE_INSTALL_PREFIX@,%{_prefix},' \
105 -e 's,@PROJECT_NAME@,belr,' \
106 -e 's,@PROJECT_VERSION@,%{version},' \
107 -e 's,@CMAKE_INSTALL_FULL_LIBDIR@,%{_libdir},' \
108 -e 's,@LIBS_PRIVATE@,-lbctoolbox,' \
109 -e 's,@CMAKE_INSTALL_FULL_INCLUDEDIR@,%{_includedir},' \
110 belr.pc.in >$RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc
113 rm -rf $RPM_BUILD_ROOT
115 %post -p /sbin/ldconfig
116 %postun -p /sbin/ldconfig
119 %defattr(644,root,root,755)
120 %doc CHANGELOG.md README.md
121 %attr(755,root,root) %{_bindir}/belr-compiler
122 %attr(755,root,root) %{_bindir}/belr-parse
123 %attr(755,root,root) %{_libdir}/libbelr.so.1
124 %dir %{_datadir}/belr
125 %dir %{_datadir}/belr/grammars
128 %defattr(644,root,root,755)
129 %attr(755,root,root) %{_libdir}/libbelr.so
131 %{_pkgconfigdir}/belr.pc
132 %{_libdir}/cmake/Belr
134 %if %{with static_libs}
136 %defattr(644,root,root,755)