File bytecoin.spec of Package bytecoin

#
# spec file for package bytecoin
#
# 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 lmdb_name lmdb
%define lmdb_version 0.9.22
Name:           bytecoin
Version:        3.5.1
Release:        0
Summary:        P2P digital currency
License:        GPL-3.0-only AND OLDAP-2.8
Group:          Productivity/Networking/Other
URL:            https://%{name}.org/
%define g_name %{name}-gui
Source0:        %{name}-%{version}.tar.xz
Source1:        %{g_name}-%{version}.tar.xz
Source2:        %{lmdb_name}-%{lmdb_version}.tar.xz
Patch0:         %{name}-cmake.patch
Patch1:         %{name}-gui.patch
Patch2:         %{name}-lmdb.patch
ExclusiveArch:  i586 x86_64
BuildRequires:  cmake
%if 0%{?suse_version} && 0%{?suse_version} > 1320
BuildRequires:  libboost_system-devel
%else
BuildRequires:  boost_1_62-devel
%endif
BuildRequires:  libopenssl-devel
%if 0%{?suse_version} && 0%{?suse_version} >= 1315
BuildRequires:  libqt5-qtbase-devel
%else
BuildRequires:  libqt4-devel
%endif
BuildRequires:  libudev-devel
BuildRequires:  update-desktop-files

%global qt4_version qt
%global qt5_version qt5
%global qt4c_version qt4

%if 0%{?suse_version} && 0%{?suse_version} >= 1315
%define qt_version %{qt5_version}
%define qt_version_obsolete %{qt4_version}
%define qt_config %{qt5_version}
%else
%define qt_version %{qt4_version}
%define qt_version_obsolete %{qt5_version}
%define qt_config %{qt4c_version}
%endif

# set binary names
%define daemon_name %{name}d
%define display_name ByteCoin
%define gui_name %{name}-qt
%define test_name test_%{name}
%define wallet_name walletd

# set description
%define description_text_1 ByteCoin is a private, decentralized cryptocurrency with an open source code that allows everyone to take part in the network development of ByteCoin. Privacy and security are naturally proponents of ByteCoin and it’s best solution for those who want to keep their finances private.
%define description_text_3 ByteCoin is decentralized
%define description_text_4 ByteCoin is a cryptocurency that works on the blockchain operated by a multitude of nodes around the world.
%define description_text_6 Payments are untraceable
%define description_text_7 ByteCoin uses Ring signatures to mix different outputs of similar value into one transaction, making it nearly impossible to deduce where the money came from. On theByteCoin blockchain all addresses are obscured.
%define description_text_9 Transactions and addresses are unlinkable
%define description_text_10 ByteCoin allows users to generate numerous unlinkable one-time addresses from a single set of keys. This makes it nearly impossible to establish a connection between transactions or addresses.
%define description_text_12 ByteCoin’s parameters are adaptive
%define description_text_13 ByteCoin readjusts the difficulty with every block to react to even the slightest hashrate changes. In addition, ByteCoin’s emission curve is smooth which prevents mining reward drops.
%define description_text_15 ByteCoin is omnipresent
%define description_text_16 ByteCoin has a continiously growing ecosystem of partners, integrators, merchants, and mining pools, making it available worldwide.
%define description_text_18 ByteCoin is evolving
%define description_text_19 ByteCoin is an open-source software project, where everyone can contribute to and keep up with the project’s development.

%description
%{description_text_1}

%{description_text_3}
%{description_text_4}

%{description_text_6}
%{description_text_7}

%{description_text_9}
%{description_text_10}

%{description_text_12}
%{description_text_13}

%{description_text_15}
%{description_text_16}

%{description_text_18}
%{description_text_19}

%package %{qt_version}
Summary:        GUI for the %{display_name} crypto-currency
License:        GPL-3.0-only
Group:          Productivity/Networking/Other
Requires:       %{daemon_name} = %{version}
Obsoletes:      %{name}-%{qt_version_obsolete}

%description %{qt_version}
%{description_text_1}

%{description_text_3}
%{description_text_4}

%{description_text_6}
%{description_text_7}

%{description_text_9}
%{description_text_10}

%{description_text_12}
%{description_text_13}

%{description_text_15}
%{description_text_16}

%{description_text_18}
%{description_text_19}

This package provides %{display_name} Qt, a GUI for %{display_name} based on Qt.

