stratis-storage / project

A holding place for issues that affect more than one repository in the project
4 stars 0 forks source link

Release devicemapper-sys 0.2.0 #669

Closed mulkieran closed 8 months ago

mulkieran commented 9 months ago

Special Fedora experiment and orphan the -sys package if succesful.

mulkieran commented 9 months ago

Proposed patch:

diff --git a/devicemapper-adjust-metadata.diff b/devicemapper-adjust-metadata.diff
new file mode 100644
index 0000000..73817f3
--- /dev/null
+++ b/devicemapper-adjust-metadata.diff
@@ -0,0 +1,18 @@
+--- a/Cargo.toml       2023-10-03 14:15:51.630116693 -0400
++++ b/Cargo.toml       2023-10-03 14:23:16.838498944 -0400
+@@ -44,6 +44,7 @@
+ 
+ [dependencies.devicemapper-sys]
+ version = "0.1.5"
++path = "./devicemapper-rs-sys"
+ 
+ [dependencies.env_logger]
+ version = "0.10.0"
+@@ -88,6 +89,7 @@
+ 
+ [build-dependencies.devicemapper-sys]
+ version = "0.1.5"
++path = "./devicemapper-rs-sys"
+ 
+ [build-dependencies.semver]
+ version = "1.0.0"
diff --git a/rust-devicemapper.spec b/rust-devicemapper.spec
index a3d97ff..c025636 100644
--- a/rust-devicemapper.spec
+++ b/rust-devicemapper.spec
@@ -10,12 +10,16 @@ Release:        2%{?dist}
 Summary:        Library for using Linux device mapper

 License:        MPL-2.0
-URL:            https://crates.io/crates/devicemapper
-Source:         %{crates_source}
+URL:            https://github.com/stratis-storage/devicemapper-rs
+Source0:        %{crates_source}
+Source1:        %{url}/archive/refs/tags/v%{version}.tar.gz
+Patch:          devicemapper-adjust-metadata.diff

 BuildRequires:  rust-packaging >= 21
 BuildRequires:  device-mapper-devel

+Provides: bundled(crate(devicemapper-sys)) = 0.1.5
+
 %global _description %{expand:
 A library for using Linux device mapper.}

@@ -49,6 +53,10 @@ use the "default" feature of the "%{crate}" crate.
 %ghost %{crate_instdir}/Cargo.toml

 %prep
+tar --extract --file %{SOURCE0}
+tar --directory=devicemapper-%{version} --extract --file %{SOURCE1} devicemapper-rs-%{version}/devicemapper-rs-sys --strip-components=1
+tar --create --gzip --file %{SOURCE0}.newfile ./devicemapper-%{version} --remove-files
+mv %{SOURCE0}.newfile %{SOURCE0}
 %autosetup -n %{crate}-%{version_no_tilde} -p1
 %cargo_prep

@@ -67,6 +75,9 @@ use the "default" feature of the "%{crate}" crate.
 %endif

 %changelog
+* Tue Oct 3 2023 mulhern <amulhern@redhat.com> - 0.33.5-3
+- Bundle -sys library
+
 * Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.33.5-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
mulkieran commented 9 months ago

https://pagure.io/fedora-rust/cargo2rpm/issue/7

mulkieran commented 9 months ago

It looks like the proposed metadata patch, which sets the Cargo.toml -sys dependency back to a path dependency is undesirable. However, it might be possible to use a patch table entry to do the same trick.

mulkieran commented 8 months ago

Closed for https://github.com/stratis-storage/project/issues/673