--- /dev/null
+--- bzrtp-5.2.51/include/bzrtp/bzrtp.h.orig 2023-02-22 10:01:18.000000000 +0100
++++ bzrtp-5.2.51/include/bzrtp/bzrtp.h 2023-04-18 21:56:42.215384029 +0200
+@@ -272,6 +272,8 @@ BZRTP_EXPORT bzrtpContext_t *bzrtp_creat
+ */
+ BZRTP_EXPORT int bzrtp_initBzrtpContext(bzrtpContext_t *context, uint32_t selfSSRC);
+
++BZRTP_EXPORT void bzrtp_resetBzrtpContext(bzrtpContext_t *context);
++
+ /**
+ * Free memory of context structure to a channel, if all channels are freed, free the global zrtp context
+ * @param[in] context Context hosting the channel to be destroyed.(note: the context zrtp context itself is destroyed with the last channel)
+--- bzrtp-5.2.51/src/bzrtp.c.orig 2023-02-22 10:01:18.000000000 +0100
++++ bzrtp-5.2.51/src/bzrtp.c 2023-04-18 21:59:34.831115556 +0200
+@@ -181,6 +181,17 @@ int bzrtp_setZIDCache_lock(bzrtpContext_
+ #endif /* ZIDCACHE_ENABLED */
+ }
+
++void bzrtp_resetBzrtpContext(bzrtpContext_t *context) {
++ int i;
++ for (i=0; i<ZRTP_MAX_CHANNEL_NUMBER; i++) {
++ if (context->channelContext[i]) {
++ void * clientData = context->channelContext[i]->clientData;
++ bzrtp_initChannelContext(context, context->channelContext[i], context->channelContext[i]->selfSSRC, context->channelContext[i]->isMainChannel);
++ context->channelContext[i]->clientData = clientData;
++ }
++ }
++}
++
+ /**
+ * @brief Perform some initialisation which can't be done without some callback functions:
+ * This function is called once per session when the first channel is created.
-# TODO: switch to mbledtls when 2.x is supported (mbed_ssl_init instead of ssl_init)
#
# Conditional build:
%bcond_without static_libs # static library
Summary: Open source implementation of ZRTP keys exchange protocol
Summary(pl.UTF-8): Mająca otwarte źródła implementacja protokołu wymiany kluczy ZRTP
Name: bzrtp
-Version: 1.0.6
-Release: 3
-License: GPL v2+
+Version: 5.3.26
+Release: 1
+License: GPL v3+
Group: Libraries
-Source0: http://linphone.org/releases/sources/bzrtp/%{name}-%{version}.tar.gz
-# Source0-md5: e77a6b074bb810a02cc77a1df776fb79
+#Source0Download: https://gitlab.linphone.org/BC/public/bzrtp/tags
+Source0: https://gitlab.linphone.org/BC/public/bzrtp/-/archive/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 22a3fd39362fce8ebf595a581bd633b6
+Patch0: %{name}-resetBzrtpContext.patch
URL: http://www.linphone.org/
-BuildRequires: CUnit
-BuildRequires: autoconf >= 2.63
-BuildRequires: automake
-BuildRequires: bctoolbox-devel
-BuildRequires: libtool >= 2:2
-BuildRequires: libxml2-devel >= 2.0
-BuildRequires: polarssl-devel
+BuildRequires: bctoolbox-devel >= 5.3.0
+BuildRequires: cmake >= 3.22
+BuildRequires: libstdc++-devel >= 6:4.7
BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 1.748
+BuildRequires: sqlite3-devel >= 3.6.0
+Requires: bctoolbox >= 5.3.0
+Requires: sqlite3 >= 3.6.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary(pl.UTF-8): Plik nagłówkowy biblioteki bzrtp
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Requires: bctoolbox-devel >= 5.3.0
%description devel
Header file for bzrtp library.
%prep
%setup -q
+%patch0 -p1
%build
-# rebuild ac/am/lt for as-needed to work
-%{__libtoolize}
-%{__aclocal} -I m4
-%{__autoconf}
-%{__automake}
-%configure \
- CPPFLAGS="%{rpmcppflags} -Wno-error=cast-function-type" \
- --disable-silent-rules \
- %{?with_static_libs:--enable-static}
-
-%{__make}
+%if %{with static_libs}
+%cmake -B builddir-static \
+ -DBUILD_SHARED_LIBS=OFF
+
+%{__make} -C builddir-static
+%endif
+
+%cmake -B builddir
+
+%{__make} -C builddir
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%if %{with static_libs}
+%{__make} -C builddir-static install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%{__make} -C builddir install \
DESTDIR=$RPM_BUILD_ROOT
-# obsoleted by pkg-config
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libbzrtp.la
+# missing from cmake
+test ! -f $RPM_BUILD_ROOT%{_pkgconfigdir}/libbzrtp.pc
+install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
+%{__sed} -e 's,@prefix@,%{_prefix},' \
+ -e 's,@exec_prefix@,%{_exec_prefix},' \
+ -e 's,@includedir@,%{_includedir},' \
+ -e 's,@PACKAGE_VERSION@,%{version},' \
+ -e 's,@libdir@,%{_libdir},' libbzrtp.pc.in >$RPM_BUILD_ROOT%{_pkgconfigdir}/libbzrtp.pc
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc AUTHORS NEWS README.md
-%attr(755,root,root) %{_libdir}/libbzrtp.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libbzrtp.so.0
+%doc CHANGELOG.md README.md
+%attr(755,root,root) %{_libdir}/libbzrtp.so.0
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libbzrtp.so
%{_includedir}/bzrtp
%{_pkgconfigdir}/libbzrtp.pc
+%dir %{_datadir}/BZRTP
+%{_datadir}/BZRTP/cmake
%if %{with static_libs}
%files static