File ricochet.spec of Package ricochet-im

#
# spec file for package ricochet
#
# Copyright (c) 2015 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:           ricochet
Version:        1.1.4
Release:        0
Summary:        Anonymous metadata-resistant instant messaging that just works
License:        BSD-3-Clause
Group:          Productivity/Networking/Instant Messenger
Url:            https://ricochet.im/
Source:         %{name}-%{version}.tar.xz
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(libcrypto)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Quick)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:	pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  make
BuildRequires:  pkgconfig(protobuf)
Requires:       libqt5-qtquickcontrols
Requires:       tor
Requires:       apparmor-abstractions
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch:          apparmor-profile.patch

%if 0%{?fedora}
BuildRequires:  application(qt5-linguist.desktop)
%endif
     
%if 0%{?suse_version}
BuildRequires:  application(linguist5.desktop)
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
%endif


%description
Ricochet is an open source peer-to-peer instant messaging system built on Tor hidden services.
Your login is your hidden service address, and contacts connect to you (not an intermediate server) through Tor.
The rendezvous system makes it extremely hard for anyone to learn your identity from your address.

An audit by NCC Group through the Open Technology Fund validates Ricochet's security and provides a great
outline of areas to improve in the near future (https://ricochet.im/files/ricochet-ncc-audit-2016-01.pdf).
  
Ricochet is not affiliated with or endorsed by The Tor Project.

%prep
%setup -q
%patch

%build
lrelease-qt5 ricochet.pro
qmake-qt5 QMAKE_CFLAGS+="%{optflags}" QMAKE_CXXFLAGS+="%{optflags}" QMAKE_STRIP="/bin/true" DEFINES+=RICOCHET_NO_PORTABLE DESTDIR="%{buildroot}"
make %{?_smp_mflags}

%install
%make_install INSTALL_ROOT=%{buildroot}
rm %{buildroot}/%{name}

# Create valid desktop file for openSUSE systems
%if 0%{?suse_version}
    rm %{buildroot}/%{_datadir}/applications/%{name}.desktop
    %suse_update_desktop_file -c %{name} Ricochet "Anonymous instant messaging" %{_bindir}/%{name} %{_datadir}/icons/hicolor/48x48/apps/%{name}.png Network InstantMessaging Chat FileTransfer Qt
%endif

%__install -Dm 600 contrib/usr.bin.ricochet-apparmor %{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.ricochet-apparmor

%post
/sbin/apparmor_parser -r /etc/apparmor.d/usr.bin.ricochet-apparmor &> /dev/null || :

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

%config %{_sysconfdir}/apparmor.d/usr.bin.ricochet-apparmor

%dir %{_sysconfdir}/apparmor.d

%doc AUTHORS.md README.md LICENSE BUILDING.md


%changelog
openSUSE Build Service is sponsored by