File qtox.spec of Package qtox

# spec file for package qtox
# Copyright (c) 2020 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

%define realname qTox

Name:           qtox
Version:        1.17.3
Release:        0
Summary:        Tox client
License:        GPL-3.0-only
Group:          Productivity/Networking/Instant Messenger
Source2:        qtox.keyring
BuildRequires:  cmake >= 2.8.11
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  cmake(KF5Sonnet) >= 5.45
BuildRequires:  cmake(LibsnoreQt5) >= 0.7.0

# needed?
####BuildRequires:  gcc-c++
####BuildRequires:  opencv-devel >= 2.4.9
###BuildRequires:  opencv-qt5-devel
###BuildRequires:  pkgconfig(Qt5Sql5-sqlite)
BuildRequires:  libqt5-qtbase-common-devel >= 5.5.0
BuildRequires:  pkgconfig(sqlite3)
# needed?

%if 0%{?suse_version} > 1500
BuildRequires:  ffmpeg-devel >= 4.0.0
BuildRequires:  ffmpeg-devel
#BuildRequires:  pkgconfig(libavformat)
#BuildRequires:  pkgconfig(libavdevice)
#BuildRequires:  pkgconfig(libavutil)
#BuildRequires:  pkgconfig(libavcodec)
#BuildRequires:  pkgconfig(libswscale)

BuildRequires:  glib2-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  libqt5-linguist-devel
BuildRequires:  libqt5-qtbase-devel >= 5.5.0
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core) >= 5.5.0
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(filteraudio)
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(libqrencode) >= 3.0.3
BuildRequires:  pkgconfig(libsodium)
BuildRequires:  pkgconfig(openal) >= 1.16.0
BuildRequires:  pkgconfig(opus)
BuildRequires:  pkgconfig(sqlcipher) >= 3.2.0
BuildRequires:  pkgconfig(toxcore) >= 0.2.10
BuildRequires:  pkgconfig(vpx)
BuildRequires:  pkgconfig(xscrnsaver) >= 1.2

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Powerful Tox client that tries to follow the Tox UI mockup while running on all
major systems.

%setup -q -n qTox
# rpmlint: datetime
sed -i -e 's|__TIME__ + " " + __DATE__|"%(date +"%%H:%%M") %(date +"%%Y-%%m-%%d")"|g' src/main.cpp
sed -i -e 's|__TIME__ << __DATE__|"%(date +"%%H:%%M") %(date +"%%Y-%%m-%%d")"|g' src/main.cpp

CFLAGS="%{optflags} -Wno-error=parentheses"
mkdir build
pushd build
make %{?_smp_mflags} PREFIX=%{_prefix}

make install -C build PREFIX=%{_prefix} DESTDIR=%{buildroot}
# remove non-standard dimensions
rm -rf %{buildroot}%{_datadir}/icons/hicolor/14x14
# decompress svgz to svg
cd %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
gzip -d < %{name}.svgz > %{name}.svg
rm %{name}.svgz
# fix desktop-file-name
mv %{buildroot}%{_datadir}/applications/io.github.qtox.qTox.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop

%fdupes %{buildroot}



%license LICENSE

openSUSE Build Service is sponsored by