Compare commits

...
Sign in to create a new pull request.

20 commits

Author SHA1 Message Date
Marian Csontos
010e823bf0 Update to version 1.3.1 2025-12-02 12:17:27 +01:00
Marian Csontos
af8fbf5a50 Update to version 1.3.0 2025-10-22 16:56:52 +02:00
Marian Csontos
6e75527416 Update to version 1.2.1 2025-09-04 16:09:00 +02:00
Fedora Release Engineering
f5a75df400 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 19:13:00 +00:00
Marian Csontos
f8b6ae0ff5 Fix tarball links 2025-06-26 13:53:30 +02:00
Marian Csontos
6eaa83f886 Update README 2025-06-16 15:20:46 +02:00
Marian Csontos
afa261551b Update README
Describe Cargo.toml patching.
And explain the notes to greater detail.
2025-06-11 15:23:22 +02:00
Fedora Release Engineering
cfc9435230 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 15:37:25 +00:00
Zbigniew Jędrzejewski-Szmek
42f0442c76 Rebuilt for the bin-sbin merge (2nd attempt)
https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin
2025-01-12 14:26:13 +01:00
Marian Csontos
a540c7b432 Update to version 1.1.0 2024-09-02 15:28:34 +02:00
Fedora Release Engineering
4bace50fd1 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 20:51:53 +00:00
Zbigniew Jędrzejewski-Szmek
d830fc9808 Rebuilt for the bin-sbin merge
https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin
2024-07-09 12:59:45 +02:00
Zbigniew Jędrzejewski-Szmek
226ede080b Fix build when %_bindir==%_sbindir
Preparation for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin.
%install was putting files in the wrong directory.

Also, move %install above %test, because %install happens first, and %test
after that.
2024-04-17 23:26:03 +02:00
Marian Csontos
e10017f376 Update to version 1.0.12 2024-02-27 10:42:12 +01:00
Marian Csontos
7ccc70d06b SPDX: Add licenses for vendored libraries. 2024-02-27 10:41:23 +01:00
Marian Csontos
36f16d6703 SPDX migration. 2024-02-13 10:19:16 +01:00
Yaakov Selkowitz
e9706a7124 Update Rust macro usage
The rust-toolset macros in RHEL 10 are now compatible with Fedora's
in terms of handling vendoring and automatic generation of license
information and bundled provides.
2024-02-08 12:26:19 -05:00
Marian Csontos
32537c977f Update to version 1.0.11 2024-02-08 15:07:20 +01:00
Fedora Release Engineering
c1fa90d775 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 09:20:18 +00:00
Fedora Release Engineering
62ab60b959 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 17:03:28 +00:00
5 changed files with 140 additions and 97 deletions

12
.gitignore vendored
View file

@ -49,3 +49,15 @@
/dmpd106-vendor.tar.gz
/v1.0.9.tar.gz
/dmpd109-vendor.tar.gz
/v1.0.11.tar.gz
/dmpd1011-vendor.tar.gz
/v1.0.12.tar.gz
/dmpd1012-vendor.tar.gz
/v1.1.0.tar.gz
/dmpd110-vendor.tar.gz
/v1.2.1.tar.gz
/dmpd121-vendor.tar.gz
/v1.3.0.tar.gz
/dmpd130-vendor.tar.gz
/v1.3.1.tar.gz
/dmpd131-vendor.tar.gz

View file

@ -1,29 +0,0 @@
From 0d5347bd771e960294cd0c2f083d96448613ab9c Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Thu, 27 Jul 2023 11:37:01 +0200
Subject: [PATCH] Tweak cargo.toml to work with vendor directory
Mock works offline, cargo would try to download the files from github.
So cargo vendor has to be run first, and then change the Cargo.toml to
make mock happy.
---
Cargo.toml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index 500345a4..d4aa38a6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,7 +27,8 @@ quick-xml = "0.29"
rand = "0.8"
rangemap = "1.4"
roaring = "0.10"
-rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true }
+#rio = { git = "https://github.com/jthornber/rio", branch = "master", optional = true }
+rio = { version = "0.9.4", optional = true }
safemem = "0.3"
threadpool = "1.8"
thiserror = "1.0"
--
2.43.0

View file

