# Generated by rust2rpm 26 %bcond_without check %global crate libcramjam Name: rust-libcramjam Version: 0.3.0 # 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.3 Release: %autorelease Summary: Compression library combining a plethora of algorithms License: MIT URL: https://crates.io/crates/libcramjam Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * Remove inline-c dependency; it is not packaged, not currently used, and has # a significant number of dependencies of its own # * Add a [lib] table with crate-type = ["lib", "cdylib"] to get a better # template from rust2rpm # * Don’t ask for the static feature of the xz2 crate (link the liblzma shared # library instead) Patch: libcramjam-fix-metadata.diff # # * Fix tests that assume C char is signed # # * https://github.com/milesgranger/cramjam/pull/150 # # * Adjusted to apply to the released crate. Patch10: 0001-Fix-tests-that-assume-C-char-is-signed.patch BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: Compression library combining a plethora of algorithms in a similar as possible API.} %description %{_description} %if !0%{?fc38} && !0%{?fc39} %package -n %{crate} 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 %{crate} %{_description} This package contains libraries for using the "%{crate}" crate via a C API. %files -n %{crate} %license LICENSE %license LICENSE.dependencies %doc README.md %{_libdir}/%{crate}.so.%{soversion}{,.*} %package -n %{crate}-devel Summary: %{summary} Requires: %{crate}%{?_isa} = %{version}-%{release} %description -n %{crate}-devel %{_description} This package contains libraries and header files for developing applications that use the "%{crate}" crate via a C API. %files -n %{crate}-devel %{_includedir}/cramjam/cramjam.h %{_libdir}/%{crate}.so %{_libdir}/pkgconfig/%{crate}.pc %else %global debug_package %{nil} %endif %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 %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -a echo 'cargo-c' %build %cargo_build -a %{cargo_license_summary -a} %{cargo_license -a} > LICENSE.dependencies %if !0%{?fc38} && !0%{?fc39} %cargo_cbuild -a %endif %install %cargo_install -a %if !0%{?fc38} && !0%{?fc39} %cargo_cinstall -a # https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-libraries rm '%{buildroot}%{_libdir}/%{crate}.a' %endif %if %{with check} %check %cargo_test -a %endif %changelog %autochangelog