[packages/thin-provisioning-tools] - updated to 1.0.6 (now whole rewritten in rust)

qboosh qboosh at pld-linux.org
Sun Sep 17 21:51:28 CEST 2023


commit 3ec88b2ba181149d1a147fd6aa3469a70ffc1b39
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Sep 17 21:42:59 2023 +0200

    - updated to 1.0.6 (now whole rewritten in rust)

 thin-provisioning-tools-sh.patch | 15 --------
 thin-provisioning-tools.spec     | 80 ++++++++++++++++++----------------------
 2 files changed, 35 insertions(+), 60 deletions(-)
---
diff --git a/thin-provisioning-tools.spec b/thin-provisioning-tools.spec
index b3d2643..07b4c69 100644
--- a/thin-provisioning-tools.spec
+++ b/thin-provisioning-tools.spec
@@ -1,33 +1,24 @@
-# TODO: finish rust tools (vendor crates; crc32c crate seems x86_64 only?)
-#
-# Conditional build:
-%bcond_with	rust	# rust based tools (thin_metadata_{pack,unpack})
-
 Summary:	Tools for manipulating dm-thin device-mapper target metadata
 Summary(pl.UTF-8):	Narzędzia do modyfikowania metadanych celów dm-thin device-mappera
 Name:		thin-provisioning-tools
-Version:	0.9.0
-Release:	2
+Version:	1.0.6
+Release:	1
 License:	GPL v3+
 Group:		Applications/System
 #Source0Download: https://github.com/jthornber/thin-provisioning-tools/releases
 Source0:	https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	b3ce6f476a5b7ea64c583e7d910d2db7
-Patch0:		%{name}-sh.patch
+# Source0-md5:	c93f56d938c8c11cf8ed3e34973c5125
+# cargo vendor && cd .. && tar cJf thin-provisioning-tools-1.0.6-vendor.tar.xz thin-provisioning-tools-1.0.6/vendor thin-provisioning-tools-1.0.6/Cargo.lock
+Source1:	%{name}-%{version}-vendor.tar.xz
+# Source1-md5:	88c6b926e0bc601db5b61ddf0f9f2846
 URL:		https://github.com/jthornber/thin-provisioning-tools
-BuildRequires:	autoconf >= 2.61
-# for fresh config.sub
-BuildRequires:	automake
-BuildRequires:	boost-devel
+BuildRequires:	cargo
 BuildRequires:	expat-devel >= 1.95
-BuildRequires:	gcc-c++ >= 6:4.0
-BuildRequires:	libaio-devel
 BuildRequires:	libstdc++-devel >= 6:4.0
-%if %{with rust}
-BuildRequires:	cargo
+BuildRequires:	rpmbuild(macros) >= 2.004
 BuildRequires:	rust
-%endif
 Obsoletes:	device-mapper-persistent-data
+ExclusiveArch:	%{rust_arches}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -39,43 +30,44 @@ Zestaw narzędzi do modyfikowania metadanych celów dm-thin
 device-mappera.
 
 %prep
-%setup -q
-%patch0 -p1
+%setup -q -b1
 
-%build
-cp -f /usr/share/automake/config.sub autoconf
-%{__autoconf}
-%configure \
-	--with-optimisation=" "
+export CARGO_HOME="$(pwd)/.cargo"
+
+mkdir -p "$CARGO_HOME"
+cat >.cargo/config <<EOF
+[source.crates-io]
+replace-with = "vendored-sources"
 
-%{__make} \
-	CFLAGS="%{rpmcflags} %{rpmcppflags}" \
-	CXXFLAGS="%{rpmcxxflags} %{rpmcppflags} -DSTRERROR_R_CHAR_P -std=c++11" \
-	LDFLAGS="%{rpmldflags}" \
-	V=
+[source."git+https://github.com/jthornber/rio?branch=master"]
+git = "https://github.com/jthornber/rio"
+branch = "master"
+replace-with = "vendored-sources"
 
-%if %{with rust}
-%{__make} rust-tools
-%endif
+[source.vendored-sources]
+directory = "vendor"
+EOF
+
+%build
+export CARGO_HOME="$(pwd)/.cargo"
+
+%cargo_build --frozen
 
 %install
 rm -rf $RPM_BUILD_ROOT
+export CARGO_HOME="$(pwd)/.cargo"
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT \
+	PDATA_TOOLS=%{cargo_targetdir}/%{rust_target}/release/pdata_tools \
 	STRIP=:
 
-%if %{with rust}
-%{__make} install-rust-tools \
-	DESTDIR=$RPM_BUILD_ROOT
-%endif
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGES README.md TODO.org
+%doc CHANGES README.md doc/TODO.md
 %attr(755,root,root) %{_sbindir}/cache_check
 %attr(755,root,root) %{_sbindir}/cache_dump
 %attr(755,root,root) %{_sbindir}/cache_metadata_size
@@ -91,7 +83,9 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_sbindir}/thin_delta
 %attr(755,root,root) %{_sbindir}/thin_dump
 %attr(755,root,root) %{_sbindir}/thin_ls
+%attr(755,root,root) %{_sbindir}/thin_metadata_pack
 %attr(755,root,root) %{_sbindir}/thin_metadata_size
+%attr(755,root,root) %{_sbindir}/thin_metadata_unpack
 %attr(755,root,root) %{_sbindir}/thin_repair
 %attr(755,root,root) %{_sbindir}/thin_restore
 %attr(755,root,root) %{_sbindir}/thin_rmap
@@ -110,14 +104,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/thin_delta.8*
 %{_mandir}/man8/thin_dump.8*
 %{_mandir}/man8/thin_ls.8*
+%{_mandir}/man8/thin_metadata_pack.8*
 %{_mandir}/man8/thin_metadata_size.8*
+%{_mandir}/man8/thin_metadata_unpack.8*
 %{_mandir}/man8/thin_repair.8*
 %{_mandir}/man8/thin_restore.8*
 %{_mandir}/man8/thin_rmap.8*
 %{_mandir}/man8/thin_trim.8*
-%if %{with rust}
-%attr(755,root,root) %{_sbindir}/thin_metadata_pack
-%attr(755,root,root) %{_sbindir}/thin_metadata_unpack
-%{_mandir}/man8/thin_metadata_pack.8*
-%{_mandir}/man8/thin_metadata_unpack.8*
-%endif
diff --git a/thin-provisioning-tools-sh.patch b/thin-provisioning-tools-sh.patch
deleted file mode 100644
index b0e5c21..0000000
--- a/thin-provisioning-tools-sh.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- thin-provisioning-tools-0.6.1/configure.ac.orig	2016-02-10 15:28:49.000000000 +0100
-+++ thin-provisioning-tools-0.6.1/configure.ac	2016-04-05 21:39:11.502032549 +0200
-@@ -49,10 +49,10 @@
- dnl -- Check for large file support
- AC_SYS_LARGEFILE
- if test x$ac_cv_sys_file_offset_bits = x64; then
--    LFS_FLAGS+="-D_FILE_OFFSET_BITS=64"
-+    LFS_FLAGS="$LFS_FLAGS -D_FILE_OFFSET_BITS=64"
- fi
- if test x$ac_cv_sys_large_files = x1; then
--    LFS_FLAGS+="-D_LARGE_FILES"
-+    LFS_FLAGS="$LFS_FLAGS -D_LARGE_FILES"
- fi
- 
- ################################################################
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/thin-provisioning-tools.git/commitdiff/3ec88b2ba181149d1a147fd6aa3469a70ffc1b39



More information about the pld-cvs-commit mailing list