@ -1,24 +1,54 @@
# Packaging dmpd
# Packaging device-mapper-persitent-data (AKA dmpd)
This is mostly regular package except recent addition of rust to used languages.
This is rust package using *vendor* file for dependencies. (Vendor file is an archive of dependencies' sources.)
## rust-tools
For most of simple fixes, there is nothing special,
to add a patches simply add them to dist-git,
add a corresponding `PatchN: 000N-...` lines,
increase `Release:` or `release_suffix` for Z-stream (or for test build use suffix like `.bzNNNNNN`),
add to `%changelog`,
commit,
push,
and build the package using `fedpkg build`.
To build the rust-tools (`make rust-tools`) one needs:
Alternatively before committing anything use `fedpkg srpm` and `fedpkg scratch-build --srpm $SRPM [--arches x86_64]` to create a scratch build.
- rust >= 1.35
- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8)
However when building a new version of dmpd or when updating a dependency is
needed (e.g. because of CVE in the dependency) vendor file
has to be regenerated.
### cargo vendpr
## Updating vendor file
- run `cargo vendor` in the disrectory with sources
- run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor`
- copy the file (if version changed) and run the *fedpkg new-sources* command:
To build a new version of the package following tooling is needed:
- `rust >= 1.35`
- `cargo` providing vendor subcommand (now upstream, included in latest Fedora and RHEL8+)
To create the vendor file:
In the upstream directory:
1. Run `cargo vendor` in the directory with upstream sources to create *vendor*
directory with sources.
- TODO: There is a *cargo-vendor-filterer* project used by *stratisd* to
filter out unnecessary dependencies for other operating systems.
2. Run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor` to create a tarball.
3. Copy the vendor file to dist git directory.
In the dist-git directory:
1. Get the upstream tarball `wget https://github.com/jthornber/thin-provisioning-tools/archive/v$VERSION.tar.gz`
- NOTE: Migration to `https://github.com/device-mapper-utils/thin-provisioning-tools` is coming.
2. Update *Source0* and *Source1* to correct values.
3. Add the tarballs to koji/brew lookaside:
- `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz`
## TODO/NOTES
Some of the dependencies may be already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora?
Some of the dependencies are already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora?
It would be possible to include these as submodules, and the rest could be used from Fedora.
For RHEL and CentOS Stream using vendor file is the recommended way.
*%cargo_install* installs by defualt in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*.
*%cargo_install* installs by default in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*.
Now Fedora unified the */usr/sbin* and */usr/bin* directories, to this can be "fixed" in Fedora and later in CentOS Stream.

View file

