A new user interface for you! Read more...

File dogecoin.spec of Package dogecoin

#
# spec file for package dogecoin
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 Jimmy Berry <jimmy@boombatower.com>
#
# 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/
#


# typical altcoin changes: name, name_pretty, consensus 0, is_base 0
%define base bitcoin
%define base_pretty Bitcoin
%define name_pretty Dogecoin
%define consensus 0
%define is_base 0
%if 0%{?suse_version} > 1320
%define qt_version qt5
%else
%define qt_version qt4
%endif

Name:           dogecoin
Version:        1.10.0
Release:        0
Summary:        P2P Digital Currency
License:        MIT
Group:          Productivity/Networking/Other
Url:            http://%{name}.com/
Source0:        %{name}-v%{version}.tar.xz
Source1:        %{base}d.service
Source2:        %{base}d.firewall
Source3:        %{base}d.conf
Patch1:         %{base}_missing_ppc64le_in_ax_boost_base.m4.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  boost-devel >= 1.53
BuildRequires:  gcc-c++
BuildRequires:  git
BuildRequires:  lcov
BuildRequires:  libdb-5_1-devel
BuildRequires:  libminiupnpc-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  python
BuildRequires:  systemd-rpm-macros
BuildRequires:  update-desktop-files
BuildRequires:  yasm-devel
BuildRequires:  pkgconfig(libqrencode)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(protobuf)
Requires(post): update-desktop-files
Requires(postun): update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExcludeArch:    ppc64 ppc
%{?systemd_requires}
%if 0%{?suse_version} > 1320
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qttools-devel
%else
BuildRequires:  libqt4-devel
%endif

%description
%{name_pretty} is like %{base_pretty}, but based on Litecoin, and also much more wow.

%{name_pretty} is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending.

Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.

%package %{qt_version}
Summary:        An end-user %{qt_version} GUI for the %{name_pretty} crypto-currency
Group:          Development/Libraries/Other
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}
%if 0%{?suse_version} > 1320
Obsoletes:      %{name}-qt4
%endif

%description %{qt_version}
%{name_pretty} is like %{base_pretty}, but based on Litecoin, and also much more wow.

%{name_pretty} is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending.

Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.

This package provides %{name_pretty}-%{qt_version}, a GUI for %{name_pretty} based on Qt.

%package utils
Summary:        An end-user cli for the %{name_pretty} crypto-currency
Group:          Productivity/Networking/Other
Provides:       %{name}-cli = %{version}
Obsoletes:      %{name}-cli < %{version}

%description utils
%{name_pretty} is like %{base_pretty}, but based on Litecoin, and also much more wow.

%{name_pretty} is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending.

Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.

This package provides %{name}-cli - CLI tool to interact with the daemon.

%if %{consensus} == 1
%package -n lib%{name}consensus0
Summary:        %{name_pretty} consensus library
Group:          System/Library

%description -n lib%{name}consensus0
The purpose of this library is to make the verification functionality that is critical to %{name_pretty}’s consensus available to other applications, e.g. to language bindings such as python-%{name}lib or alternative node implementations.

%package -n lib%{name}consensus-devel
Summary:        Developmont files for %{name} consensus library
Group:          Development/Languages/C and C++
Requires:       lib%{name}consensus0 = %{version}

%description -n lib%{name}consensus-devel
The purpose of this library is to make the verification functionality that is critical to %{name_pretty}’s consensus available to other applications, e.g. to language bindings such as python-%{name}lib or alternative node implementations.

This package contains development files.
%endif

%package -n %{name}d
Summary:        Headless daemon for %{name_pretty} crypto-currency
Group:          Development/Libraries/Other

%description -n %{name}d
%{name_pretty} is like %{base_pretty}, but based on Litecoin, and also much more wow.

%{name_pretty} is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending.

Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.

This package provides %{name}d, headless %{name} daemon.

%package test
Summary:        Automated tests for %{name} client
Group:          Development/Libraries/Other

%description test
%{name_pretty} is like %{base_pretty}, but based on Litecoin, and also much more wow.

%{name_pretty} is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending.

Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.

This package provides automated tests for %{name}-%{qt_version} and %{name}d.

%prep
%setup -q -n %{name}-v%{version}
%patch1 -p1

# remove 128 resolution from Icon= line
sed -i s/128// contrib/debian/%{name}-qt.desktop

%build
autoreconf -fiv
%if 0%{?suse_version} > 1320
# qt5 is compiled with -fPIC so needs as well.
export CXXFLAGS="$CXXFLAGS %{optflags} -fPIC"
export CFLAGS="$CFLAGS %{optflags} -fPIC"
%endif
%configure \
  --with-cli=yes \
  --with-daemon=yes \
  --with-gui=%{qt_version} \
  --with-miniupnpc \
  --with-qrencode \
