File monero-gui.spec of Package monero-gui

#
# spec file for package monero-gui
#
# 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 https://bugs.opensuse.org/
#


Name:           monero-gui
Version:        0.17.1.5
Release:        0
Summary:        GUI for the Monero crypto-currency
License:        BSD-3-Clause
Group:          Productivity/Networking/Other
URL:            https://github.com/monero-project/monero-gui
Source0:        %{name}-%{version}.tar.xz
Source1:        %{name}.desktop
Source2:        %{name}.changes
Source3:        %{name}-rpmlintrc
Source4:        _constraints
# Disable (re)creating desktop entry at every program start - done at package install
Patch0:         monero-gui-nodesktop.patch
%if 0%{?suse_version} && 0%{?suse_version} > 1320
BuildRequires:  libboost_chrono-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_locale-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_serialization-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_thread-devel
%else
%if 0%{?is_opensuse} && 0%{?suse_version} == 1315 && 0%{?sle_version} && 0%{?sle_version} >= 120200
BuildRequires:  boost-devel >= 1.58
%else
BuildRequires:  boost_1_58_0-devel
%endif
%endif
BuildRequires:  cmake >= 3.5
BuildRequires:  cppzmq-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++ >= 4.7.3
BuildRequires:  graphviz
BuildRequires:  hicolor-icon-theme
BuildRequires:  ldns-devel >= 1.6.17
BuildRequires:  libevent-devel >= 2.0
BuildRequires:  libexpat-devel >= 1.1
BuildRequires:  libminiupnpc-devel >= 2.0
BuildRequires:  libopenssl-devel
BuildRequires:  libsodium-devel
BuildRequires:  libunwind-devel
BuildRequires:  pkg-config
BuildRequires:  readline-devel
%if 0%{?suse_version} && 0%{?is_opensuse} && 0%{?suse_version} == 1315 && 0%{?sle_version} && 0%{?sle_version} >= 120200
BuildRequires:  shadow
%endif
BuildRequires:  unbound-devel >= 1.4.16
BuildRequires:  update-desktop-files
BuildRequires:  xz-devel
BuildRequires:  automake
BuildRequires:  libQt5Core-devel >= 5.9.7
BuildRequires:  libQt5QuickControls2-devel >= 5.9.7
BuildRequires:  libgcrypt-devel
BuildRequires:  libgcrypt20
BuildRequires:  libhidapi-devel
BuildRequires:  libqt5-qtbase-devel >= 5.9.7
BuildRequires:  libqt5-qtdeclarative-devel >= 5.9.7
BuildRequires:  libqt5-qtsvg-devel >= 5.9.7
BuildRequires:  libqt5-qttools-devel >= 5.9.7
BuildRequires:  libusb-devel
BuildRequires:  memory-constraints
BuildRequires:  openssl-devel
BuildRequires:  unbound-devel >= 1.4.16
BuildRequires:  zeromq-devel >= 3.0.0
Requires:       monerod
ExclusiveArch:  x86_64

# set binary names
%define display_name Monero
%define gui_name monero-wallet-gui

%define description_text_1 Monero is a private, secure, untraceable, decentralised digital currency. You are your bank, you control your funds, and nobody can trace your transfers unless you allow them to do so.
%define description_text_2 Privacy: Monero uses a cryptographically sound system to allow you to send and receive funds without your transactions being easily revealed on the blockchain (the ledger of transactions that everyone has). This ensures that your purchases, receipts, and all transfers remain absolutely private by default.
%define description_text_3 Security: Using the power of a distributed peer-to-peer consensus network, every transaction on the network is cryptographically secured. Individual wallets have a 24 word mnemonic seed that is only displayed once, and can be written down to backup the wallet. Wallet files are encrypted with a passphrase to ensure they are useless if stolen.
%define description_text_4 Untraceability: By taking advantage of ring signatures, a special property of a certain type of cryptography, Monero is able to ensure that transactions are not only untraceable, but have an optional measure of ambiguity that ensures that transactions cannot easily be tied back to an individual user or computer.

%description
%{description_text_1}
%{description_text_2}
%{description_text_3}
%{description_text_4}

This package provides %{display_name}-GUI, a graphical user interface for %{display_name}.

%prep
%setup -q

%patch0 -p1

%build
%limit_build -m 2560
%{__mkdir_p} build/release
cd build/release
%{__cmake} -DBUILD_TESTS=OFF -DBUILD_GUI_DEPS=ON -DCMAKE_BUILD_TYPE=release ../..
%cmake_build
%{__strip} -s bin/%{gui_name}

%install
# install binary
%{__install} -D -m 0755 build/release/bin/%{gui_name} %{buildroot}%{_bindir}/%{gui_name}

# install documentation
%{__install} -d -m 0755 %{buildroot}%{_defaultdocdir}/%{name}
%{__install} -m 0644 -p -t %{buildroot}%{_defaultdocdir}/%{name} README.md
%{__install} -d -m 0755 %{buildroot}%{_defaultlicensedir}/%{name}
%{__install} -m 0644 -p -t %{buildroot}%{_defaultlicensedir}/%{name} LICENSE

# install icons
for _res in 16 24 32 48 64 96 128 256; do
    %{__install} -D -m 0644 "images/appicons/${_res}x${_res}.png" "%{buildroot}%{_datadir}/icons/hicolor/${_res}x${_res}/apps/monero.png"
done

# install desktop file
%{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop

%suse_update_desktop_file %{name}

%files
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{gui_name}
%{_defaultdocdir}/%{name}/
%{_defaultlicensedir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor

%changelog
openSUSE Build Service is sponsored by