# Generated by rust2rpm 28 %bcond check 1 %global crate object-rewrite Name: rust-object-rewrite Version: 0.1.1 Release: %autorelease Summary: Rewrite object files with modifications License: Apache-2.0 OR MIT URL: https://crates.io/crates/object-rewrite Source: %{crates_source} # * Fix missing license files in published object-rewrite crate: # https://github.com/gimli-rs/object/pull/845 Source10: https://github.com/gimli-rs/object/raw/refs/tags/rewrite-%{version}/LICENSE-APACHE Source11: https://github.com/gimli-rs/object/raw/refs/tags/rewrite-%{version}/LICENSE-MIT # Manually created patch for downstream crate metadata changes # * Fix missing license files in published object-rewrite crate: add licenses to # package.include. This is part of # https://github.com/gimli-rs/object/pull/845. # * Allow object versions 0.36 through 0.38: # https://github.com/gimli-rs/object/commits/0.38.1/crates/rewrite Patch: object-rewrite-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 BuildRequires: help2man %global _description %{expand: Rewrite object files with modifications.} %description %{_description} %package -n %{crate} Summary: %{summary} # Apache-2.0 OR MIT # MIT # MIT OR Apache-2.0 # Unlicense OR MIT # Zlib License: %{shrink: (Apache-2.0 OR MIT) AND MIT AND Zlib AND (Unlicense OR MIT) } # LICENSE.dependencies contains a full license breakdown %description -n %{crate} %{_description} %files -n %{crate} %license LICENSE-APACHE %license LICENSE-MIT %license LICENSE.dependencies %{_bindir}/object-rewrite %{_mandir}/man1/object-rewrite.1* %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE-APACHE %license %{crate_instdir}/LICENSE-MIT %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+default-devel %{_description} This package contains library source intended for building other packages which use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+all-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+all-devel %{_description} This package contains library source intended for building other packages which use the "all" feature of the "%{crate}" crate. %files -n %{name}+all-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+cli-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+cli-devel %{_description} This package contains library source intended for building other packages which use the "cli" feature of the "%{crate}" crate. %files -n %{name}+cli-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+doc-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+doc-devel %{_description} This package contains library source intended for building other packages which use the "doc" feature of the "%{crate}" crate. %files -n %{name}+doc-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+logging-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+logging-devel %{_description} This package contains library source intended for building other packages which use the "logging" feature of the "%{crate}" crate. %files -n %{name}+logging-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 cp -p '%{SOURCE10}' '%{SOURCE11}' . %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -f cli %build %cargo_build -f cli %{cargo_license_summary -f cli} %{cargo_license -f cli} > LICENSE.dependencies help2man --no-info --name='%{summary}' --output=object-rewrite.1 \ target/rpm/object-rewrite %install %cargo_install -f cli install -t %{buildroot}%{_mandir}/man1 -D -p -m 0644 object-rewrite.1 %if %{with check} %check %cargo_test -f cli %endif %changelog %autochangelog