File qtox.spec of Package qtox

#
# spec file for package qtox
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           qtox
Version:        1.14.0
Release:        0
Summary:        Tox client that follows the Tox design guidelines
License:        GPL-3.0
Group:          Productivity/Networking/Instant Messenger
URL:            https://github.com/tux3/qTox
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM - when function is expected to return value, have default case, get rid of unused variables
Patch0:         https://github.com/qTox/qTox/commit/bc18990fd248c117916c88d640456e6b967a4802.patch#./fix_compiler_warnings.patch
BuildRequires:  cmake
BuildRequires:  glib2-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  libqt5-linguist-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  pkgconfig
BuildRequires:  c-toxcore-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libavdevice)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(libqrencode)
BuildRequires:  pkgconfig(libsodium)
BuildRequires:  pkgconfig(libswscale)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(opus)
BuildRequires:  pkgconfig(sqlcipher)
BuildRequires:  pkgconfig(vpx)
BuildRequires:  pkgconfig(xscrnsaver)

%description
qTox is a Tox client that follows the Tox design
guidelines.

%prep
%setup -q
%patch0 -p1

# W: file-contains-date-and-time
BUILD_TIME=$(LC_ALL=C date -ur %{_sourcedir}/%{name}.changes +'%{H}:%{M}')
BUILD_DATE=$(LC_ALL=C date -ur %{_sourcedir}/%{name}.changes +'%{b} %{d} %{Y}')
sed -i "s/__TIME__/\"$BUILD_TIME\"/" $(grep -rl '__TIME__')
sed -i "s/__DATE__/\"$BUILD_DATE\"/" $(grep -rl '__DATE__')

%build
%cmake
make %{?_smp_mflags} PREFIX=%{_prefix}

%install
%cmake_install
# 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

%files
%license LICENSE
%doc README.md CHANGELOG.md
%{_bindir}/%{name}
%{_datadir}/metainfo
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

%changelog
openSUSE Build Service is sponsored by