File feathercoin.spec of Package feathercoin

#
# spec file for package feathercoin
#
# Copyright (c) 2013-2018 Peter Conrad
#
# 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:		feathercoin
Version:	0.13.1.0
Release:	1
License:	MIT
Summary:	P2P digital currency
Url:		http://www.feathercoin.com/
Group:		Productivity/Networking/Other
Source:		https://github.com/FeatherCoin/Feathercoin/archive/v%{version}.tar.gz
Source1:	%{name}.desktop
Source2:	%{name}d-safe
Source3:	%{name}d.apparmor
# Originally from https://github.com/vertcoin/vertcoin/raw/v0.8.7.3/doc/secp256k1-keycpp-patch-fedora-openssl
Patch:		secp256k1-keycpp-patch-fedora-openssl
BuildRequires:	boost-devel libcurl-devel autoconf automake
%if 0%{?suse_version} > 0
BuildRequires:	libminiupnpc-devel
BuildRequires:	qrencode-devel
BuildRequires:	libjansson-devel
BuildRequires:	libdb-4_8-devel
BuildRequires:	apparmor-parser
BuildRequires:	update-desktop-files
BuildRequires:	libqt5-qtbase-devel
BuildRequires:	protobuf-devel
BuildRequires:	libopenssl-devel
BuildRequires:	libevent-devel
%else
%if 0%{?fedora} > 0
BuildRequires:	miniupnpc-devel
BuildRequires:	qrencode-devel
BuildRequires:	libdb4-cxx-devel
BuildRequires:	jansson-devel
%else
BuildRequires:	gcc-c++
BuildRequires:	db4-devel
BuildRequires:	libjansson-devel-static
%endif
%if 0%{?fedora} < 20
BuildRequires:	libopenssl-ecc-devel
%else
BuildRequires:	libopenssl-devel
%endif
BuildRequires:	qt-devel
%endif
BuildRequires:	libtool
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%description
FeatherCoin is a fork of Litecoin using its latest build.

One of Litecoin’s biggest advantages is the Scrypt-based hashing algorithm.
This offers a different solution to Bitcoin, while still being able to run
on GPUs. There are many Bitcoin forks using the original hashing algorithm,
but with the advent of ASIC mining hardware, we are starting to see how much
trouble they can cause. ASIC mining hardware is expensive, but outperforms
GPU hardware and will eventually make GPU Bitcoin mining redundant.  Scrypt
based crypto currency is safe guarded from the effects of ASIC mining.

Feathercoin had an initial block reward of 200 coins and will have a total of
336 million coins. This makes it four times that of LiteCoin, this is the
same position that LiteCoin was set against BitCoin.

* Default port is 9336
  Forwarding this port can help if you have connection problems
* Default RPC port is 9337
  This is the port is point your miners towards if solo mining
* 1 minute block target
* difficulty retarget in every block
* 9% maximum change on difficulty retarget
* Block reward halves every 2100000 blocks (currently 80 FTC)
* NeoScrypt hashing algorithm (from block 432000 on)

This package contains the daemon only.

Please send donations to package maintainer: 6oatW3gwaccgQBZwMP7PWSBKwt8fkquPjr

#%%package gui
#Summary:	GUI application for FeatherCoin
#Group:		Productivity/Networking/Other
#
#%%description gui
#FeatherCoin is a fork of Litecoin using its latest build.
#
#This package contains the gui application and desktop integration.
#
#Please send donations to package maintainer: 6oatW3gwaccgQBZwMP7PWSBKwt8fkquPjr

%prep
%setup -q -n Feathercoin-%{version}
%if 0%{?fedora} >= 20
%patch -p0
%endif
# Fix for newer miniupnp:
%__sed -i '/0, "TCP/s/0)/0, "0")/' src/net.cpp
if grep 'define.*MINIUPNPC_API_VERSION.*1[4-9]' /usr/include/miniupnpc/miniupnpc.h; then
    %__sed -i '/upnpDiscover/s/&error/2, &/' src/net.cpp
fi

%build
./autogen.sh
export CFLAGS=-fPIC CXXFLAGS=-fPIC
%configure --enable-tests=no --with-gui=no --with-qrcode=yes --with-incompatible-bdb
%__make %{?_smp_mflags}

%install
%__make DESTDIR="%{buildroot}" install
%if 0%{?suse_version} > 0
%__install -m 0755 "%{S:2}" "%{buildroot}%{_bindir}"
%__install -dm 755 "%{buildroot}%{_sysconfdir}/apparmor.d"
%__install -m 644 "%{S:3}" "%{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.%{name}d-safe"
%endif
rm -rf "%{buildroot}"/usr/include "%{buildroot}"/usr/lib*

%if 0%{?suse_version} > 0
#%%suse_update_desktop_file -i %{name}
%else
#%__install -dm 755 "%{buildroot}%{_datadir}/applications/"
#%__install -m 644 "%{S:1}" "%{buildroot}%{_datadir}/applications/"
%endif
#%__install -dm 755 "%{buildroot}%{_datadir}/pixmaps/"
#%__install -m 644 src/qt/res/icons/bitcoin.png "%{buildroot}%{_datadir}/pixmaps/%{name}.png"

%__debug_install_post

%files
%defattr(-,root,root,-)
%doc COPYING doc/README.md doc/tor.md
%{_bindir}/%{name}d
%{_bindir}/%{name}-cli
%{_bindir}/%{name}-tx
%if 0%{?suse_version} > 0
%{_bindir}/%{name}d-safe
%config %{_sysconfdir}/apparmor.d/usr.bin.%{name}d-safe
%endif

#%%files gui
#%defattr(-,root,root,-)
#%doc COPYING README.md
#%{_bindir}/%{name}
#%{_datadir}/applications/%{name}.desktop
#%{_datadir}/pixmaps/%{name}.png

%changelog