%if %{consensus} == 0
  --without-libs \
%endif
  --disable-hardening

make %{?_smp_mflags} V=1

%check
make %{?_smp_mflags} check

%install
%make_install

# For simplicity copy the files from the different directories in source tree
# and place them in working directory as desktop-file-install will pick up icon
# and such. Interestingly the original icon file names are kept (bitcoin*), but
# the image contents are as expected.
install -D -m 0644 share/pixmaps/%{base}256.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -m 0644 contrib/debian/%{name}-qt.desktop %{buildroot}%{_datadir}/applications/%{name}-qt.desktop
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/%{name}-qt.desktop

install -D -m 0644 contrib/debian/manpages/%{name}d.1 %{buildroot}%{_mandir}/man1/%{name}d.1
install -D -m 0644 contrib/debian/manpages/%{name}-qt.1 %{buildroot}%{_mandir}/man1/%{name}-qt.1
install -D -m 0644 contrib/debian/manpages/%{name}.conf.5 %{buildroot}%{_mandir}/man5/%{name}.conf.5
install -D -m 0644 contrib/debian/examples/%{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf

%if !%{is_base}
sed -i "s/%{base}/%{name}/g" %{SOURCE1}
sed -i "s/%{base}/%{name}/g" %{SOURCE2}
sed -i "s/%{base}/%{name}/g" %{SOURCE3}

sed -i "s/%{base_pretty}/%{name_pretty}/g" %{SOURCE1}
sed -i "s/%{base_pretty}/%{name_pretty}/g" %{SOURCE2}
sed -i "s/%{base_pretty}/%{name_pretty}/g" %{SOURCE3}
%endif

mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}
install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}d

mkdir %{buildroot}%{_sbindir}
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}d
install -D -m 0644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}d.service
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}/
install -m 0644 %{SOURCE3} %{buildroot}/%{_tmpfilesdir}/%{name}d.conf

%if %{consensus} == 1
# do not ship these
rm -f %{buildroot}%{_libdir}/lib%{name}consensus.a
rm -f %{buildroot}%{_libdir}/lib%{name}consensus.la
%endif

%post %{qt_version}
%desktop_database_post

%postun %{qt_version}
%desktop_database_postun

%if %{consensus} == 1
%post -n lib%{name}consensus0 -p /sbin/ldconfig

%postun -n lib%{name}consensus0  -p /sbin/ldconfig
%endif

%pre -n %{name}d
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "%{name_pretty} daemon" %{name}
%service_add_pre %{name}d.service

%post -n %{name}d
%service_add_post %{name}d.service
%if 0%{?suse_version} <= 1320
systemd-tmpfiles --create %{_tmpfilesdir}/%{name}d.conf >/dev/null 2>&1 || :
%else
%tmpfiles_create %{_tmpfilesdir}/%{name}d.conf
%endif

%preun -n %{name}d
%service_del_preun %{name}d.service

%postun -n %{name}d
%service_del_postun %{name}d.service

%files %{qt_version}
%defattr(-,root,root)
%doc COPYING README.md
%{_bindir}/%{name}-qt
%{_datadir}/applications/%{name}-qt.desktop
%{_mandir}/man1/%{name}-qt.1%{?ext_man}
%{_datadir}/pixmaps/%{name}.png

%files utils
%defattr(-,root,root)
%doc COPYING README.md
%{_bindir}/%{name}-cli
%{_bindir}/%{name}-tx

%if %{consensus} == 1
%files -n lib%{name}consensus0
%defattr(-,root,root)
%doc COPYING README.md
%{_libdir}/lib%{name}consensus.so.*

%files -n lib%{name}consensus-devel
%defattr(-,root,root)
%doc COPYING README.md
%{_libdir}/lib%{name}consensus.so
%{_includedir}/%{name}consensus.h
%{_libdir}/pkgconfig/lib%{name}consensus.pc
%endif

%files -n %{name}d
%defattr(-,root,root)
%doc COPYING README.md
%{_mandir}/man1/%{name}d.1%{?ext_man}
%{_mandir}/man5/%{name}.conf.5%{?ext_man}
%{_bindir}/%{name}d
%dir %attr(700,%{name},%{name}) %{_var}/lib/%{name}
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}d
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%{_unitdir}/%{name}d.service
%{_sbindir}/rc%{name}d
%{_tmpfilesdir}/%{name}d.conf

%files test
%defattr(-,root,root)
%doc COPYING README.md
%{_bindir}/test_%{name}
%{_bindir}/test_%{name}-qt

%changelog