[packages/libbitcoin] - fixed build, finished packaging

qboosh qboosh at pld-linux.org
Sun Feb 11 10:17:59 CET 2024


commit a28676e536386988eae2a548ec6eb0e2ff45cb02
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 11 09:07:28 2024 +0100

    - fixed build, finished packaging

 libbitcoin-boost.patch |  98 ++++++++++++++++++++++++++++++
 libbitcoin.spec        | 157 +++++++++++++++++--------------------------------
 2 files changed, 152 insertions(+), 103 deletions(-)
---
diff --git a/libbitcoin.spec b/libbitcoin.spec
index 34e3a56..eb245c5 100644
--- a/libbitcoin.spec
+++ b/libbitcoin.spec
@@ -1,115 +1,81 @@
 #
 # Conditional build:
-%bcond_without	apidocs		# do not build and package API docs
-%bcond_without	static_libs	# don't build static libraries
+%bcond_without	static_libs	# static library
 #
 Summary:	Bitcoin Cross-Platform C++ Development Toolkit 
-# Summary(pl.UTF-8):	-
+Summary(pl.UTF-8):	Wieloplatformowy toolkit C++ do programowania związanego z bitcoinami
 Name:		libbitcoin
 Version:	3.3.0
-Release:	0.1
+Release:	1
 License:	AGPL with a lesser clause
 Group:		Libraries
-Source0:	https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz
+#Source0Download: https://github.com/libbitcoin/libbitcoin-system/releases
+#Source0:	https://github.com/libbitcoin/libbitcoin-system/archive/v%{version}/%{name}-%{version}.tar.gz
+Source0:	https://github.com/libbitcoin/libbitcoin/archive/v%{version}.tar.gz
 # Source0-md5:	04af8f20cf05a4f2ae4edbb3211f520c
-#Patch0:	%{name}-what.patch
-URL:		https://libbitcoin.org/
-BuildRequires:	libsecp256k1-devel
-BuildRequires:	boost-devel
-#BuildRequires:	autoconf
-#BuildRequires:	automake
-#BuildRequires:	intltool
-#BuildRequires:	libtool
-#Requires(postun):	-
-#Requires(pre,post):	-
-#Requires(preun):	-
-#Requires:	-
-#Provides:	-
-#Obsoletes:	-
-#Conflicts:	-
+Patch0:		%{name}-boost.patch
+URL:		https://libbitcoin.info/
+BuildRequires:	autoconf >= 2.65
+BuildRequires:	automake
+# chrono date_time filesystem iostreams locale log program_options regex system thread unit_test_framework
+BuildRequires:	boost-devel >= 1.57.0
+BuildRequires:	libpng-devel >= 2:1.6.29
+BuildRequires:	libsecp256k1-devel >= 0.0.1
+BuildRequires:	libstdc++-devel >= 6:4.7
+BuildRequires:	libtool
+BuildRequires:	pkgconfig
+BuildRequires:	qrencode-devel >= 3.4.4
+Requires:	libpng >= 2:1.6.29
+Requires:	libsecp256k1 >= 0.0.1
+Requires:	qrencode-libs >= 3.4.4
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-# do not keep them in newly created specs
-# these are only here to help fixing quickly broken specs
-# %%define		filterout_ld	-Wl,--no-copy-dt-needed-entries
-# %%define		filterout_ld	-Wl,--as-needed
-# do not commit spec containing this (use for local testing only):
-# %%define		filterout_c	-Werror=format-security
-# %%define		filterout_cxx	-Werror=format-security
-
-# Ignore file in __spec_install_post_check_so
-BuildRequires:	rpmbuild(macros) >= 1.583
-%define		skip_post_check_so	libunresolved.so.*
-
-# do not commit spec containing this (use for local testing only):
-%define		no_install_post_check_tmpfiles	1
-
 %description
 Bitcoin Cross-Platform C++ Development Toolkit 
 
-#%description -l pl.UTF-8
-
-%package common
-Summary:	Common files for %{name} library
-Summary(pl.UTF-8):	Wspólne pliki biblioteki %{name}
-Group:		Libraries
-Requires:	%{name} = %{version}-%{release}
-
-%description common
-Common files for %{name} library.
-
-%description common -l pl.UTF-8
-Wspólne pliki biblioteki %{name}.
+%description -l pl.UTF-8
+Wieloplatformowy toolkit C++ do programowania związanego z bitcoinami.
 
 %package devel
