## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # 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. Since we judge # that cramjam-cli is distributed on PyPI only for convenience of installation # for pip users (similar to the cmake and ninja projects on PyPI), we choose to # use %%cargo_build/%%cargo_install directly. This diverges slightly from # upstream’s practice but is more straightforward. # # If we used %%pyproject_wheel/%%pyproject_install, we would get Python # metadata in %%{python3_sitearch}/cramjam_cli-%%{version}.dist-info/ that # would allow us to provide python3dist(cramjam-cli), but this would also # create an otherwise-unnecessary dependency on the Python interpreter. If we # needed to package this metadata, we would probably want to do it via a # python3-cramjam-cli subpackage that contained only the metadata (and had a # fully-versioned dependency on the base package) in order to keep the base # package from depending on Python. Name: cramjam-cli Version: 0.2.0~rc2 %global srcversion %(echo '%{version}' | tr -d '~') 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://pypi.org/project/cramjam-cli/ # Currently, releases appear on PyPI but are not tagged in the GitHub # repository, https://github.com/milesgranger/cramjam, where this is developed # together with rust-libcramjam and python-cramjam. Since the PyPI sdist # contains everything we need to build and test this package, there is no # problem with treating it as the canonical source. Source0: %{pypi_source cramjam_cli %{srcversion}} # Hand-written for Fedora in groff_man(7) format based on --help output Source1: cramjam-cli.1 # Bump libcramjam to 0.6.0 # https://github.com/cramjam/cramjam-cli/pull/2 Patch: https://github.com/cramjam/cramjam-cli/pull/2.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: python3-devel BuildRequires: tomcli 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}. %prep %autosetup -n cramjam_cli-%{srcversion} -p1 # Do not strip the compiled executable; we need useful debuginfo. Upstream set # this intentionally, so this makes sense to keep downstream-only. Note that # this patch is not strictly needed unless we start building with # %%pyproject_wheel/%%pyproject_install. tomcli set pyproject.toml false 'tool.maturin.strip' # Adjust the default features to ask for dynamic rather than static linking of # the blosc2 C library, and remove the static-linking features (since maturin # needs all features to be satisfiable even if they are not enabled). tomcli set Cargo.toml lists delitem 'features.default' 'blosc2-static' tomcli set Cargo.toml append 'features.default' 'blosc2-shared' tomcli set Cargo.toml del 'features.blosc2-static' %cargo_prep %generate_buildrequires %pyproject_buildrequires -x dev %cargo_generate_buildrequires %build %cargo_license_summary %{cargo_license} > LICENSES.dependencies %cargo_build %install %cargo_install install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}' %check # Note that the tests compare compressor output against python-cramjam, so # tests are only guaranteed to pass when python-cramjam and cramjam-cli are # built with the same Rust crate dependencies. For example, updating rust-lz4 # without rebuilding python-cramjam could cause this package to FTBFS in # Koschei because the test-rebuild would use a newer rust-lz4 than the # python-cramjam build in the repositories used. %pytest -v %files %license LICENSE LICENSES.dependencies %doc README.md %{_bindir}/cramjam-cli %{_mandir}/man1/cramjam-cli.1* %changelog ## START: Generated by rpmautospec * Wed Oct 16 2024 Benjamin A. Beasley - 0.2.0~rc2-2 - Bump libcramjam to 0.6.0 * Fri Oct 04 2024 Benjamin A. Beasley - 0.2.0~rc2-1 - Update to 0.2.0~rc2 * Wed Aug 07 2024 Benjamin A. Beasley - 0.1.1-7 - Rebuilt with latest crate dependencies * Wed Jul 17 2024 Fedora Release Engineering - 0.1.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sat Jun 15 2024 Benjamin A. Beasley - 0.1.1-5 - Rebuilt with rust-lz4 1.25.0 - Add a note to the spec file about tests and python-cramjam * Fri May 24 2024 Benjamin A. Beasley - 0.1.1-4 - Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces * Tue Mar 26 2024 Benjamin A. Beasley - 0.1.1-3 - Update libcramjam crate dependency to 0.3.0 * Mon Mar 18 2024 Benjamin A. Beasley - 0.1.1-2 - Use tomcli for the downstream-only patch * Tue Feb 20 2024 Benjamin A. Beasley - 0.1.1-1 - Initial package (close RHBZ#2264463) ## END: Generated by rpmautospec