diff --git a/rust-shadow-rs.spec b/rust-shadow-rs.spec index b152826..4103866 100644 --- a/rust-shadow-rs.spec +++ b/rust-shadow-rs.spec @@ -1,11 +1,11 @@ -# Generated by rust2rpm 25 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} %global crate shadow-rs Name: rust-shadow-rs -Version: 0.8.1 +Version: 0.35.1 Release: %autorelease Summary: Build-time information stored in your rust project @@ -13,7 +13,6 @@ License: MIT AND Apache-2.0 URL: https://crates.io/crates/shadow-rs Source: %{crates_source} # Manually created patch for downstream crate metadata changes -# * bump git2 dependency from 0.13 to 0.18 Patch: shadow-rs-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 @@ -49,6 +48,30 @@ use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+cargo_metadata-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+cargo_metadata-devel %{_description} + +This package contains library source intended for building other packages which +use the "cargo_metadata" feature of the "%{crate}" crate. + +%files -n %{name}+cargo_metadata-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+document-features-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+document-features-devel %{_description} + +This package contains library source intended for building other packages which +use the "document-features" feature of the "%{crate}" crate. + +%files -n %{name}+document-features-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+git2-devel Summary: %{summary} BuildArch: noarch @@ -61,9 +84,35 @@ use the "git2" feature of the "%{crate}" crate. %files -n %{name}+git2-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+metadata-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+metadata-devel %{_description} + +This package contains library source intended for building other packages which +use the "metadata" feature of the "%{crate}" crate. + +%files -n %{name}+metadata-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+serde_json-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+serde_json-devel %{_description} + +This package contains library source intended for building other packages which +use the "serde_json" feature of the "%{crate}" crate. + +%files -n %{name}+serde_json-devel +%ghost %{crate_instdir}/Cargo.toml + %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep +# https://github.com/baoyachi/shadow-rs/issues/187 +chmod -x src/lib.rs %generate_buildrequires %cargo_generate_buildrequires @@ -76,8 +125,9 @@ use the "git2" feature of the "%{crate}" crate. %if %{with check} %check -# * skip tests that depend on git repository metadata -%cargo_test -- -- --skip git::tests::test_git --skip git::tests::test_current_branch +# * skip tests that need to be run from within a git repository +# * skip tests that require disabled option tzdb feature +%cargo_test -- -- --skip git::tests::test_git --skip git::tests::test_current_branch --skip date_time::tests::test_local_now_human_format --skip git::tests::test_command_last_tag %endif %changelog diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..6cc8265 --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,16 @@ +[tests] +skip = [ + "git::tests::test_git", + "git::tests::test_current_branch", + "date_time::tests::test_local_now_human_format", + "git::tests::test_command_last_tag", +] +comments = [ + "skip tests that need to be run from within a git repository", + "skip tests that require disabled option tzdb feature", +] +[scripts.prep] +post = [ + "# https://github.com/baoyachi/shadow-rs/issues/187", + "chmod -x src/lib.rs", +] diff --git a/shadow-rs-fix-metadata.diff b/shadow-rs-fix-metadata.diff index c6fafd5..d6e7f7e 100644 --- a/shadow-rs-fix-metadata.diff +++ b/shadow-rs-fix-metadata.diff @@ -1,11 +1,22 @@ ---- shadow-rs-0.8.1/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ shadow-rs-0.8.1/Cargo.toml 2024-02-13T20:28:18.255874+00:00 -@@ -26,7 +26,7 @@ - version = "0.4.13" - - [dependencies.git2] --version = "0.13.20" -+version = "0.18" - optional = true +--- shadow-rs-0.35.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ shadow-rs-0.35.1/Cargo.toml 2024-10-27T17:41:48.012601+00:00 +@@ -87,19 +87,12 @@ + ] default-features = false +-[dependencies.tzdb] +-version = "0.6.0" +-features = ["local"] +-optional = true +-default-features = false +- + [dev-dependencies.winnow] + version = "0.6" + + [features] + default = [ + "git2", +- "tzdb", + ] + metadata = [ + "cargo_metadata",