# The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif # Part of Linphone stack: check linphone-desktop.spec. %define major 1 %define libname %mklibname %{name} %{major} %define libtestername %mklibname %{name}-tester %{major} %define develname %mklibname %{name} -d %bcond_without tester Name: bctoolbox Version: 5.4.130 Release: %mkrel 1 Summary: Utility library for software from Belledonne Communications License: GPLv3+ Group: Development/C++ Url: https://linphone.org Source0: https://gitlab.linphone.org/BC/public/bctoolbox/-/archive/%{version}/%{name}-%{version}.tar.bz2 Patch0: bctoolbox-opensuse-fix-pkgconfig.patch Patch1: bctoolbox-cmake-modules-install-dir.patch Patch2: bctoolbox-mbedtls.patch BuildRequires: cmake BuildRequires: cmake(BCUnit) >= 3.0.2 BuildRequires: ninja BuildRequires: gcc-c++ # Doesn't build with mbedtls 4, so using openssl BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(zlib) %description Utilities library used by Belledonne Communications software like belle-sip, mediastreamer2 and linphone. %package tester Summary: Tester wrappers used by Belledonne Communications's softwares %description tester A common set of tester wrappers used by Belledonne Communications's softwares. %package -n %{develname} Summary: Development files for %{name}, a utility library for linphone/belle-sip/etc Group: Development/C++ Requires: %{libname} = %{version}-%{release} %if %{with tester} Requires: %{libtestername} = %{version}-%{release} Requires: %{name}-tester = %{version}-%{release} %endif Requires: pkgconfig(zlib) Provides: %{name}-devel = %{version}-%{release} %description -n %{develname} Utilities library used by Belledonne Communications software like belle-sip, mediastreamer2 and linphone. This package contains development files. %package -n %{libname} Summary: Utility library for software from Belledonne Communications Group: System/Libraries Provides: %{name} = %{version}-%{release} %description -n %{libname} Utilities library used by Belledonne Communications software like belle-sip, mediastreamer2 and linphone. This package the contains shared library. %package -n %{libtestername} Summary: Utility library for software from Belledonne Communications Group: System/Libraries Provides: %{name}-tester = %{version}-%{release} %description -n %{libtestername} Utilities library used by Belledonne Communications software like belle-sip, mediastreamer2 and linphone. This package the contains shared library for testing component. %prep %autosetup -p1 # Fix version sed -i -e '/^project/s/\(VERSION\)\s\+[0-9]\+\(\.[0-9]\+\)\+/\1 %{version}/' CMakeLists.txt %build %cmake -GNinja \ -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ -DENABLE_STRICT:BOOL=NO \ -DENABLE_STATIC:BOOL=NO \ -DENABLE_POLARSSL:BOOL=NO \ -DENABLE_MBEDTLS:BOOL=NO \ -DENABLE_OPENSSL:BOOL=YES \ -DENABLE_TESTS_COMPONENT:BOOL=%{?with_tester:YES}%{!?with_tester:NO} %cmake_build %install %cmake_install %files -n %{libname} %license LICENSE.txt %{_libdir}/lib%{name}.so.%{major}{,.*} %if %{with tester} %files tester %license LICENSE.txt %{_bindir}/bctoolbox-tester %files -n %{libtestername} %license LICENSE.txt %{_libdir}/lib%{name}-tester.so.%{major}{,.*} %endif %files -n %{develname} %license LICENSE.txt %doc README.md %{_libdir}/pkgconfig/%{name}.pc %{_libdir}/lib%{name}.so %{_libdir}/cmake/BCToolbox/ %{_includedir}/%{name}/ %if %{with tester} %{_libdir}/pkgconfig/bctoolbox-tester.pc %{_libdir}/lib%{name}-tester.so %endif