@ -2,22 +2,22 @@
# Copyright (C) 2011-2017 Red Hat, Inc
#
%bcond_without check
%global debug_package %{nil}
#%%global debug_package %%{nil}
#%%global version_suffix -rc2
#%%global release_suffix .test3
Summary: Device-mapper Persistent Data Tools
Name: device-mapper-persistent-data
Version: 1.0.9
Version: 1.3.1
Release: 1%{?dist}%{?release_suffix}
License: GPLv3+
License: GPL-3.0-only AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) AND (Zlib OR Apache-2.0 OR MIT)
#ExcludeArch: %%{ix86}
URL: https://github.com/jthornber/thin-provisioning-tools
#Source0: https://github.com/jthornber/thin-provisioning-tools/archive/thin-provisioning-tools-%%{version}.tar.gz
Source0: https://github.com/jthornber/thin-provisioning-tools/archive/v%{version}%{?version_suffix}.tar.gz
Source1: dmpd109-vendor.tar.gz
Patch1: 0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch
Source1: dmpd131-vendor.tar.gz
%if %{defined rhel}
BuildRequires: rust-toolset
@ -27,6 +27,12 @@ BuildRequires: rust >= 1.35
BuildRequires: cargo
%endif
BuildRequires: make
BuildRequires: systemd-devel
BuildRequires: clang-libs
BuildRequires: glibc-static
BuildRequires: device-mapper-devel
BuildRequires: clang
#BuildRequires: gcc
%description
thin-provisioning-tools contains check,dump,restore,repair,rmap
@ -37,52 +43,20 @@ are included and era check, dump, restore and invalidate to manage
snapshot eras
%prep
%autosetup -p1 -n thin-provisioning-tools-%{version}%{?version_suffix}
#%%cargo_prep
#%%cargo_generate_buildrequires
tar xf %{SOURCE1}
mkdir -p .cargo
(
# Part from %%cargo_prep:
set -euo pipefail
/usr/bin/mkdir -p target/rpm
/usr/bin/ln -s rpm target/release
/usr/bin/rm -rf .cargo/
/usr/bin/mkdir -p .cargo
cat > .cargo/config << EOF
[build]
rustc = "/usr/bin/rustc"
rustdoc = "/usr/bin/rustdoc"
%autosetup -p1 -n thin-provisioning-tools-%{version}%{?version_suffix} -a1
%cargo_prep -v vendor
[profile.rpm]
inherits = "release"
opt-level = 3
codegen-units = 1
debug = 2
strip = "none"
# NOTE: Following could replace Cargo.toml patching, but some macros are not working well with it
# Notably at least one of cargo_license_summary, cargo_license_summary, or cargo_vendor_manifest
#cat >> .cargo/config.toml << EOF
#
#[source."git+https://github.com/jthornber/rio?branch=master"]
#git = "https://github.com/jthornber/rio"
#branch = "master"
#replace-with = "vendored-sources"
#
#EOF
[env]
CFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer "
CXXFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer "
LDFLAGS = "-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 "
[install]
root = "/home/mcsontos/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr"
[term]
verbose = true
EOF
# Our own part:
cat >> .cargo/config <<END
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
END
)
echo %{version}-%{release} > VERSION
%generate_buildrequires
@ -90,6 +64,13 @@ echo %{version}-%{release} > VERSION
%build
#make %{?_smp_mflags} V=
%cargo_build
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies
%cargo_vendor_manifest
%install
# TODO: Check that MANDIR is unused and remove
%make_install STRIP=true MANDIR=%{_mandir} BINDIR=%{buildroot}%{_sbindir}
%if %{with check}
%check
@ -97,12 +78,11 @@ echo %{version}-%{release} > VERSION
#cargo test --test thin_shrink -- --nocapture --test-threads=1
%endif
%install
# TODO: Check that MANDIR is unused and remove
%make_install MANDIR=%{_mandir}
%files
%doc COPYING README.md
%doc README.md
%license COPYING
%license LICENSE.dependencies
%license cargo-vendor.txt
%{_mandir}/man8/cache_check.8.gz
%{_mandir}/man8/cache_dump.8.gz
%{_mandir}/man8/cache_metadata_size.8.gz
@ -118,6 +98,7 @@ echo %{version}-%{release} > VERSION
%{_mandir}/man8/thin_dump.8.gz
%{_mandir}/man8/thin_ls.8.gz
%{_mandir}/man8/thin_metadata_size.8.gz
%{_mandir}/man8/thin_migrate.8.gz
%{_mandir}/man8/thin_repair.8.gz
%{_mandir}/man8/thin_restore.8.gz
%{_mandir}/man8/thin_rmap.8.gz
@ -140,6 +121,7 @@ echo %{version}-%{release} > VERSION
%{_sbindir}/thin_dump
%{_sbindir}/thin_ls
%{_sbindir}/thin_metadata_size
%{_sbindir}/thin_migrate
%{_sbindir}/thin_repair
%{_sbindir}/thin_restore
%{_sbindir}/thin_rmap
@ -149,6 +131,54 @@ echo %{version}-%{release} > VERSION
#% {_sbindir}/thin_show_duplicates
%changelog
* Tue Dec 02 2025 Marian Csontos <mcsontos@redhat.com> - 1.3.1-1
- Update to latest upstream release 1.3.1.
* Wed Oct 22 2025 Marian Csontos <mcsontos@redhat.com> - 1.3.0-1
- Update to latest upstream release 1.3.0.
* Thu Sep 04 2025 Marian Csontos <mcsontos@redhat.com> - 1.2.1-1
- Update to latest upstream release 1.2.1.
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.0-2
- Rebuilt for the bin-sbin merge (2nd attempt)
* Mon Sep 02 2024 Marian Csontos <mcsontos@redhat.com> - 1.1.0-1
- Update to latest upstream release 1.1.0.
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Jul 09 2024 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.12-2
- Rebuilt for the bin-sbin merge
* Tue Feb 27 2024 Marian Csontos <mcsontos@redhat.com> - 1.0.12-1
- Update to latest upstream release 1.0.12.
* Tue Feb 13 2024 Marian Csontos <mcsontos@redhat.com> - 1.0.11-4
- Add licenses for statically linked libraries.
* Tue Feb 13 2024 Marian Csontos <mcsontos@redhat.com> - 1.0.11-3
- SPDX migration
* Thu Feb 08 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 1.0.11-2
- Update Rust macro usage
* Thu Feb 08 2024 Marian Csontos <mcsontos@redhat.com> - 1.0.11-1
- Update to latest upstream release 1.0.11.
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Dec 11 2023 Marian Csontos <mcsontos@redhat.com> - 1.0.9-1
- Update to latest upstream release 1.0.9.

View file

@ -1,2 +1,2 @@
SHA512 (v1.0.9.tar.gz) = c7d137b82cce4286d43f49af039f8026d7d7746e96affebc82e8243173ba9a014e3b462fc4b55850067ecfbcc6113c49f009c1285e272a4d64455715d11a9da1
SHA512 (dmpd109-vendor.tar.gz) = f2a581da80e4137c6ecab9237587ec42141fdfe8c1bfae2ab5b431b64c100ea6c65cfadbbdd10d665101364731d7c5e61780490b9cfd5231df3f463483890747
SHA512 (v1.3.1.tar.gz) = ff0758b21b50702568cad88522ee4c2b6b4433cec0a5f5074c9d1791c13e630e5c516601d7a68c51ac34e036091fc82fe831dbe51e6776737571d90ed266878e
SHA512 (dmpd131-vendor.tar.gz) = 0e1b8e501e330b64415c9097c94dfc1f1b43d2900a66258e40b6c8f28c51fd61247d60495f594f14550fb349ed4ad435f8959a8808fea1d363a206c5ead7db1e