File linphoneqt.spec of Package linphoneqt
#
# spec file for package linphoneqt
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _name linphone
Name: linphoneqt
Version: 4.3.2
Release: 0
Summary: Qt interface for Linphone
License: GPL-3.0-or-later
Group: Productivity/Telephony/SIP/Clients
URL: https://linphone.org/technical-corner/linphone
Source: https://gitlab.linphone.org/BC/public/linphone-desktop/-/archive/%{version}/%{_name}-desktop-%{version}.tar.bz2
Source1: %{_name}.appdata.xml
# PATCH-FIX-OPENSUSE linphoneqt-fix-no-git.patch -- Fix building out-of-git.
Patch0: linphoneqt-fix-no-git.patch
# PATCH-FIX-OPENSUSE https://aur.archlinux.org/cgit/aur.git/plain/0002-remove-bc_compute_full_version-usage.patch?h=linphone-desktop
Patch1: linphoneqt-0002-remove-bc_compute_full_version-usage.patch
BuildRequires: Mesa-libGLESv2-devel
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libqt5-linguist-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(Qt5Concurrent)
BuildRequires: pkgconfig(Qt5Core) >= 5.12
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5QuickControls2)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5TextToSpeech)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(linphone) >= 5.0.0
BuildRequires: pkgconfig(mediastreamer) >= 5.0.0
%description
Linphone is a Web phone with a Qt interface. It lets you make
two-party calls over IP networks such as the Internet. It uses the IETF
protocols SIP (Session Initiation Protocol) and RTP (Realtime TransporT
Protocol) to make calls, so it should be able to communicate with other
SIP-based Web phones. With several codecs available, it can be used
with high speed connections as well as 28k modems.
%package -n %{_name}
Summary: Web Phone
Group: Productivity/Telephony/SIP/Clients
Requires: liblinphone-data
Recommends: %{_name}-cli
Obsoletes: %{_name}-lang < %{version}
%description -n %{_name}
Linphone is a Web phone with a Qt interface. It lets you make
two-party calls over IP networks such as the Internet. It uses the IETF
protocols SIP (Session Initiation Protocol) and RTP (Realtime TransporT
Protocol) to make calls, so it should be able to communicate with other
SIP-based Web phones. With several codecs available, it can be used
with high speed connections as well as 28k modems.
%prep
%autosetup -n %{_name}-desktop-%{version} -p1
cp %{SOURCE1} linphone.appdata.xml
touch linphone-sdk/CMakeLists.txt
mkdir -p build/linphone-sdk/desktop/{bin,share}
# Fix building out-of-git
echo '#define LINPHONE_QT_GIT_VERSION "${PROJECT_VERSION}"' >> linphone-app/src/config.h.cmake
# Hardcode linphoneqt version
echo "project(linphoneqt VERSION %{version})" > linphone-app/linphoneqt_version.cmake
%build
sed -i '/^add_custom_command/s@${CMAKE_INSTALL_PREFIX}/include/@%{buildroot}%{_includedir}/@;/^add_custom_command/s@${CMAKE_INSTALL_PREFIX}/lib/@%{buildroot}%{_libdir}/@' linphone-app/CMakeLists.txt
#fix install error for 4.3.2
if [[ %version = 4.3.2 ]]; then
sed -i '/install(DIRECTORY.*linphone/d' linphone-app/cmake_builder/linphone_package/CMakeLists.txt
fi
%cmake \
-DCMAKE_CXX_FLAGS="-fpermissive" \
-DCMAKE_BUILD_TYPE=Release \
-DLINPHONE_OUTPUT_DIR="$PWD" \
-DENABLE_UPDATE_CHECK=OFF \
-DENABLE_STRICT=OFF \
-DENABLE_STATIC=OFF
%cmake_build
%install
%cmake_install
install -Dpm 0644 linphone.appdata.xml \
%{buildroot}%{_datadir}/metainfo/org.linphone.appdata.xml
rm %{buildroot}%{_bindir}/qt.conf
chmod a-x %{buildroot}%{_datadir}/applications/linphone.desktop
%files -n %{_name}
%license LICENSE.txt
%doc CHANGELOG.md README.md
%{_bindir}/linphone
%{_libdir}/libapp-plugin.so
%{_datadir}/linphone/
%{_datadir}/applications/linphone.desktop
%{_datadir}/icons/hicolor/*/apps/linphone.*
%dir %{_datadir}/metainfo/
%{_datadir}/metainfo/org.linphone.appdata.xml
%{_includedir}/LinphoneApp/
%changelog