commit 36e8b22a3ff41e3012d1b7f10059eeb3883c9650
Author: Jakub Bogusz <[email protected]>
Date:   Thu Jun 17 06:36:01 2021 +0200

    - build switched to cmake (soname changed)
    - added static patch (fix both shared+static build)
    - removed outdated pc patch

 belcard-pc.patch     | 14 --------------
 belcard-static.patch | 22 ++++++++++++++++++++++
 belcard.spec         | 39 +++++++++++++++++++++++++++++++++------
 3 files changed, 55 insertions(+), 20 deletions(-)
---
diff --git a/belcard.spec b/belcard.spec
index 99410cb..a4c37d8 100644
--- a/belcard.spec
+++ b/belcard.spec
@@ -12,7 +12,7 @@ Group:                Libraries
 #Source0Download: https://gitlab.linphone.org/BC/public/belcard/-/tags
 Source0:       
https://gitlab.linphone.org/BC/public/belcard/-/archive/%{version}/%{name}-%{version}.tar.bz2
 # Source0-md5: 6c0ebca77e42cc8591bc2c895458e3ef
-Patch0:                %{name}-pc.patch
+Patch0:                %{name}-static.patch
 URL:           https://linphone.org/
 BuildRequires: autoconf >= 2.63
 BuildRequires: automake
@@ -64,6 +64,12 @@ Statyczna biblioteka BelCard.
 %patch0 -p1
 
 %build
+install -d build
+cd build
+%cmake ..
+
+%{__make}
+%if 0
 %{__libtoolize}
 %{__aclocal} -I m4
 %{__autoconf}
@@ -73,16 +79,30 @@ Statyczna biblioteka BelCard.
        --disable-silent-rules \
        %{?with_static_libs:--enable-static}
 %{__make}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
+%{__make} -C build install \
        DESTDIR=$RPM_BUILD_ROOT
 
 # obsoleted by pkg-config
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libbelcard.la
-
+#%{__rm} $RPM_BUILD_ROOT%{_libdir}/libbelcard.la
+
+# 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%{_datadir}/belcard/cmake/belcardTargets.cmake
+
+# missing from cmake
+test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/belcard.pc
+install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
+%{__sed} -e 's,@CMAKE_INSTALL_PREFIX@,%{_prefix},' \
+       -e 's,@PROJECT_NAME@,belcard,' \
+       -e 's,@PROJECT_VERSION@,%{version},' \
+       -e 's,@CMAKE_INSTALL_FULL_LIBDIR@,%{_libdir},' \
+       -e 's,@LIBS_PRIVATE@,-lbelr -lbctoolbox,' \
+       -e 's,@CMAKE_INSTALL_FULL_INCLUDEDIR@,%{_includedir},' \
+       belcard.pc.in >$RPM_BUILD_ROOT%{_pkgconfigdir}/belcard.pc
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -95,14 +115,21 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/belcard-folder
 %attr(755,root,root) %{_bindir}/belcard-parser
 %attr(755,root,root) %{_bindir}/belcard-unfolder
-%attr(755,root,root) %{_libdir}/libbelcard.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libbelcard.so.0
+%attr(755,root,root) %{_bindir}/belcard_tester
+%attr(755,root,root) %{_libdir}/libbelcard.so.1
+%{_datadir}/belcard_tester
+# dirs should belong to belr?
+%dir %{_datadir}/belr
+%dir %{_datadir}/belr/grammars
+%{_datadir}/belr/grammars/vcard_grammar
 
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libbelcard.so
 %{_includedir}/belcard
 %{_pkgconfigdir}/belcard.pc
+%dir %{_datadir}/belcard
+%{_datadir}/belcard/cmake
 
 %if %{with static_libs}
 %files static
diff --git a/belcard-pc.patch b/belcard-pc.patch
deleted file mode 100644
index 1398665..0000000
--- a/belcard-pc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- belcard-1.0.2-0/belcard.pc.in.orig 2016-10-19 17:23:37.000000000 +0200
-+++ belcard-1.0.2-0/belcard.pc.in      2019-06-07 21:41:08.214457478 +0200
-@@ -1,9 +1,9 @@
- # This is a comment
- prefix=@CMAKE_INSTALL_PREFIX@
- 
--Name:  @PROJECT_NAME@
-+Name: @PACKAGE_NAME@
- Description: Belcard is Belledonne Communications' vCard 4 parsing library
- Version: @PROJECT_VERSION@
- Libs: -L@CMAKE_INSTALL_FULL_LIBDIR@ -lbelcard
--Libs.private: @LIBS_PRIVATE@
-+Libs.private: @BELR_LIBS@ @BCTOOLBOX_LIBS@
- Cflags: -I@CMAKE_INSTALL_FULL_INCLUDEDIR@
diff --git a/belcard-static.patch b/belcard-static.patch
new file mode 100644
index 0000000..69a9caa
--- /dev/null
+++ b/belcard-static.patch
@@ -0,0 +1,22 @@
+--- belcard-4.5.20/src/CMakeLists.txt.orig     2020-08-21 12:49:06.000000000 
+0200
++++ belcard-4.5.20/src/CMakeLists.txt  2021-06-16 22:35:51.248231597 +0200
+@@ -49,9 +49,16 @@
+ bc_apply_compile_flags(BELCARD_SOURCE_FILES_CXX STRICT_OPTIONS_CPP 
STRICT_OPTIONS_CXX)
+ 
+ if(ENABLE_STATIC)
+-      add_library(belcard STATIC ${BELCARD_HEADER_FILES} 
${BELCARD_SOURCE_FILES_C} ${BELCARD_SOURCE_FILES_CXX})
+-      set_target_properties(belcard PROPERTIES OUTPUT_NAME belcard)
+-      target_link_libraries(belcard PRIVATE belr bctoolbox)
++      add_library(belcard-static STATIC ${BELCARD_HEADER_FILES} 
${BELCARD_SOURCE_FILES_C} ${BELCARD_SOURCE_FILES_CXX})
++      set_target_properties(belcard-static PROPERTIES OUTPUT_NAME belcard)
++      target_link_libraries(belcard-static PRIVATE belr bctoolbox)
++install(TARGETS belcard-static EXPORT ${EXPORT_TARGETS_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(belcard SHARED ${BELCARD_HEADER_FILES} 
${BELCARD_SOURCE_FILES_C} ${BELCARD_SOURCE_FILES_CXX} ${VCARD_GRAMMAR_FILES})
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/belcard.git/commitdiff/36e8b22a3ff41e3012d1b7f10059eeb3883c9650

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to