-Summary:	Header files for %{name} library
-Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki %{name}
+Summary:	Header files for libbitcoin library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki libbitcoin
 Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
+Requires:	boost-devel >= 1.57.0
+Requires:	libpng-devel >= 2:1.6.29
+Requires:	libsecp256k1-devel >= 0.0.1
+Requires:	libstdc++-devel >= 6:4.7
+Requires:	qrencode-devel >= 3.4.4
 
 %description devel
-Header files for %{name} library.
+Header files for libbitcoin library.
 
 %description devel -l pl.UTF-8
-Pliki nagłówkowe biblioteki %{name}.
+Pliki nagłówkowe biblioteki libbitcoin.
 
 %package static
-Summary:	Static %{name} library
-Summary(pl.UTF-8):	Statyczna biblioteka %{name}
+Summary:	Static libbitcoin library
+Summary(pl.UTF-8):	Statyczna biblioteka libbitcoin
 Group:		Development/Libraries
 Requires:	%{name}-devel = %{version}-%{release}
 
 %description static
-Static %{name} library.
+Static libbitcoin library.
 
 %description static -l pl.UTF-8
-Statyczna biblioteka %{name}.
-
-%package apidocs
-Summary:	%{name} API documentation
-Summary(pl.UTF-8):	Dokumentacja API biblioteki %{name}
-Group:		Documentation
-
-%description apidocs
-API documentation for %{name} library.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API biblioteki %{name}.
+Statyczna biblioteka libbitcoin.
 
 %prep
 %setup -q
-#%patch0 -p1
+%patch0 -p1
 
 %build
-./autogen.sh
-# if ac/am/lt/* rebuilding is necessary, do it in this order and add
-# appropriate BuildRequires
-#%{__libtoolize}
-#%{__aclocal}
-#%{__autoconf}
-#%{__autoheader}
-#%{__automake}
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__automake}
 %configure \
+	--disable-silent-rules \
 	%{!?with_static_libs:--disable-static} \
 	--with-png \
 	--with-qrencode
@@ -117,15 +83,14 @@ Dokumentacja API biblioteki %{name}.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-# create directories if necessary
-#install -d $RPM_BUILD_ROOT
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-# if library provides pkgconfig file containing proper {Requires,Libs}.private
-# then remove .la pollution
-#%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libbitcoin.la
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/libbitcoin
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -135,33 +100,19 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS CREDITS README THANKS
-%attr(755,root,root) %{_libdir}/%{name}.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/%{name}.so.N
-
-%files common
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/%{name}*
-%{_datadir}/%{name}
+# COPYING contains AGPL v3 with additional exception
+%doc AUTHORS COPYING README.md
+%attr(755,root,root) %{_libdir}/libbitcoin.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libbitcoin.so.0
 
 %files devel
 %defattr(644,root,root,755)
