# Generated by rust2rpm 25 %bcond_without check %global crate libcramjam Name: rust-libcramjam Version: 0.1.5 # Even though this is just MAJOR.MINOR from the SemVer version, we repeat it # explicitly to help prevent undetected/unannounced SONAME version bumps in the # libcramjam/libcramjam-devel subpackages. %global soversion 0.1 Release: %autorelease Summary: Compression library combining a plethora of algorithms License: MIT URL: https://crates.io/crates/libcramjam Source: %{crates_source} # Get the top-level license file from the commit corresponding to the 0.1.5 # release. We filed a PR to fix this: # Fix missing license file in the libcramjam crate # https://github.com/milesgranger/cramjam/pull/120 Source1: https://github.com/milesgranger/cramjam/blob/8510678864af328a8b711f04ef2ddd8a4fa1d0cc/LICENSE # Manually created patch for downstream crate metadata changes # - Typo fix in crate description, # https://github.com/milesgranger/cramjam/pull/121 # - Allow newer zstd, 0.12 instead of 0.11 # - Allow older zstd-safe, 6 instead of 7 # - Remove inline-c dependency; it is not packaged, not currently used, and # has a significant number of dependencies of its own Patch: libcramjam-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-c %global _description %{expand: Compression library combining a plethora of algorithms in a similar as possible API.} %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 %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}+capi-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+capi-devel %{_description} This package contains library source intended for building other packages which use the "capi" feature of the "%{crate}" crate. %files -n %{name}+capi-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+libc-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+libc-devel %{_description} This package contains library source intended for building other packages which use the "libc" feature of the "%{crate}" crate. %files -n %{name}+libc-devel %ghost %{crate_instdir}/Cargo.toml %package -n libcramjam Summary: %{summary} # 0BSD OR MIT OR Apache-2.0 # Apache-2.0 # BSD-3-Clause # BSD-3-Clause AND MIT # MIT # MIT OR Apache-2.0 # MIT OR Zlib OR Apache-2.0 License: %{shrink: (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) } # LICENSE.dependencies contains a full license breakdown %description -n libcramjam %{_description} This package contains libraries for using the "%{crate}" crate via a C API. %files -n libcramjam %license LICENSE %license LICENSE.dependencies %{_libdir}/libcramjam.so.%{soversion}{,.*} %package -n libcramjam-devel Summary: %{summary} # 0BSD OR MIT OR Apache-2.0 # Apache-2.0 # BSD-3-Clause # BSD-3-Clause AND MIT # MIT # MIT OR Apache-2.0 # MIT OR Zlib OR Apache-2.0 License: %{shrink: (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) } # LICENSE.dependencies (in libcramjam) contains a full license breakdown Requires: libcramjam%{?_isa} = %{version}-%{release} %description -n libcramjam-devel %{_description} This package contains libraries and header files for developing applications that use the "%{crate}" crate via a C API. %files -n libcramjam-devel %{_includedir}/cramjam/cramjam.h %{_libdir}/libcramjam.so %{_libdir}/pkgconfig/libcramjam.pc %prep %autosetup -n %{crate}-%{version} -p1 cp -p '%{SOURCE1}' . %cargo_prep %generate_buildrequires # cargo-c requires all optional dependencies to be available %cargo_generate_buildrequires -a echo "cargo-c" %build %cargo_build %cargo_cbuild %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install %cargo_install %cargo_cinstall # https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-libraries rm '%{buildroot}%{_libdir}/%{crate}.a' %if %{with check} %check %cargo_test %endif %changelog %autochangelog