File vibranium.spec of Package vibranium
#
# spec file for package vibranium
#
# Copyright (c) 2018 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: vibranium
Version: 1.1.0.0
Release: 0
Summary: P2P digital currency
License: MIT
Group: Productivity/Networking/Other
Url: https://github.com/viecoin/%{name}/
Source0: %{name}-%{version}.tar.xz
Source1: icons_black.tar.gz
Source2: update_spinner_black.mng
Patch0: %{name}-boost1.patch
Patch1: %{name}-boost2.patch
Patch2: %{name}-chainparams.patch
Patch3: %{name}-darksend.patch
Patch4: %{name}-masternode.patch
Patch5: %{name}-net.patch
Patch6: %{name}-qmake.patch
Patch7: %{name}-qt.patch
Patch8: %{name}-util.patch
Patch9: %{name}-rpcrawtransaction.patch
ExcludeArch: aarch64
%if 0%{?suse_version} && 0%{?suse_version} > 1320
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
%else
BuildRequires: boost-devel
%endif
BuildRequires: libdb-4_8-devel
BuildRequires: libminiupnpc-devel
BuildRequires: libsecp256k1-legacy-devel
%if 0%{?suse_version} && 0%{?suse_version} > 1320
BuildRequires: libopenssl-1_0_0-devel
%else
BuildRequires: libopenssl-devel
%endif
BuildRequires: libqt5-qtbase-devel
BuildRequires: qrencode-devel
BuildRequires: update-desktop-files
%global qt4_version qt
%global qt5_version qt5
%define qt_version %{qt5_version}
%define qt_version_obsolete %{qt4_version}
%define ancient_name fade
%define daemon_name %{name}d
%define display_name Vibranium
%define gui_name %{name}-qt
%if 0%{?suse_version} && 0%{?is_opensuse} && 0%{?suse_version} == 1315 && 0%{?sle_version} && 0%{?sle_version} >= 120200
%define ___qmake_cxxflags QMAKE_CXXFLAGS="${QMAKE_CXXFLAGS} -DBOOST_NO_CXX11_SCOPED_ENUMS"
%endif
%if 0%{?suse_version} && 0%{?suse_version} > 1320
%define ___qmake_cxxflags QMAKE_CXXFLAGS="${QMAKE_CXXFLAGS} -DBOOST_ASIO_ENABLE_OLD_SERVICES"
%endif
%if 0%{?suse_version} && 0%{?suse_version} > 1500
%define ___qmake_cxxflags QMAKE_CXXFLAGS="${QMAKE_CXXFLAGS} -std=c++14"
%endif
%define description_text_1 Vibranium is a PoS-based cryptocurrency.
%define description_text_2 Vibranium includes an Address Index feature, based on the address index API (searchrawtransactions RPC command) implemented in Bitcoin Core but modified implementation to work with the Vibranium codebase (PoS coins maintain a txindex by default for instance).
%define description_text_3 Initialize the Address Index By Running with -reindexaddr Command Line Argument. It may take 10-15 minutes to build the initial index.
%description
%{description_text_1}
%{description_text_2}
%{description_text_3}
%package %{qt_version}
Summary: GUI for the %{display_name} crypto-currency
Group: Productivity/Networking/Other
Obsoletes: %{ancient_name}-%{qt_version}
Obsoletes: %{name}-%{qt_version_obsolete}
%description %{qt_version}
%{description_text_1}
%{description_text_2}
%{description_text_3}
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
Group: Productivity/Networking/Other
Obsoletes: %{ancient_name}d
%description -n %{daemon_name}
%{description_text_1}
%{description_text_2}
%{description_text_3}
This package provides %{daemon_name}, a headless %{name} daemon.
%prep
%setup -q
%if 0%{?suse_version} && 0%{?suse_version} > 1320
%patch0
%patch9
%endif
%if 0%{?suse_version} && 0%{?suse_version} > 1500
%patch1
%patch7
%endif
%if 0%{?suse_version} && ( 0%{?suse_version} > 1320 || ( 0%{?is_opensuse} && 0%{?suse_version} == 1315 && 0%{?sle_version} && 0%{?sle_version} >= 120200 ) )
%patch2
%patch3
%patch4
%endif
%patch5
%patch6
%patch8
%{__tar} -xzf %{S:1} -C src/qt/res/icons
%{__cp} -a %{S:2} src/qt/res/movies/
%{__chmod} 0755 src/leveldb/build_detect_platform
%{__mkdir_p} src/obj/crypto
%build
qmake-qt5 USE_QRCODE=1 USE_DBUS=1 %{?___qmake_cxxflags}
%{__make} %{?_smp_mflags}
%{__mv} %{display_name}-qt %{gui_name}
%{__strip} -s %{gui_name}
%if 0%{?suse_version} && 0%{?suse_version} > 1320
export CXXFLAGS="${CXXFLAGS} -DBOOST_ASIO_ENABLE_OLD_SERVICES"
%endif
%if 0%{?suse_version} && 0%{?suse_version} > 1500
export CXXFLAGS="${CXXFLAGS} -std=c++14"
%endif
%{__make} -C src -f makefile.unix %{?_smp_mflags}
%{__mv} src/%{display_name}d src/%{daemon_name}
%{__strip} -s src/%{daemon_name}
%install
%{__install} -dm 0755 %{buildroot}%{_bindir}
%{__install} -m 0755 %{gui_name} %{buildroot}%{_bindir}
%{__install} -m 0755 src/%{daemon_name} %{buildroot}%{_bindir}
%{__install} -dm 0755 %{buildroot}%{_datadir}/pixmaps
%{__install} -m 0644 src/qt/res/icons/novacoin-128.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 README.md
%license COPYING
%files -n %{daemon_name}
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/%{daemon_name}
%doc README.md
%license COPYING
%changelog