- updated to 4.5.20
[packages/belr.git] / belr.spec
CommitLineData
6e8c327a
JB
1#
2# Conditional build:
3%bcond_without static_libs # static library
4#
5Summary: Belledonne Communications' language recognition library
6Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications
7Name: belr
56ebee78 8Version: 4.5.20
6e8c327a 9Release: 1
7ec9b571 10License: GPL v3+
6e8c327a 11Group: Libraries
7ec9b571
JB
12#Source0Download: https://gitlab.linphone.org/BC/public/belr/-/tags
13Source0: https://gitlab.linphone.org/BC/public/belr/-/archive/%{version}/%{name}-%{version}.tar.bz2
56ebee78 14# Source0-md5: 5779ada843c4c396250fded9a2520c12
7ec9b571 15Patch0: %{name}-static.patch
6e8c327a 16URL: https://linphone.org/
7ec9b571
JB
17BuildRequires: bctoolbox-devel >= 0.0.5
18BuildRequires: cmake >= 3.1
6e8c327a 19BuildRequires: libstdc++-devel >= 6:4.7
6e8c327a 20BuildRequires: pkgconfig
7ec9b571
JB
21BuildRequires: udev-devel
22Requires: bctoolbox >= 0.0.5
6e8c327a
JB
23BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25%description
26Belr is Belledonne Communications' language recognition library. It
27aims at parsing any input formatted according to a language defined by
28an ABNF grammar, such as the protocols standardized at IETF.
29
30It is based on finite state machine theory and heavily relies on
31recursivity from an implementation standpoint.
32
33%description -l pl.UTF-8
34Belr to biblioteka do rozpoznawania języków Belledonne Communications.
35Jej celem jest analiza dowolnego wejścia sformatowanego zgodnie z
36językiem zdefiniowanym przez gramatykę ABNF, np. protokołów
37standaryzowanych przez IETF.
38
39Biblioteka jest oparta na teorii automatów skończonych, implementacja
40znacząco wykorzystuje rekusywność.
41
42%package devel
43Summary: Header files for belr library
44Summary(pl.UTF-8): Pliki nagłówkowe biblioteki belr
45Group: Development/Libraries
46Requires: %{name} = %{version}-%{release}
7ec9b571 47Requires: bctoolbox-devel >= 0.0.5
6e8c327a
JB
48Requires: libstdc++-devel >= 6:4.7
49
50%description devel
51Header files for belr library.
52
53%description devel -l pl.UTF-8
54Pliki nagłówkowe biblioteki belr.
55
56%package static
57Summary: Static belr library
58Summary(pl.UTF-8): Statyczna biblioteka belr
59Group: Development/Libraries
60Requires: %{name}-devel = %{version}-%{release}
61
62%description static
63Static belr library.
64
65%description static -l pl.UTF-8
66Statyczna biblioteka belr.
67
68%prep
7ec9b571 69%setup -q
6e8c327a
JB
70%patch0 -p1
71
72%build
56ebee78
JB
73install -d builddir
74cd builddir
75# cmake build relies on relative CMAKE_INSTALL_DATADIR
7ec9b571 76%cmake .. \
56ebee78 77 -DCMAKE_INSTALL_DATADIR=share \
7ec9b571
JB
78 %{!?with_static_libs:-DENABLE_STATIC=OFF} \
79 -DENABLE_TESTS=OFF
6e8c327a
JB
80
81%{__make}
82
83%install
84rm -rf $RPM_BUILD_ROOT
85
56ebee78 86%{__make} -C builddir install \
6e8c327a
JB
87 DESTDIR=$RPM_BUILD_ROOT
88
56ebee78
JB
89# dir for grammars (see CMakeLists.txt)
90install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars
91
7ec9b571
JB
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
94
95# missing from cmake
96test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc
97install -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
6e8c327a
JB
105
106%clean
107rm -rf $RPM_BUILD_ROOT
108
109%post -p /sbin/ldconfig
110%postun -p /sbin/ldconfig
111
112%files
113%defattr(644,root,root,755)
7ec9b571
JB
114%doc CHANGELOG.md README.md
115%attr(755,root,root) %{_bindir}/belr-compiler
6e8c327a 116%attr(755,root,root) %{_bindir}/belr-parse
7ec9b571 117%attr(755,root,root) %{_libdir}/libbelr.so.1
56ebee78
JB
118%dir %{_datadir}/belr
119%dir %{_datadir}/belr/grammars
6e8c327a
JB
120
121%files devel
122%defattr(644,root,root,755)
123%attr(755,root,root) %{_libdir}/libbelr.so
124%{_includedir}/belr
125%{_pkgconfigdir}/belr.pc
7ec9b571 126%{_libdir}/cmake/belr
6e8c327a
JB
127
128%if %{with static_libs}
129%files static
130%defattr(644,root,root,755)
131%{_libdir}/libbelr.a
132%endif
This page took 0.134256 seconds and 4 git commands to generate.