-%doc devel-doc/* ChangeLog NEWS TODO
-%attr(755,root,root) %{_libdir}/%{name}.so
-# if no pkgconfig support, or it misses .private deps, then include .la file
-#%{_libdir}/libFOO.la
-%{_includedir}/%{name}
-%{_aclocaldir}/%{name}.m4
-%{_pkgconfigdir}/%{name}.pc
+%attr(755,root,root) %{_libdir}/libbitcoin.so
+%{_includedir}/bitcoin
+%{_pkgconfigdir}/libbitcoin.pc
 
 %if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/%{name}.a
-%endif
-
-%if %{with apidocs}
-%files apidocs
-%defattr(644,root,root,755)
-%doc apidocs/*
+%{_libdir}/libbitcoin.a
 %endif
diff --git a/libbitcoin-boost.patch b/libbitcoin-boost.patch
new file mode 100644
index 0000000..b93f878
--- /dev/null
+++ b/libbitcoin-boost.patch
@@ -0,0 +1,98 @@
+--- libbitcoin-3.3.0/include/bitcoin/bitcoin/log/file_collector.hpp.orig	2017-08-11 08:35:33.000000000 +0200
++++ libbitcoin-3.3.0/include/bitcoin/bitcoin/log/file_collector.hpp	2024-02-10 21:10:24.459486079 +0100
+@@ -67,9 +67,12 @@ public:
+     //! The function stores the specified file in the storage
+     void store_file(boost::filesystem::path const& src_path) override;
+ 
++    //! The function checks if the specified path refers to an existing file in the storage
++    bool is_in_storage(boost::filesystem::path const& src_path) const override;
++
+     //! Scans the target directory for the files that have already been stored
+-    uintmax_t scan_for_files(boost::log::sinks::file::scan_method method,
+-        boost::filesystem::path const& pattern, unsigned int* counter) override;
++    boost::log::sinks::file::scan_result scan_for_files(boost::log::sinks::file::scan_method method,
++        boost::filesystem::path const& pattern = boost::filesystem::path()) override;
+ 
+     //! The function updates storage restrictions
+     void update(size_t max_size, size_t min_free_space, size_t max_files);
+--- libbitcoin-3.3.0/src/log/file_collector.cpp.orig	2017-08-11 08:35:33.000000000 +0200
++++ libbitcoin-3.3.0/src/log/file_collector.cpp	2024-02-10 21:11:23.262500849 +0100
+@@ -355,12 +355,18 @@ void file_collector::store_file(filesyst
+     total_size_ += info.size;
+ }
+ 
++//! The function checks if the specified path refers to an existing file in the storage
++bool file_collector::is_in_storage(boost::filesystem::path const& src_path) const
++{
++    return is_governed(src_path);
++}
+ 
+ //! Scans the target directory for the files that have already been stored
+-uintmax_t file_collector::scan_for_files(
++boost::log::sinks::file::scan_result file_collector::scan_for_files(
+     boost::log::sinks::file::scan_method method,
+-    filesystem::path const& pattern, unsigned int* counter)
++    filesystem::path const& pattern)
+ {
++    boost::log::sinks::file::scan_result result;
+     uintmax_t file_count = 0;
+     if (method != boost::log::sinks::file::no_scan)
+     {
+@@ -372,17 +378,12 @@ uintmax_t file_collector::scan_for_files
+             if (pattern.has_parent_path())
+                 dir = make_absolute(pattern.parent_path());
+         }
+-        else
+-        {
+-            counter = NULL;
+-        }
+ 
+         if (filesystem::exists(dir) && filesystem::is_directory(dir))
+         {
+             BOOST_LOG_EXPR_IF_MT(boost::lock_guard<boost::mutex> lock(mutex_);)
+ 
+-            if (counter)
+-                *counter = 0;
++            result.last_file_counter = 0;
+ 
+             file_list files;
+             filesystem::directory_iterator it(dir), end;
+@@ -414,10 +415,10 @@ uintmax_t file_collector::scan_for_files
+                             total_size += info.size;
+                             info.timestamp = filesystem::last_write_time(info.path);
+                             files.push_back(info);
+-                            ++file_count;
++                            ++result.found_count;
+ 
+-                            if (counter && file_number >= *counter)
+-                                *counter = file_number + 1;
++                            if (result.last_file_counter && file_number >= *result.last_file_counter)
++                                result.last_file_counter = file_number + 1;
+                         }
+                     }
+                 }
+@@ -430,7 +431,7 @@ uintmax_t file_collector::scan_for_files
+         }
+     }
+ 
+-    return file_count;
++    return result;
+ }
+ 
+ 
+--- libbitcoin-3.3.0/include/bitcoin/bitcoin/unicode/file_lock.hpp.orig	2017-08-11 08:35:33.000000000 +0200
++++ libbitcoin-3.3.0/include/bitcoin/bitcoin/unicode/file_lock.hpp	2024-02-10 21:46:50.430976988 +0100
+@@ -14,12 +14,12 @@
+ #define LIBBITCOIN_INTERPROCESS_FILE_LOCK_HPP
+ 
+ #include <string>
++#include <boost/date_time/posix_time/posix_time_types.hpp>
+ #include <boost/interprocess/detail/config_begin.hpp>
+ #include <boost/interprocess/detail/workaround.hpp>
+ #include <boost/interprocess/exceptions.hpp>
+ #include <boost/interprocess/detail/os_file_functions.hpp>
+ #include <boost/interprocess/detail/os_thread_functions.hpp>
+-#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
+ #include <boost/interprocess/sync/detail/common_algorithms.hpp>
+ #include <boost/interprocess/sync/detail/locks.hpp>
+ #include <boost/move/move.hpp>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libbitcoin.git/commitdiff/a28676e536386988eae2a548ec6eb0e2ff45cb02



More information about the pld-cvs-commit mailing list