# Generated by rust2rpm 28 %bcond check 1 %global debug_package %{nil} %global crate ppmd-rust Name: rust-ppmd-rust Version: 1.4.0 Release: %autorelease Summary: PPMd compression / decompression License: MIT-0 URL: https://crates.io/crates/ppmd-rust Source: %{crates_source} # * We use the GitHub archive as an additional source solely for the test data # files, as permitted in # https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_package_sources. # We wait until %%check to copy in the extra files to prove they are not # included in the crate sources shipped in the binary RPMs. # * Contains the Apache License Version 2.0 and GPL Version 3 license texts as # sample text files (apache2.txt/apache2_*.bin, gpl3.txt/gpl3_*.bin). # * Contains a sample log file (issue_3.txt/issue_3_*.bin), which doesn’t appear # to have any creative content or obvious signs of license issues. # * Contains the Project Gutenberg eBook of The Complete Works of William # Shakespeare, https://www.gutenberg.org/ebooks/100 (pg100.txt/pg100_*.bin), # and the Project Gutenberg eBook of The Works of Frederick Schiller, # https://www.gutenberg.org/ebooks/6800 (pg6800.txt/pg6800_*.bin). Both are # public-domain in the USA according to Project Gutenberg, and should be # public-domain worldwide given their age, and the so-called Project Gutenberg # License attached to them is deemed “not a license” for Fedora’s purposes: # https://gitlab.com/fedora/legal/fedora-license-data/-/issues/136, # https://gitlab.com/fedora/legal/fedora-license-data/-/issues/676. Source10: https://github.com/hasenbanck/ppmd-rust/archive/v%{version}/ppmd-rust-%{version}.tar.gz # Manually created patch for downstream crate metadata changes # * Remove the CC0-1.0 license option, not-allowed for code in Fedora, from the # Cargo metadata. See https://github.com/hasenbanck/ppmd-rust/issues/9 for # discussion. Patch: ppmd-rust-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: PPMd compression / decompression.} %description %{_description} %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-CC0.md %license %{crate_instdir}/LICENSE-MIT-0.md %doc %{crate_instdir}/CHANGELOG.md %doc %{crate_instdir}/README.md %{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 %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check # Copy in test data (tests/fixtures/) – required to run tests, but not included # in the released crate. By doing so here in %%check rather than in %%prep, we # prove that the binary RPMs are derived solely from the published crate # sources. tar -xzvf '%{SOURCE10}' --strip-components=1 \ ppmd-rust-%{version}/tests/fixtures %if 0%{?__isa_bits} == 32 # Avoid possible memory exhaustion on 32-bit architectures. export RUST_TEST_THREADS=1 %endif %cargo_test %endif %changelog %autochangelog