Accepting request 344020 from network

- Refactor spec to allow for easy building of altcoins.
  * drop bitcoin-fix-desktop-icon-name.patch

OBS-URL: https://build.opensuse.org/request/show/344020
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bitcoin?expand=0&rev=9
This commit is contained in:
Dominique Leuenberger 2015-11-12 18:41:48 +00:00 committed by Git OBS Bridge
parent eb9846c166
commit 072893e82d
3 changed files with 101 additions and 77 deletions

View File

@ -1,12 +0,0 @@
Index: bitcoin-0.11.0/contrib/debian/bitcoin-qt.desktop
===================================================================
--- bitcoin-0.11.0.orig/contrib/debian/bitcoin-qt.desktop
+++ bitcoin-0.11.0/contrib/debian/bitcoin-qt.desktop
@@ -7,6 +7,6 @@ Comment[tr]=Bitcoin, eşten eşe kriptog
Exec=bitcoin-qt %u
Terminal=false
Type=Application
-Icon=bitcoin128
+Icon=bitcoin
MimeType=x-scheme-handler/bitcoin;
Categories=Office;Finance;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Nov 12 02:32:41 UTC 2015 - jimmy@boombatower.com
- Refactor spec to allow for easy building of altcoins.
* drop bitcoin-fix-desktop-icon-name.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Oct 31 09:43:55 UTC 2015 - mpluskal@suse.com Sat Oct 31 09:43:55 UTC 2015 - mpluskal@suse.com

View File