%package -n %{daemon_name}
Summary:        Headless daemon for %{name} crypto-currency
License:        GPL-3.0-only AND OLDAP-2.8
Group:          Productivity/Networking/Other

%description -n %{daemon_name}
%{description_text_1}

%{description_text_3}
%{description_text_4}

%{description_text_6}
%{description_text_7}

%{description_text_9}
%{description_text_10}

%{description_text_12}
%{description_text_13}

%{description_text_15}
%{description_text_16}

%{description_text_18}
%{description_text_19}

This package provides %{daemon_name}, a headless %{name} daemon.

%package test
Summary:        Automated tests for %{name} client
License:        GPL-3.0-only AND OLDAP-2.8
Group:          Productivity/Networking/Other

%description test
%{description_text_1}

%{description_text_3}
%{description_text_4}

%{description_text_6}
%{description_text_7}

%{description_text_9}
%{description_text_10}

%{description_text_12}
%{description_text_13}

%{description_text_15}
%{description_text_16}

%{description_text_18}
%{description_text_19}

This package provides automated tests for %{gui_name} and %{daemon_name}.

%prep
%setup -q -b 0
%setup -q -b 1
%setup -q -b 2
cd %{_builddir}
%{__ln_s} %{name}-%{version} %{name}
%{__ln_s} %{g_name}-%{version} %{g_name}
%{__ln_s} %{lmdb_name}-%{lmdb_version} %{lmdb_name}
%patch0
%patch1
%patch2
%{__cp} %{lmdb_name}/libraries/lib%{lmdb_name}/COPYRIGHT %{lmdb_name}/libraries/lib%{lmdb_name}/COPYRIGHT.lmdb
%{__cp} %{lmdb_name}/libraries/lib%{lmdb_name}/LICENSE %{lmdb_name}/libraries/lib%{lmdb_name}/LICENSE.lmdb

%build
%{__mkdir_p} build
cd build
%{__cmake} -DUSE_SQLITE=0 -DCMAKE_SKIP_RPATH:BOOL=ON ..
%{__make}
%{__mv} ../bin/tests ../bin/%{test_name}
%{__strip} -s ../bin/%{daemon_name}
%{__strip} -s ../bin/%{test_name}
%{__strip} -s ../bin/%{wallet_name}
cd %{_builddir}/%{g_name}
%{__mkdir_p} build
cd build
%{__cmake} -DCMAKE_SKIP_RPATH:BOOL=ON ..
%{__make}
%{__mv} ../bin/%{g_name} ../bin/%{gui_name}
%{__strip} -s ../bin/%{gui_name}

%install
%{__install} -dm 0755 %{buildroot}%{_bindir}
%{__install} -m 0755 %{_builddir}/%{name}/bin/%{daemon_name} %{buildroot}%{_bindir}
%{__install} -m 0755 %{_builddir}/%{name}/bin/%{test_name} %{buildroot}%{_bindir}
%{__install} -m 0755 %{_builddir}/%{name}/bin/%{wallet_name} %{buildroot}%{_bindir}
%{__install} -m 0755 %{_builddir}/%{g_name}/bin/%{gui_name} %{buildroot}%{_bindir}

# install desktop file
%{__install} -D -m 0644 %{_builddir}/%{g_name}/src/images/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%suse_update_desktop_file -c %{gui_name} "%{display_name}" "%{display_name} Wallet" %{gui_name} %{name} Office Finance

%if 0%{?suse_version} && 0%{?suse_version} < 1500
%post %{qt_version}
%desktop_database_post

%postun %{qt_version}
%desktop_database_postun
%endif

%files %{qt_version}
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{gui_name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{gui_name}.desktop
%doc ../%{g_name}/README.md ../%{g_name}/ReleaseNotes.md
%license ../%{g_name}/LICENSE

%files -n %{daemon_name}
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{daemon_name}
%attr(755,root,root) %{_bindir}/%{wallet_name}
%doc ../%{name}/README.md ../%{name}/ReleaseNotes.md
%license ../%{name}/LICENSE ../%{lmdb_name}/libraries/lib%{lmdb_name}/COPYRIGHT.lmdb ../%{lmdb_name}/libraries/lib%{lmdb_name}/LICENSE.lmdb

%files test
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{test_name}
%license ../%{name}/LICENSE ../%{lmdb_name}/libraries/lib%{lmdb_name}/COPYRIGHT.lmdb ../%{lmdb_name}/libraries/lib%{lmdb_name}/LICENSE.lmdb

%changelog
openSUSE Build Service is sponsored by