# This command-line tool is written in Rust, not Python, but it is distributed # on PyPI (so it can be installed using pip, even though it does not provide an # importable Python module), and it uses Python for testing. Name: cramjam-cli Version: 0.1.1 Release: %autorelease Summary: Simple CLI to a variety of compression algorithms # 0BSD OR MIT OR Apache-2.0 # Apache-2.0 # Apache-2.0 OR MIT # BSD-3-Clause # BSD-3-Clause AND MIT (duplicate) # MIT # MIT OR Apache-2.0 (duplicate) # MIT OR Zlib OR Apache-2.0 License: %{shrink: (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR MIT) AND BSD-3-Clause AND MIT AND (MIT OR Zlib OR Apache-2.0) } # LICENSE.dependencies contains a full license breakdown URL: https://github.com/milesgranger/cramjam # The PyPI sdist is structured like the git repository, but with pyproject.toml # moved to the top level from cramjam-python/ and # manifest-path = "cramjam-python/Cargo.toml" # added to the [tool.maturin] section. We find it easiest to just build from # the GitHub source archive. Source: %{pypi_source cramjam_cli} # Remove relative libcramjam dep for python builds # See: https://github.com/milesgranger/cramjam/pull/131 # Rebased on the released PyPI sdist Patch: cramjam-cli-0.1.1-system-libcramjam-crate.patch # Fix missing LICENSE file in cramjam-cli # https://github.com/milesgranger/cramjam/pull/137 # Rebased on the released PyPI sdist Patch: cramjam-cli-0.1.1-license-file.patch # Do not strip the compiled executable; we need useful debuginfo. Upstream set # this intentionally, so this makes sense to keep downstream-only. Patch: cramjam-cli-0.1.1-no-strip.patch BuildRequires: python3-devel BuildRequires: cargo-rpm-macros >= 24 # Required for tests, but not in the dev extra (probably because it is built # from the same workspace): BuildRequires: %{py3_dist cramjam} %description %{summary}. %package -n python3-cramjam-cli Summary: Python metadata for cramjam-cli License: MIT Requires: cramjam-cli%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description -n python3-cramjam-cli This package includes Python metadata corresponding to the cramjam-cli PyPI package. It does not include an importable Python module. This is packaged separately from the cramjam-cli command-line tool because cramjam-cli does not otherwise require a Python interpreter. %prep %autosetup -n cramjam_cli-%{version} -p1 # Remove bundled rust-libcramjam. rm -rv local_dependencies/ %cargo_prep %generate_buildrequires %pyproject_buildrequires -x dev %cargo_generate_buildrequires %build export RUSTFLAGS='%{build_rustflags}' %cargo_license_summary %{cargo_license} > LICENSES.dependencies %pyproject_wheel %install %pyproject_install # Because this package is distributed on PyPI and built via Python tooling, it # includes Python metadata. However, we cannot use %%pyproject_save_files # without an importable module. %check %pytest -v %files %license LICENSE LICENSES.dependencies %doc README.md %{_bindir}/cramjam-cli %files -n python3-cramjam-cli %{python3_sitearch}/cramjam_cli-%{version}.dist-info/ %changelog %autochangelog