]>
Commit | Line | Data |
---|---|---|
6e8c327a JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static library | |
4 | # | |
5 | Summary: Belledonne Communications' language recognition library | |
6 | Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications | |
7 | Name: belr | |
6866f902 | 8 | Version: 5.3.29 |
6e8c327a | 9 | Release: 1 |
7ec9b571 | 10 | License: GPL v3+ |
6e8c327a | 11 | Group: Libraries |
7ec9b571 JB |
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 | |
6866f902 | 14 | # Source0-md5: 8fa28394bab7c78c5821ceb0caac95d8 |
6e8c327a | 15 | URL: https://linphone.org/ |
6866f902 JB |
16 | BuildRequires: bctoolbox-devel >= 5.3.0 |
17 | BuildRequires: cmake >= 3.22 | |
18 | BuildRequires: libstdc++-devel >= 6:7 | |
6e8c327a | 19 | BuildRequires: pkgconfig |
7ec9b571 | 20 | BuildRequires: udev-devel |
6866f902 | 21 | Requires: bctoolbox >= 5.3.0 |
6e8c327a JB |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23 | ||
24 | %description | |
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. | |
28 | ||
29 | It is based on finite state machine theory and heavily relies on | |
30 | recursivity from an implementation standpoint. | |
31 | ||
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. | |
37 | ||
38 | Biblioteka jest oparta na teorii automatów skończonych, implementacja | |
39 | znacząco wykorzystuje rekusywność. | |
40 | ||
41 | %package devel | |
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} | |
6866f902 JB |
46 | Requires: bctoolbox-devel >= 5.3.0 |
47 | Requires: libstdc++-devel >= 6:7 | |
6e8c327a JB |
48 | |
49 | %description devel | |
50 | Header files for belr library. | |
51 | ||
52 | %description devel -l pl.UTF-8 | |
53 | Pliki nagłówkowe biblioteki belr. | |
54 | ||
55 | %package static | |
56 | Summary: Static belr library | |
57 | Summary(pl.UTF-8): Statyczna biblioteka belr | |
58 | Group: Development/Libraries | |
59 | Requires: %{name}-devel = %{version}-%{release} | |
60 | ||
61 | %description static | |
62 | Static belr library. | |
63 | ||
64 | %description static -l pl.UTF-8 | |
65 | Statyczna biblioteka belr. | |
66 | ||
67 | %prep | |
7ec9b571 | 68 | %setup -q |
6e8c327a JB |
69 | |
70 | %build | |
6866f902 JB |
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 | |
76 | ||
77 | %{__make} -C builddir-static | |
78 | %endif | |
79 | ||
56ebee78 | 80 | # cmake build relies on relative CMAKE_INSTALL_DATADIR |
6866f902 | 81 | %cmake -B builddir \ |
56ebee78 | 82 | -DCMAKE_INSTALL_DATADIR=share \ |
6866f902 | 83 | -DENABLE_UNIT_TESTS=OFF |
6e8c327a | 84 | |
6866f902 | 85 | %{__make} -C builddir |
6e8c327a JB |
86 | |
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
6866f902 JB |
90 | %if %{with static_libs} |
91 | %{__make} -C builddir-static install \ | |
92 | DESTDIR=$RPM_BUILD_ROOT | |
93 | %endif | |
94 | ||
56ebee78 | 95 | %{__make} -C builddir install \ |
6e8c327a JB |
96 | DESTDIR=$RPM_BUILD_ROOT |
97 | ||
56ebee78 JB |
98 | # dir for grammars (see CMakeLists.txt) |
99 | install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars | |
100 | ||
7ec9b571 JB |
101 | # missing from cmake |
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 | |
6e8c327a JB |
111 | |
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %post -p /sbin/ldconfig | |
116 | %postun -p /sbin/ldconfig | |
117 | ||
118 | %files | |
119 | %defattr(644,root,root,755) | |
7ec9b571 JB |
120 | %doc CHANGELOG.md README.md |
121 | %attr(755,root,root) %{_bindir}/belr-compiler | |
6e8c327a | 122 | %attr(755,root,root) %{_bindir}/belr-parse |
7ec9b571 | 123 | %attr(755,root,root) %{_libdir}/libbelr.so.1 |
56ebee78 JB |
124 | %dir %{_datadir}/belr |
125 | %dir %{_datadir}/belr/grammars | |
6e8c327a JB |
126 | |
127 | %files devel | |
128 | %defattr(644,root,root,755) | |
129 | %attr(755,root,root) %{_libdir}/libbelr.so | |
130 | %{_includedir}/belr | |
131 | %{_pkgconfigdir}/belr.pc | |
6866f902 | 132 | %{_libdir}/cmake/Belr |
6e8c327a JB |
133 | |
134 | %if %{with static_libs} | |
135 | %files static | |
136 | %defattr(644,root,root,755) | |
137 | %{_libdir}/libbelr.a | |
138 | %endif |