diff --git a/.gitignore b/.gitignore index 56e01af..8be70e4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /brotli-3.3.4.crate /brotli-3.4.0.crate /brotli-3.5.0.crate +/brotli-6.0.0.crate diff --git a/brotli-6.0.0-license-accuracy.patch b/brotli-6.0.0-license-accuracy.patch new file mode 100644 index 0000000..ba09783 --- /dev/null +++ b/brotli-6.0.0-license-accuracy.patch @@ -0,0 +1,32 @@ +diff --git a/LICENSE b/LICENSE.BSD-3-Clause +similarity index 100% +rename from LICENSE +rename to LICENSE.BSD-3-Clause +diff --git a/LICENSE.MIT b/LICENSE.MIT +new file mode 100644 +index 0000000..33b7cdd +--- /dev/null ++++ b/LICENSE.MIT +@@ -0,0 +1,19 @@ ++Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. ++ ++Permission is hereby granted, free of charge, to any person obtaining a copy ++of this software and associated documentation files (the "Software"), to deal ++in the Software without restriction, including without limitation the rights ++to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++copies of the Software, and to permit persons to whom the Software is ++furnished to do so, subject to the following conditions: ++ ++The above copyright notice and this permission notice shall be included in ++all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ++THE SOFTWARE. +-- +2.46.1 + diff --git a/brotli-fix-metadata.diff b/brotli-fix-metadata.diff index bd549e2..7376af8 100644 --- a/brotli-fix-metadata.diff +++ b/brotli-fix-metadata.diff @@ -1,11 +1,11 @@ ---- brotli-3.5.0/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ brotli-3.5.0/Cargo.toml 2024-03-19T19:53:50.395002+00:00 -@@ -33,20 +33,21 @@ +--- brotli-6.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ brotli-6.0.0/Cargo.toml 2024-09-29T16:35:06.176128+00:00 +@@ -34,8 +34,17 @@ "compression", "no-std", ] -license = "BSD-3-Clause OR MIT" -+license = "BSD-3-Clause" ++license = "BSD-3-Clause AND MIT" repository = "https://github.com/dropbox/rust-brotli" +exclude = [ + "/ci/", @@ -19,15 +19,3 @@ [profile.release] lto = true - incremental = false -- --[[bin]] --name = "brotli" --doc = false -- --[[bin]] --name = "catbrotli" --doc = false - - [dependencies.alloc-no-stdlib] - version = "2.0" diff --git a/rust-brotli.spec b/rust-brotli.spec index 044363a..0c56770 100644 --- a/rust-brotli.spec +++ b/rust-brotli.spec @@ -1,32 +1,39 @@ # Generated by rust2rpm 26 -# * tests fail with OOM problems on 32-bit architectures: -# https://github.com/dropbox/rust-brotli/issues/42 -%if 0%{?__isa_bits} == 32 -%bcond_with check -%else %bcond_without check -%endif %global debug_package %{nil} +# prevent executables from being installed +%global cargo_install_bin 0 + %global crate brotli Name: rust-brotli -Version: 3.5.0 +Version: 6.0.0 Release: %autorelease Summary: Brotli compressor and decompressor with no_std support -License: BSD-3-Clause +License: BSD-3-Clause AND MIT URL: https://crates.io/crates/brotli Source: %{crates_source} # Manually created patch for downstream crate metadata changes -# * fix license in crate metadata: -# https://github.com/dropbox/rust-brotli/issues/41 -# * drop unwanted brotli and catbrotli binaries -# * exclude files that are only useful for upstream development: +# * 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 >= 24 +BuildRequires: cargo-rpm-macros >= 26 %global _description %{expand: A brotli compressor and decompressor that with an interface avoiding the @@ -48,7 +55,8 @@ This package contains library source intended for building other packages which use the "%{crate}" crate. %files devel -%license %{crate_instdir}/LICENSE +%license %{crate_instdir}/LICENSE.BSD-3-Clause +%license %{crate_instdir}/LICENSE.MIT %doc %{crate_instdir}/README.md %{crate_instdir}/ @@ -76,18 +84,6 @@ use the "alloc-stdlib" feature of the "%{crate}" crate. %files -n %{name}+alloc-stdlib-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+benchmark-devel -Summary: %{summary} -BuildArch: noarch - -%description -n %{name}+benchmark-devel %{_description} - -This package contains library source intended for building other packages which -use the "benchmark" feature of the "%{crate}" crate. - -%files -n %{name}+benchmark-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+disable-timer-devel Summary: %{summary} BuildArch: noarch @@ -210,10 +206,10 @@ use the "vector_scratch_space" feature of the "%{crate}" crate. %prep %autosetup -n %{crate}-%{version} -p1 -%cargo_prep -# * remove executable bits from Rust source files: -# https://github.com/dropbox/rust-brotli/pull/40 +# 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 diff --git a/rust2rpm.toml b/rust2rpm.toml index 0c06786..9f04b3a 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,3 +1,49 @@ [package] summary = "Brotli compressor and decompressor with no_std support" +cargo-toml-patch-comments = [ + """\ + 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\ + """, +] +# The brotli binary would conflict with the one provided by the brotli package. +# The catbrotli binary would not, so we *could* install it, but it doesn’t seem +# useful enough to bother. +cargo-install-bin = false +[features] +hide = [ + # The benchmark feature makes no sense for external users, and would + # require the corresponding feature in the brotli-decompressor crate, which + # in turn would require a test data corpus. + "benchmark", +] + +[scripts.prep] +pre = [ + "# Remove executable flag from .rs files", + "# https://github.com/dropbox/rust-brotli/pull/181", + "find -type f -name '*.rs' -executable -exec chmod -x '{}' +", +] + +[[package.extra-patches]] +number = 10 +file = "brotli-6.0.0-license-accuracy.patch" +comments = [ + """\ + 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).\ + """ +] diff --git a/sources b/sources index 5ee9c5f..020399d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (brotli-3.5.0.crate) = e6d5b3e59606dfd76cc8638895fbf03f36a19750faff6fb8ceca0a091c620ca1082b99fd89390d74c212f1103f24edd6d8fc08724898d695020cf5de66cffd56 +SHA512 (brotli-6.0.0.crate) = 6d53d3ab653aa3545f0da397796efa1110d445ab8f46456c7501f84ce1c48c99235ae05857f6e91b138521158268691b3a97524f2d3622d69986837dcb64c19d