# TODO: tunnel? (BR: pkgconfig(tunnel) or TunnelConfig.cmake)
#
# Conditional build:
+%bcond_without dnssd # MDNS/DNSSD support
%bcond_without static_libs # static library
%bcond_with tests # enable tests
#
Summary: SIP (RFC3261) object-oriented implementation in C
Summary(pl.UTF-8): Implementacja SIP (RFC3261) w C
Name: belle-sip
-Version: 1.6.3
+Version: 4.5.20
Release: 1
License: GPL v2+
Group: Libraries
-Source0: https://linphone.org/releases/sources/belle-sip/%{name}-%{version}.tar.gz
-# Source0-md5: 90c40812d98671ad2f40621542500bc6
+#Source0Download: https://gitlab.linphone.org/BC/public/belle-sip/-/tags
+Source0: https://gitlab.linphone.org/BC/public/belle-sip/-/archive/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 57b680975c7c78955bc06b5331f651bf
Patch0: antlr_jar.patch
-Patch1: build.patch
+Patch1: %{name}-pc.patch
URL: http://www.linphone.org/
%{?with_tests:BuildRequires: CUnit >= 2.0}
-BuildRequires: autoconf >= 2.63
-BuildRequires: automake >= 1:1.11
BuildRequires: bctoolbox-devel >= 0.5.0
+BuildRequires: cmake >= 3.1
BuildRequires: java-antlr3 >= 3.2
BuildRequires: jre
BuildRequires: libantlr3c-devel >= 3.4
BuildRequires: libstdc++-devel
-BuildRequires: libtool >= 2:2
BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 1.605
BuildRequires: zlib-devel >= 1.2.3
Requires: bctoolbox >= 0.5.0
Requires: libantlr3c >= 3.4
Statyczna biblioteka %{name}.
%prep
-%setup -q -n %{name}-%{version}-0
+%setup -q
%patch0 -p1
%patch1 -p1
%build
-%{__libtoolize}
-%{__aclocal} -I m4
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-WARNFLAGS="-Wno-error=pragmas -Wno-error=array-bounds"
-%if "%{cc_version}" >= "7"
-WARNFLAGS="$WARNFLAGS -Wno-implicit-fallthrough -Wno-error=cast-function-type"
-%endif
-%configure \
- CFLAGS="%{rpmcflags} $WARNFLAGS" \
- --disable-silent-rules \
- %{!?with_static_libs:--disable-static}
+install -d builddir
+cd builddir
+%cmake .. \
+ %{?with_dnssd:-DENABLE_MDNS=ON} \
+ %{!?with_static_libs:-DENABLE_STATIC=OFF} \
+ %{!?with_tests:-DENABLE_TESTS=OFF}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -C builddir install \
DESTDIR=$RPM_BUILD_ROOT
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libbellesip.la
-
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc AUTHORS NEWS README.md
-%attr(755,root,root) %{_libdir}/libbellesip.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libbellesip.so.0
+%doc AUTHORS.md CHANGELOG.md README.md
+%attr(755,root,root) %{_libdir}/libbellesip.so.1
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libbellesip.so
%{_includedir}/belle-sip
%{_pkgconfigdir}/belle-sip.pc
+%{_libdir}/cmake/BelleSIP
%if %{with static_libs}
%files static
+++ /dev/null
---- belle-sip-1.6.3-0/src/belle_sdp_impl.c~ 2016-12-06 15:34:34.000000000 +0100
-+++ belle-sip-1.6.3-0/src/belle_sdp_impl.c 2018-09-26 15:32:00.385709065 +0200
-@@ -1053,7 +1053,7 @@ void belle_sdp_media_description_append_
- current_ptime=belle_sdp_mime_parameter_get_ptime(mime_parameter);
- }
- if (current_ptime>0){
-- char ptime[10];
-+ char ptime[11];
- snprintf(ptime,sizeof(ptime),"%i",current_ptime);
- belle_sdp_media_description_set_attribute_value(media_description,"ptime",ptime);
- }
-@@ -1062,7 +1062,7 @@ void belle_sdp_media_description_append_
- current_max_ptime=belle_sdp_mime_parameter_get_max_ptime(mime_parameter);
- }
- if (current_max_ptime>0){
-- char max_ptime[10];
-+ char max_ptime[11];
- snprintf(max_ptime,sizeof(max_ptime),"%i",current_max_ptime);
- belle_sdp_media_description_set_attribute_value(media_description,"maxptime",max_ptime);
- }