@ -17,20 +17,25 @@
# #
# typical altcoin changes: name, name_pretty, consensus 0, is_base 0
%define base bitcoin
%define base_pretty Bitcoin
%define name_pretty %{base_pretty}
%define consensus 1
%define is_base 1
Name: bitcoin Name: bitcoin
Version: 0.11.1 Version: 0.11.1
Release: 0 Release: 0
Summary: P2P Digital Currency Summary: P2P Digital Currency
License: MIT License: MIT
Group: Productivity/Networking/Other Group: Productivity/Networking/Other
Url: http://www.bitcoin.org Url: http://%{name}.org/
Source: https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz Source0: https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz
Source1: bitcoind.service Source1: %{base}d.service
Source2: bitcoind.firewall Source2: %{base}d.firewall
Source3: bitcoind.conf Source3: %{base}d.conf
# PATCH-FIX-OPENSUSE bitcoin-fix-desktop-icon-name.patch prusnak@opensuse.org -- Rename icon in desktop file to remove size reference. Patch1: %{base}_missing_ppc64le_in_ax_boost_base.m4.patch
Patch0: bitcoin-fix-desktop-icon-name.patch
Patch1: bitcoin_missing_ppc64le_in_ax_boost_base.m4.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: boost-devel BuildRequires: boost-devel
@ -56,81 +61,84 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires} %{?systemd_requires}
%description %description
Bitcoin 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. %{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. Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.
%package qt5 %package qt5
Summary: An end-user Qt5 GUI for the Bitcoin crypto-currency Summary: An end-user Qt5 GUI for the %{name_pretty} crypto-currency
Group: Development/Libraries/Other Group: Development/Libraries/Other
Provides: %{name} = %{version} Provides: %{name} = %{version}
Obsoletes: %{name} < %{version} Obsoletes: %{name} < %{version}
%description qt5 %description qt5
Bitcoin 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. %{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. Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.
This package provides Bitcoin-Qt, a GUI for Bitcoin based on Qt. This package provides %{name_pretty}-Qt, a GUI for %{name_pretty} based on Qt.
%package utils %package utils
Summary: An end-user cli for the Bitcoin crypto-currency Summary: An end-user cli for the %{name_pretty} crypto-currency
Group: Productivity/Networking/Other Group: Productivity/Networking/Other
Provides: %{name}-cli = %{version} Provides: %{name}-cli = %{version}
Obsoletes: %{name}-cli < %{version} Obsoletes: %{name}-cli < %{version}
%description utils %description utils
Bitcoin 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. %{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. Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.
This package provides bitcoin-cli - CLI tool to interact with the daemon. This package provides %{name}-cli - CLI tool to interact with the daemon.
%if %{consensus} == 1
%package -n lib%{name}consensus0 %package -n lib%{name}consensus0
Summary: Bitcoin consensus library Summary: %{name_pretty} consensus library
Group: System/Library Group: System/Library
%description -n lib%{name}consensus0 %description -n lib%{name}consensus0
The purpose of this library is to make the verification functionality that is critical to Bitcoins consensus available to other applications, e.g. to language bindings such as python-bitcoinlib or alternative node implementations. 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 %package -n lib%{name}consensus-devel
Summary: Developmont files for bitcoin consensus library Summary: Developmont files for %{name} consensus library
Group: Development/Languages/C and C++ Group: Development/Languages/C and C++
Requires: lib%{name}consensus0 = %{version} Requires: lib%{name}consensus0 = %{version}
%description -n lib%{name}consensus-devel %description -n lib%{name}consensus-devel
The purpose of this library is to make the verification functionality that is critical to Bitcoins consensus available to other applications, e.g. to language bindings such as python-bitcoinlib or alternative node implementations. 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. This package contains development files.
%endif
%package -n bitcoind %package -n %{name}d
Summary: Headless daemon for Bitcoin crypto-currency Summary: Headless daemon for %{name_pretty} crypto-currency
Group: Development/Libraries/Other Group: Development/Libraries/Other
Requires(pre): shadow
%description -n bitcoind %description -n %{name}d
Bitcoin 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. %{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. Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.
This package provides bitcoind, headless bitcoin daemon. This package provides %{name}d, headless %{name} daemon.
%package test %package test
Summary: Automated tests for bitcoin client Summary: Automated tests for %{name} client
Group: Development/Libraries/Other Group: Development/Libraries/Other
%description test %description test
Bitcoin 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. %{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. Full transaction history is stored locally at each client. This requires several GB of space, slowly growing.
This package provides automated tests for bitcoin-qt5 and bitcoind. This package provides automated tests for %{name}-qt5 and %{name}d.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 -p1 %patch1 -p1
# remove 128 resolution from Icon= line
sed -i s/128// contrib/debian/%{name}-qt.desktop
%build %build
autoreconf -fiv autoreconf -fiv
export CXXFLAGS="$CXXFLAGS %{optflags} -fPIC" export CXXFLAGS="$CXXFLAGS %{optflags} -fPIC"
@ -141,6 +149,9 @@ export CFLAGS="$CFLAGS %{optflags} -fPIC"
--with-gui=qt5 \ --with-gui=qt5 \
--with-miniupnpc \ --with-miniupnpc \
--with-qrencode \ --with-qrencode \
%if %{consensus} == 0
--without-libs \
%endif
--disable-hardening --disable-hardening
make %{?_smp_mflags} V=1 make %{?_smp_mflags} V=1
@ -151,25 +162,40 @@ make %{?_smp_mflags} check
%install %install
make DESTDIR=%{buildroot} install %{?_smp_mflags} make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -D -m 0644 share/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/%{name}.png install -D -m 0644 share/pixmaps/%{base}256.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -m 0644 contrib/debian/bitcoin-qt.desktop %{buildroot}%{_datadir}/applications/%{name}-qt.desktop 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 %suse_update_desktop_file %{buildroot}%{_datadir}/applications/%{name}-qt.desktop
install -D -m 0644 contrib/debian/manpages/bitcoind.1 %{buildroot}%{_mandir}/man1/bitcoind.1
install -D -m 0644 contrib/debian/manpages/bitcoin-qt.1 %{buildroot}%{_mandir}/man1/bitcoin-qt.1 install -D -m 0644 contrib/debian/manpages/%{name}d.1 %{buildroot}%{_mandir}/man1/%{name}d.1
install -D -m 0644 contrib/debian/manpages/bitcoin.conf.5 %{buildroot}%{_mandir}/man5/bitcoin.conf.5 install -D -m 0644 contrib/debian/manpages/%{name}-qt.1 %{buildroot}%{_mandir}/man1/%{name}-qt.1
install -D -m 0644 contrib/debian/examples/bitcoin.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf 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} mkdir -p %{buildroot}/%{_localstatedir}/lib/%{name}
install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/bitcoind install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}d
mkdir %{buildroot}%{_sbindir}
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rcbitcoind
install -D -m 0644 $RPM_SOURCE_DIR/bitcoind.service %{buildroot}/%{_unitdir}/bitcoind.service
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}/
install -m 0644 %{SOURCE3} %{buildroot}/%{_tmpfilesdir}/bitcoind.conf
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 # do not ship these
rm -rf %{buildroot}%{_libdir}/libbitcoinconsensus.a rm -rf %{buildroot}%{_libdir}/lib%{name}consensus.a
rm -rf %{buildroot}%{_libdir}/libbitcoinconsensus.la rm -rf %{buildroot}%{_libdir}/lib%{name}consensus.la
%endif
%post qt5 %post qt5
%desktop_database_post %desktop_database_post
@ -177,35 +203,37 @@ rm -rf %{buildroot}%{_libdir}/libbitcoinconsensus.la
%postun qt5 %postun qt5
%desktop_database_postun %desktop_database_postun
%pre -n bitcoind %pre -n %{name}d
getent group %{name} >/dev/null || groupadd -r %{name} 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 "Bitcoin daemon" %{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 bitcoind.service %service_add_pre %{name}d.service
%post -n bitcoind %post -n %{name}d
%service_add_post bitcoind.service %service_add_post %{name}d.service
%if 0%{?suse_version} <= 1320 %if 0%{?suse_version} <= 1320
systemd-tmpfiles --create %{_tmpfilesdir}/bitcoind.conf >/dev/null 2>&1 || : systemd-tmpfiles --create %{_tmpfilesdir}/%{name}d.conf >/dev/null 2>&1 || :
%else %else
%tmpfiles_create %{_tmpfilesdir}/bitcoind.conf %tmpfiles_create %{_tmpfilesdir}/%{name}d.conf
%endif %endif
%preun -n bitcoind %preun -n %{name}d
%service_del_preun bitcoind.service %service_del_preun %{name}d.service
%postun -n bitcoind %postun -n %{name}d
%service_del_postun bitcoind.service %service_del_postun %{name}d.service
%if %{consensus} == 1
%post -n lib%{name}consensus0 -p /sbin/ldconfig %post -n lib%{name}consensus0 -p /sbin/ldconfig
%postun -n lib%{name}consensus0 -p /sbin/ldconfig %postun -n lib%{name}consensus0 -p /sbin/ldconfig
%endif
%files qt5 %files qt5
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING README.md %doc COPYING README.md
%{_bindir}/bitcoin-qt %{_bindir}/%{name}-qt
%{_datadir}/applications/%{name}-qt.desktop %{_datadir}/applications/%{name}-qt.desktop
%{_mandir}/man1/bitcoin-qt.1%{?ext_man} %{_mandir}/man1/%{name}-qt.1%{?ext_man}
%{_datadir}/pixmaps/%{name}.png %{_datadir}/pixmaps/%{name}.png
%files utils %files utils
@ -214,6 +242,7 @@ systemd-tmpfiles --create %{_tmpfilesdir}/bitcoind.conf >/dev/null 2>&1 || :
%{_bindir}/%{name}-cli %{_bindir}/%{name}-cli
%{_bindir}/%{name}-tx %{_bindir}/%{name}-tx
%if %{consensus} == 1
%files -n lib%{name}consensus0 %files -n lib%{name}consensus0
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING README.md %doc COPYING README.md
@ -225,25 +254,26 @@ systemd-tmpfiles --create %{_tmpfilesdir}/bitcoind.conf >/dev/null 2>&1 || :
%{_libdir}/lib%{name}consensus.so %{_libdir}/lib%{name}consensus.so
%{_includedir}/%{name}consensus.h %{_includedir}/%{name}consensus.h
%{_libdir}/pkgconfig/lib%{name}consensus.pc %{_libdir}/pkgconfig/lib%{name}consensus.pc
%endif
%files -n bitcoind %files -n %{name}d
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING README.md %doc COPYING README.md
%{_mandir}/man1/bitcoind.1%{?ext_man} %{_mandir}/man1/%{name}d.1%{?ext_man}
%{_mandir}/man5/%{name}.conf.5%{?ext_man} %{_mandir}/man5/%{name}.conf.5%{?ext_man}
%{_bindir}/bitcoind %{_bindir}/%{name}d
%dir %attr(700,%{name},%{name}) %{_var}/lib/%{name} %dir %attr(700,%{name},%{name}) %{_var}/lib/%{name}
%dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/bitcoind %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}d
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%{_unitdir}/bitcoind.service %{_unitdir}/%{name}d.service
%{_sbindir}/rcbitcoind %{_sbindir}/rc%{name}d
%{_tmpfilesdir}/bitcoind.conf %{_tmpfilesdir}/%{name}d.conf
%files test %files test
%defattr(-,root,root) %defattr(-,root,root)
%doc COPYING README.md %doc COPYING README.md
%{_bindir}/test_bitcoin %{_bindir}/test_%{name}
%{_bindir}/test_bitcoin-qt %{_bindir}/test_%{name}-qt
%changelog %changelog