# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} # prevent executables from being installed %global cargo_install_bin 0 %global crate brotli Name: rust-brotli Version: 6.0.0 Release: %autorelease Summary: Brotli compressor and decompressor with no_std support License: BSD-3-Clause AND MIT URL: https://crates.io/crates/brotli Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * Adjust license from BSD-3-Clause/MIT to BSD-3-Clause AND MIT; see # https://github.com/dropbox/rust-brotli/issues/41, # https://github.com/dropbox/rust-brotli/pull/218 (which was merged upstream), # and Patch10. See also the similar PR # https://github.com/dropbox/rust-brotli-decompressor/pull/32, which was # merged, but note comments in # https://github.com/dropbox/rust-brotli/pull/218: we should be attentive to # future improvements or corrections to the license texts. # * Exclude files that are only useful for upstream development: # https://github.com/dropbox/rust-brotli/pull/43 Patch: brotli-fix-metadata.diff # * Adjust license to reflect a MIT-only source, and add a MIT license file # (https://github.com/dropbox/rust-brotli/pull/218), without the changes to # Cargo.toml (which are applied manually to the normalized Cargo.toml in the # crate). Patch10: brotli-6.0.0-license-accuracy.patch BuildRequires: cargo-rpm-macros >= 26 %global _description %{expand: A brotli compressor and decompressor that with an interface avoiding the rust stdlib. This makes it suitable for embedded devices and kernels. It is designed with a pluggable allocator so that the standard lib's allocator may be employed. The default build also includes a stdlib allocator and stream interface. Disable this with --features=no-stdlib. All included code is safe.} %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.BSD-3-Clause %license %{crate_instdir}/LICENSE.MIT %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 %package -n %{name}+alloc-stdlib-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+alloc-stdlib-devel %{_description} This package contains library source intended for building other packages which use the "alloc-stdlib" feature of the "%{crate}" crate. %files -n %{name}+alloc-stdlib-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+disable-timer-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+disable-timer-devel %{_description} This package contains library source intended for building other packages which use the "disable-timer" feature of the "%{crate}" crate. %files -n %{name}+disable-timer-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+external-literal-probability-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+external-literal-probability-devel %{_description} This package contains library source intended for building other packages which use the "external-literal-probability" feature of the "%{crate}" crate. %files -n %{name}+external-literal-probability-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+ffi-api-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+ffi-api-devel %{_description} This package contains library source intended for building other packages which use the "ffi-api" feature of the "%{crate}" crate. %files -n %{name}+ffi-api-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+pass-through-ffi-panics-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+pass-through-ffi-panics-devel %{_description} This package contains library source intended for building other packages which use the "pass-through-ffi-panics" feature of the "%{crate}" crate. %files -n %{name}+pass-through-ffi-panics-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+seccomp-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+seccomp-devel %{_description} This package contains library source intended for building other packages which use the "seccomp" feature of the "%{crate}" crate. %files -n %{name}+seccomp-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+sha2-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+sha2-devel %{_description} This package contains library source intended for building other packages which use the "sha2" feature of the "%{crate}" crate. %files -n %{name}+sha2-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+simd-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+simd-devel %{_description} This package contains library source intended for building other packages which use the "simd" feature of the "%{crate}" crate. %files -n %{name}+simd-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+std-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+std-devel %{_description} This package contains library source intended for building other packages which use the "std" feature of the "%{crate}" crate. %files -n %{name}+std-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+validation-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+validation-devel %{_description} This package contains library source intended for building other packages which use the "validation" feature of the "%{crate}" crate. %files -n %{name}+validation-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+vector_scratch_space-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+vector_scratch_space-devel %{_description} This package contains library source intended for building other packages which use the "vector_scratch_space" feature of the "%{crate}" crate. %files -n %{name}+vector_scratch_space-devel %ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version} -p1 # Remove executable flag from .rs files # https://github.com/dropbox/rust-brotli/pull/181 find -type f -name '*.rs' -executable -exec chmod -x '{}' + %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %install %cargo_install %if %{with check} %check %if 0%{?__isa_bits} != 32 %cargo_test %else # Few tests fail with OOM on 32bit # https://github.com/dropbox/rust-brotli/issues/42 skip="${skip-} --skip enc::test::test_roundtrip_10x10y" skip="${skip-} --skip enc::test::test_roundtrip_64x" skip="${skip-} --skip enc::test::test_roundtrip_asyoulik" skip="${skip-} --skip enc::test::test_roundtrip_asyoulik9_5" skip="${skip-} --skip enc::test::test_roundtrip_backward65536" skip="${skip-} --skip enc::test::test_roundtrip_compressed_repeated" skip="${skip-} --skip enc::test::test_roundtrip_monkey" skip="${skip-} --skip enc::test::test_roundtrip_quickfox" skip="${skip-} --skip enc::test::test_roundtrip_quickfox_repeated" skip="${skip-} --skip enc::test::test_roundtrip_ukkonooa" skip="${skip-} --skip enc::test::test_roundtrip_x" %cargo_test -- -- --exact ${skip-} %endif %endif %changelog %autochangelog