From 56ebee781db40468018d78f4f149b5502b40f301 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 17 Jun 2021 20:20:25 +0200 Subject: [PATCH 1/3] - updated to 4.5.20 - pass relative CMAKE_INSTALL_DATADIR as expected by code/cmake build - package grammars dir - use build dir separate from "build" directory included in sources --- belr.spec | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/belr.spec b/belr.spec index e67b5f7..42dafde 100644 --- a/belr.spec +++ b/belr.spec @@ -5,13 +5,13 @@ Summary: Belledonne Communications' language recognition library Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications Name: belr -Version: 4.5.15 +Version: 4.5.20 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 +# Source0-md5: 5779ada843c4c396250fded9a2520c12 Patch0: %{name}-static.patch URL: https://linphone.org/ BuildRequires: bctoolbox-devel >= 0.0.5 @@ -70,9 +70,11 @@ Statyczna biblioteka belr. %patch0 -p1 %build -install -d build -cd build +install -d builddir +cd builddir +# cmake build relies on relative CMAKE_INSTALL_DATADIR %cmake .. \ + -DCMAKE_INSTALL_DATADIR=share \ %{!?with_static_libs:-DENABLE_STATIC=OFF} \ -DENABLE_TESTS=OFF @@ -81,9 +83,12 @@ cd build %install rm -rf $RPM_BUILD_ROOT -%{__make} -C build install \ +%{__make} -C builddir install \ DESTDIR=$RPM_BUILD_ROOT +# dir for grammars (see CMakeLists.txt) +install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars + # 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 @@ -110,6 +115,8 @@ rm -rf $RPM_BUILD_ROOT %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) -- 2.43.0 From 34cff9eb49feeefd12feabe69bd264d1ce6d0a5b Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 15 Apr 2023 22:11:55 +0200 Subject: [PATCH 2/3] - updated to 5.2.51 --- belr.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/belr.spec b/belr.spec index 42dafde..09f3a3a 100644 --- a/belr.spec +++ b/belr.spec @@ -5,13 +5,13 @@ Summary: Belledonne Communications' language recognition library Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications Name: belr -Version: 4.5.20 +Version: 5.2.51 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: 5779ada843c4c396250fded9a2520c12 +# Source0-md5: 053d6cd98345c7a6c80ca4c67f71883e Patch0: %{name}-static.patch URL: https://linphone.org/ BuildRequires: bctoolbox-devel >= 0.0.5 -- 2.43.0 From 6866f902e179376303bb290fcba56d3f37b3ffc9 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 10 Mar 2024 09:33:23 +0100 Subject: [PATCH 3/3] - updated to 5.3.29 --- belr-static.patch | 27 --------------------------- belr.spec | 46 ++++++++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 47 deletions(-) delete mode 100644 belr-static.patch diff --git a/belr-static.patch b/belr-static.patch deleted file mode 100644 index 178ba70..0000000 --- a/belr-static.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- belr-4.5.15/src/CMakeLists.txt.orig 2020-10-22 16:31:51.000000000 +0200 -+++ belr-4.5.15/src/CMakeLists.txt 2021-06-15 21:41:34.307278254 +0200 -@@ -44,13 +44,20 @@ - endif() - - if(ENABLE_STATIC) -- add_library(belr STATIC ${BELR_HEADER_FILES} ${BELR_SOURCE_FILES_C} ${BELR_SOURCE_FILES_CXX}) -- set_target_properties(belr PROPERTIES OUTPUT_NAME belr) -- target_link_libraries(belr PUBLIC ${LIBS}) -- target_include_directories(belr INTERFACE -+ add_library(belr-static STATIC ${BELR_HEADER_FILES} ${BELR_SOURCE_FILES_C} ${BELR_SOURCE_FILES_CXX}) -+ set_target_properties(belr-static PROPERTIES OUTPUT_NAME belr) -+ target_link_libraries(belr-static PUBLIC ${LIBS}) -+ target_include_directories(belr-static INTERFACE - $ - $ - ) -+install(TARGETS belr-static EXPORT ${EXPORT_TARGET_NAME}Targets -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ FRAMEWORK DESTINATION Frameworks -+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE -+) - endif() - if(ENABLE_SHARED) - add_library(belr SHARED ${BELR_HEADER_FILES} ${BELR_SOURCE_FILES_C} ${BELR_SOURCE_FILES_CXX}) diff --git a/belr.spec b/belr.spec index 09f3a3a..f6d56a3 100644 --- a/belr.spec +++ b/belr.spec @@ -5,21 +5,20 @@ Summary: Belledonne Communications' language recognition library Summary(pl.UTF-8): Biblioteka rozpoznawania języków Belledonne Communications Name: belr -Version: 5.2.51 +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: 053d6cd98345c7a6c80ca4c67f71883e -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 @@ -44,8 +43,8 @@ Summary: Header files for belr library 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. @@ -67,31 +66,38 @@ Statyczna biblioteka belr. %prep %setup -q -%patch0 -p1 %build -install -d builddir -cd builddir +%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 .. \ +%cmake -B builddir \ -DCMAKE_INSTALL_DATADIR=share \ - %{!?with_static_libs:-DENABLE_STATIC=OFF} \ - -DENABLE_TESTS=OFF + -DENABLE_UNIT_TESTS=OFF -%{__make} +%{__make} -C builddir %install rm -rf $RPM_BUILD_ROOT +%if %{with static_libs} +%{__make} -C builddir-static install \ + DESTDIR=$RPM_BUILD_ROOT +%endif + %{__make} -C builddir install \ DESTDIR=$RPM_BUILD_ROOT # dir for grammars (see CMakeLists.txt) install -d $RPM_BUILD_ROOT%{_datadir}/belr/grammars -# 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 - # missing from cmake test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belr.pc install -d $RPM_BUILD_ROOT%{_pkgconfigdir} @@ -123,7 +129,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_libdir}/libbelr.so %{_includedir}/belr %{_pkgconfigdir}/belr.pc -%{_libdir}/cmake/belr +%{_libdir}/cmake/Belr %if %{with static_libs} %files static -- 2.43.0