- patched to fix static+shared library build and duplicate symbols in file helpers
--- /dev/null
+--- bcmatroska2-5.2.1/corec/corec/CMakeLists.txt.orig 2022-11-29 11:25:07.000000000 +0100
++++ bcmatroska2-5.2.1/corec/corec/CMakeLists.txt 2023-04-09 20:33:31.565041475 +0200
+@@ -52,7 +52,6 @@ if(WIN32)
+ else()
+ list(APPEND COREC_SOURCES
+ helpers/date/date_libc.c
+- helpers/file/file_libc.c
+ helpers/file/file_bctbx.c
+ multithread/multithread_pthread.c
+ )
+--- bcmatroska2-5.2.1/libmatroska2/CMakeLists.txt.orig 2023-04-09 20:33:59.088225702 +0200
++++ bcmatroska2-5.2.1/libmatroska2/CMakeLists.txt 2023-04-09 20:39:07.949885788 +0200
+@@ -56,6 +56,7 @@ if(ENABLE_SHARED)
+ set_target_properties(bcmatroska2 PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
+ endif()
+ target_include_directories(bcmatroska2 PRIVATE ../libebml2 .)
++ target_link_libraries(bcmatroska2 bctoolbox)
+ if(LIBS)
+ target_link_libraries(bcmatroska2 ${LIBS})
+ endif()
--- /dev/null
+--- bcmatroska2-5.2.1/libmatroska2/CMakeLists.txt.orig 2022-11-29 11:25:07.000000000 +0100
++++ bcmatroska2-5.2.1/libmatroska2/CMakeLists.txt 2023-04-09 20:19:33.979579064 +0200
+@@ -33,17 +33,17 @@ endif()
+
+ string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
+ if(ENABLE_STATIC)
+- add_library(bcmatroska2 STATIC $<TARGET_OBJECTS:corec-objects> $<TARGET_OBJECTS:ebml2-objects> ${MATROSKA2_SOURCE_FILES})
+- set_target_properties(bcmatroska2 PROPERTIES OUTPUT_NAME bcmatroska2)
+- set_target_properties(bcmatroska2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
++ add_library(bcmatroska2-static STATIC $<TARGET_OBJECTS:corec-objects> $<TARGET_OBJECTS:ebml2-objects> ${MATROSKA2_SOURCE_FILES})
++ set_target_properties(bcmatroska2-static PROPERTIES OUTPUT_NAME bcmatroska2)
++ set_target_properties(bcmatroska2-static PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
+ if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
+- set_target_properties(bcmatroska2 PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
++ set_target_properties(bcmatroska2-static PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
+ endif()
+- target_include_directories(bcmatroska2 PRIVATE ../libebml2 .)
++ target_include_directories(bcmatroska2-static PRIVATE ../libebml2 .)
+ if(LIBS)
+- target_link_libraries(bcmatroska2 ${LIBS})
++ target_link_libraries(bcmatroska2-static ${LIBS})
+ endif()
+- install(TARGETS bcmatroska2 EXPORT BcMatroska2Targets
++ install(TARGETS bcmatroska2-static EXPORT BcMatroska2Targets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ )
Summary: Matroska2 library for Belledonne Communications projects
Summary(pl.UTF-8): Biblioteka Matroska2 do projektów Belledonne Communications
Name: bcmatroska2
-Version: 0.23
-Release: 2
+Version: 5.2.1
+Release: 1
License: BSD
Group: Libraries
-# for future releases see https://gitlab.linphone.org/BC/public/bcmatroska2/-/tags
-Source0: https://linphone.org/releases/sources/bcmatroska2/%{name}-%{version}.tar.gz
-# Source0-md5: bc9d6dbdfb9790c10051294cc4293476
+#Source0Download: https://gitlab.linphone.org/BC/public/bcmatroska2/-/tags
+Source0: https://gitlab.linphone.org/BC/public/bcmatroska2/-/archive/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: dc8602f20ca33c6e3e6b08fd6b527abc
+Patch0: %{name}-static.patch
+Patch1: %{name}-link.patch
URL: https://linphone.org/
-BuildRequires: cmake >= 3.0
+BuildRequires: cmake >= 3.1
BuildRequires: rpmbuild(macros) >= 1.605
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary(pl.UTF-8): Pliki nagłówkowe biblioteki bcmatroska2
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Obsoletes: matroska-foundation-devel
+Obsoletes: matroska-foundation-devel < 0.1
%description devel
Header files for bcmatroska2 library.
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
%build
install -d build