tests: fix spec generator test and update test fixtures

This commit is contained in:
Fabio Valentini 2023-02-13 18:18:54 +01:00
parent cbb1ea5ae7
commit 3eab0fef8e
No known key found for this signature in database
GPG key ID: 5AC5F572E5D410AF
16 changed files with 193 additions and 170 deletions

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate cxx-build
%global real_crate cxx-build-1.0.71
@ -38,18 +39,6 @@ C++ code generator for integrating `cxx` crate into a Cargo build.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/cxx-build
%package devel
Summary: %{summary}
BuildArch: noarch

View file

@ -0,0 +1 @@
{"packages":[{"name":"cxx-build","version":"1.0.71","id":"cxx-build 1.0.71 (path+file:///home/deca/Downloads/cxx-build-1.0.71)","license":"MIT OR Apache-2.0","license_file":null,"description":"C++ code generator for integrating `cxx` crate into a Cargo build.","source":null,"dependencies":[{"name":"cc","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.49","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"codespan-reporting","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.11","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"once_cell","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.9","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"proc-macro2","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.39","kind":null,"rename":null,"optional":false,"uses_default_features":false,"features":["span-locations"],"target":null,"registry":null},{"name":"quote","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":false,"features":[],"target":null,"registry":null},{"name":"scratch","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0","kind":null,"rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"syn","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^1.0.95","kind":null,"rename":null,"optional":false,"uses_default_features":false,"features":["parsing","printing","clone-impls","full"],"target":null,"registry":null},{"name":"cxx-gen","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.7","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null},{"name":"pkg-config","source":"registry+https://github.com/rust-lang/crates.io-index","req":"^0.3","kind":"dev","rename":null,"optional":false,"uses_default_features":true,"features":[],"target":null,"registry":null}],"targets":[{"kind":["lib"],"crate_types":["lib"],"name":"cxx-build","src_path":"/home/deca/Downloads/cxx-build-1.0.71/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true}],"features":{"experimental-async-fn":[],"parallel":["cc/parallel"]},"manifest_path":"/home/deca/Downloads/cxx-build-1.0.71/Cargo.toml","metadata":{"docs":{"rs":{"targets":["x86_64-unknown-linux-gnu"]}}},"publish":null,"authors":["David Tolnay <dtolnay@gmail.com>"],"categories":["development-tools::ffi"],"keywords":["ffi"],"readme":null,"repository":"https://github.com/dtolnay/cxx","homepage":"https://cxx.rs","documentation":null,"edition":"2018","links":null,"default_run":null,"rust_version":"1.48"}],"workspace_members":["cxx-build 1.0.71 (path+file:///home/deca/Downloads/cxx-build-1.0.71)"],"resolve":null,"target_directory":"/home/deca/Downloads/cxx-build-1.0.71/target","version":1,"workspace_root":"/home/deca/Downloads/cxx-build-1.0.71","metadata":null}

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate cxx-build
%global real_crate cxx-build-1.0.71
@ -42,19 +43,6 @@ C++ code generator for integrating `cxx` crate into a Cargo build.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Group: # FIXME
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/cxx-build
%package devel
Summary: %{summary}
Group: Development/Rust

View file

@ -17,6 +17,7 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate cxx-build
%global real_crate cxx-build-1.0.71
@ -58,19 +59,6 @@ C++ code generator for integrating `cxx` crate into a Cargo build.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Group: # FIXME
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/cxx-build
%package devel
Summary: %{summary}
Group: Development/Libraries/Rust

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate cxx-build
%global real_crate cxx-build-1.0.71
@ -40,18 +41,6 @@ C++ code generator for integrating `cxx` crate into a Cargo build.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/cxx-build
%package devel
Summary: %{summary}
BuildArch: noarch

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate nix
%global real_crate nix-0.24.1
@ -30,6 +31,7 @@ BuildRequires: (crate(lazy_static/default) >= 1.2.0 with crate(lazy_static/defa
BuildRequires: (crate(parking_lot/default) >= 0.11.2 with crate(parking_lot/default) < 0.12.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(semver/default) >= 1.0.0 with crate(semver/default) < 2.0.0~)
BuildRequires: (crate(sysctl/default) >= 0.1.0 with crate(sysctl/default) < 0.2.0~)
BuildRequires: (crate(tempfile/default) >= 3.2.0 with crate(tempfile/default) < 4.0.0~)
%endif
@ -38,18 +40,6 @@ Rust friendly bindings to *nix APIs.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/nix
%package devel
Summary: %{summary}
BuildArch: noarch

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate nix
%global real_crate nix-0.24.1
@ -33,6 +34,7 @@ BuildRequires: (crate(lazy_static/default) >= 1.2.0 with crate(lazy_static/defa
BuildRequires: (crate(parking_lot/default) >= 0.11.2 with crate(parking_lot/default) < 0.12.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(semver/default) >= 1.0.0 with crate(semver/default) < 2.0.0~)
BuildRequires: (crate(sysctl/default) >= 0.1.0 with crate(sysctl/default) < 0.2.0~)
BuildRequires: (crate(tempfile/default) >= 3.2.0 with crate(tempfile/default) < 4.0.0~)
%endif
@ -41,19 +43,6 @@ Rust friendly bindings to *nix APIs.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Group: # FIXME
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/nix
%package devel
Summary: %{summary}
Group: Development/Rust

View file

@ -17,6 +17,7 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate nix
%global real_crate nix-0.24.1
@ -50,6 +51,7 @@ BuildRequires: (crate(lazy_static/default) >= 1.2.0 with crate(lazy_static/defa
BuildRequires: (crate(parking_lot/default) >= 0.11.2 with crate(parking_lot/default) < 0.12.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(semver/default) >= 1.0.0 with crate(semver/default) < 2.0.0~)
BuildRequires: (crate(sysctl/default) >= 0.1.0 with crate(sysctl/default) < 0.2.0~)
BuildRequires: (crate(tempfile/default) >= 3.2.0 with crate(tempfile/default) < 4.0.0~)
%endif
@ -58,19 +60,6 @@ Rust friendly bindings to *nix APIs.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Group: # FIXME
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/nix
%package devel
Summary: %{summary}
Group: Development/Libraries/Rust

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate nix
%global real_crate nix-0.24.1
@ -32,6 +33,7 @@ BuildRequires: (crate(lazy_static/default) >= 1.2.0 with crate(lazy_static/defa
BuildRequires: (crate(parking_lot/default) >= 0.11.2 with crate(parking_lot/default) < 0.12.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(semver/default) >= 1.0.0 with crate(semver/default) < 2.0.0~)
BuildRequires: (crate(sysctl/default) >= 0.1.0 with crate(sysctl/default) < 0.2.0~)
BuildRequires: (crate(tempfile/default) >= 3.2.0 with crate(tempfile/default) < 4.0.0~)
%endif
@ -40,18 +42,6 @@ Rust friendly bindings to *nix APIs.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/nix
%package devel
Summary: %{summary}
BuildArch: noarch

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate tokio
%global real_crate tokio-1.19.2
@ -7,7 +8,7 @@
Name: rust-tokio-1.19.2
Version: 1.19.2
Release: %autorelease
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications
License: MIT
URL: https://crates.io/crates/tokio-1.19.2
@ -24,35 +25,30 @@ BuildRequires: (crate(async-stream/default) >= 0.3.0 with crate(async-stream/de
BuildRequires: (crate(futures/async-await) >= 0.3.0 with crate(futures/async-await) < 0.4.0~)
BuildRequires: (crate(futures/default) >= 0.3.0 with crate(futures/default) < 0.4.0~)
BuildRequires: (crate(libc/default) >= 0.2.42 with crate(libc/default) < 0.3.0~)
BuildRequires: (crate(loom/checkpoint) >= 0.5.2 with crate(loom/checkpoint) < 0.6.0~)
BuildRequires: (crate(loom/default) >= 0.5.2 with crate(loom/default) < 0.6.0~)
BuildRequires: (crate(loom/futures) >= 0.5.2 with crate(loom/futures) < 0.6.0~)
BuildRequires: (crate(mio-aio/default) >= 0.6.0 with crate(mio-aio/default) < 0.7.0~)
BuildRequires: (crate(mio-aio/tokio) >= 0.6.0 with crate(mio-aio/tokio) < 0.7.0~)
BuildRequires: (crate(mockall/default) >= 0.11.1 with crate(mockall/default) < 0.12.0~)
BuildRequires: (crate(nix/fs) >= 0.24.0 with crate(nix/fs) < 0.25.0~)
BuildRequires: (crate(nix/socket) >= 0.24.0 with crate(nix/socket) < 0.25.0~)
BuildRequires: (crate(ntapi/default) >= 0.3.6 with crate(ntapi/default) < 0.4.0~)
BuildRequires: (crate(proptest/default) >= 1.0.0 with crate(proptest/default) < 2.0.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(socket2/default) >= 0.4.0 with crate(socket2/default) < 0.5.0~)
BuildRequires: (crate(tempfile/default) >= 3.1.0 with crate(tempfile/default) < 4.0.0~)
BuildRequires: (crate(tokio-stream/default) >= 0.1.0 with crate(tokio-stream/default) < 0.2.0~)
BuildRequires: (crate(tokio-test/default) >= 0.4.0 with crate(tokio-test/default) < 0.5.0~)
BuildRequires: (crate(wasm-bindgen-test/default) >= 0.3.0 with crate(wasm-bindgen-test/default) < 0.4.0~)
%endif
%global _description %{expand:
Event-driven, non-blocking I/O platform for writing asynchronous I/O
backed applications.}
Event-driven, non-blocking I/O platform for writing asynchronous I/O backed
applications.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/tokio
%package devel
Summary: %{summary}
BuildArch: noarch
@ -369,6 +365,30 @@ use the "tokio-macros" feature of the "%{crate}" crate.
%files -n %{name}+tokio-macros-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+tracing-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+tracing-devel %{_description}
This package contains library source intended for building other packages which
use the "tracing" feature of the "%{crate}" crate.
%files -n %{name}+tracing-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+winapi-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+winapi-devel %{_description}
This package contains library source intended for building other packages which
use the "winapi" feature of the "%{crate}" crate.
%files -n %{name}+winapi-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{real_crate}-%{version_no_tilde} -p1
%cargo_prep

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate tokio
%global real_crate tokio-1.19.2
@ -7,7 +8,7 @@
Name: rust-tokio-1.19.2
Version: 1.19.2
Release: %mkrel 1
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications
Group: Development/Rust
License: MIT
@ -27,36 +28,30 @@ BuildRequires: (crate(async-stream/default) >= 0.3.0 with crate(async-stream/de
BuildRequires: (crate(futures/async-await) >= 0.3.0 with crate(futures/async-await) < 0.4.0~)
BuildRequires: (crate(futures/default) >= 0.3.0 with crate(futures/default) < 0.4.0~)
BuildRequires: (crate(libc/default) >= 0.2.42 with crate(libc/default) < 0.3.0~)
BuildRequires: (crate(loom/checkpoint) >= 0.5.2 with crate(loom/checkpoint) < 0.6.0~)
BuildRequires: (crate(loom/default) >= 0.5.2 with crate(loom/default) < 0.6.0~)
BuildRequires: (crate(loom/futures) >= 0.5.2 with crate(loom/futures) < 0.6.0~)
BuildRequires: (crate(mio-aio/default) >= 0.6.0 with crate(mio-aio/default) < 0.7.0~)
BuildRequires: (crate(mio-aio/tokio) >= 0.6.0 with crate(mio-aio/tokio) < 0.7.0~)
BuildRequires: (crate(mockall/default) >= 0.11.1 with crate(mockall/default) < 0.12.0~)
BuildRequires: (crate(nix/fs) >= 0.24.0 with crate(nix/fs) < 0.25.0~)
BuildRequires: (crate(nix/socket) >= 0.24.0 with crate(nix/socket) < 0.25.0~)
BuildRequires: (crate(ntapi/default) >= 0.3.6 with crate(ntapi/default) < 0.4.0~)
BuildRequires: (crate(proptest/default) >= 1.0.0 with crate(proptest/default) < 2.0.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(socket2/default) >= 0.4.0 with crate(socket2/default) < 0.5.0~)
BuildRequires: (crate(tempfile/default) >= 3.1.0 with crate(tempfile/default) < 4.0.0~)
BuildRequires: (crate(tokio-stream/default) >= 0.1.0 with crate(tokio-stream/default) < 0.2.0~)
BuildRequires: (crate(tokio-test/default) >= 0.4.0 with crate(tokio-test/default) < 0.5.0~)
BuildRequires: (crate(wasm-bindgen-test/default) >= 0.3.0 with crate(wasm-bindgen-test/default) < 0.4.0~)
%endif
%global _description %{expand:
Event-driven, non-blocking I/O platform for writing asynchronous I/O
backed applications.}
Event-driven, non-blocking I/O platform for writing asynchronous I/O backed
applications.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Group: # FIXME
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/tokio
%package devel
Summary: %{summary}
Group: Development/Rust
@ -399,6 +394,32 @@ use the "tokio-macros" feature of the "%{crate}" crate.
%files -n %{name}+tokio-macros-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+tracing-devel
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
%description -n %{name}+tracing-devel %{_description}
This package contains library source intended for building other packages which
use the "tracing" feature of the "%{crate}" crate.
%files -n %{name}+tracing-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+winapi-devel
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
%description -n %{name}+winapi-devel %{_description}
This package contains library source intended for building other packages which
use the "winapi" feature of the "%{crate}" crate.
%files -n %{name}+winapi-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{real_crate}-%{version_no_tilde} -p1
%cargo_prep

View file

@ -17,6 +17,7 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate tokio
%global real_crate tokio-1.19.2
@ -24,7 +25,7 @@
Name: rust-tokio-1.19.2
Version: 1.19.2
Release: 0
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications
Group: Development/Libraries/Rust
License: MIT
@ -44,36 +45,30 @@ BuildRequires: (crate(async-stream/default) >= 0.3.0 with crate(async-stream/de
BuildRequires: (crate(futures/async-await) >= 0.3.0 with crate(futures/async-await) < 0.4.0~)
BuildRequires: (crate(futures/default) >= 0.3.0 with crate(futures/default) < 0.4.0~)
BuildRequires: (crate(libc/default) >= 0.2.42 with crate(libc/default) < 0.3.0~)
BuildRequires: (crate(loom/checkpoint) >= 0.5.2 with crate(loom/checkpoint) < 0.6.0~)
BuildRequires: (crate(loom/default) >= 0.5.2 with crate(loom/default) < 0.6.0~)
BuildRequires: (crate(loom/futures) >= 0.5.2 with crate(loom/futures) < 0.6.0~)
BuildRequires: (crate(mio-aio/default) >= 0.6.0 with crate(mio-aio/default) < 0.7.0~)
BuildRequires: (crate(mio-aio/tokio) >= 0.6.0 with crate(mio-aio/tokio) < 0.7.0~)
BuildRequires: (crate(mockall/default) >= 0.11.1 with crate(mockall/default) < 0.12.0~)
BuildRequires: (crate(nix/fs) >= 0.24.0 with crate(nix/fs) < 0.25.0~)
BuildRequires: (crate(nix/socket) >= 0.24.0 with crate(nix/socket) < 0.25.0~)
BuildRequires: (crate(ntapi/default) >= 0.3.6 with crate(ntapi/default) < 0.4.0~)
BuildRequires: (crate(proptest/default) >= 1.0.0 with crate(proptest/default) < 2.0.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(socket2/default) >= 0.4.0 with crate(socket2/default) < 0.5.0~)
BuildRequires: (crate(tempfile/default) >= 3.1.0 with crate(tempfile/default) < 4.0.0~)
BuildRequires: (crate(tokio-stream/default) >= 0.1.0 with crate(tokio-stream/default) < 0.2.0~)
BuildRequires: (crate(tokio-test/default) >= 0.4.0 with crate(tokio-test/default) < 0.5.0~)
BuildRequires: (crate(wasm-bindgen-test/default) >= 0.3.0 with crate(wasm-bindgen-test/default) < 0.4.0~)
%endif
%global _description %{expand:
Event-driven, non-blocking I/O platform for writing asynchronous I/O
backed applications.}
Event-driven, non-blocking I/O platform for writing asynchronous I/O backed
applications.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
Group: # FIXME
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/tokio
%package devel
Summary: %{summary}
Group: Development/Libraries/Rust
@ -416,6 +411,32 @@ use the "tokio-macros" feature of the "%{crate}" crate.
%files -n %{name}+tokio-macros-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+tracing-devel
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
%description -n %{name}+tracing-devel %{_description}
This package contains library source intended for building other packages which
use the "tracing" feature of the "%{crate}" crate.
%files -n %{name}+tracing-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+winapi-devel
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
%description -n %{name}+winapi-devel %{_description}
This package contains library source intended for building other packages which
use the "winapi" feature of the "%{crate}" crate.
%files -n %{name}+winapi-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{real_crate}-%{version_no_tilde} -p1
%cargo_prep

View file

@ -1,5 +1,6 @@
# Generated by rust2rpm NNN
%bcond_without check
%global debug_package %{nil}
%global crate tokio
%global real_crate tokio-1.19.2
@ -7,7 +8,7 @@
Name: rust-tokio-1.19.2
Version: 1.19.2
Release: 1%{?dist}
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O
Summary: Event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications
License: MIT
URL: https://crates.io/crates/tokio-1.19.2
@ -26,35 +27,30 @@ BuildRequires: (crate(async-stream/default) >= 0.3.0 with crate(async-stream/de
BuildRequires: (crate(futures/async-await) >= 0.3.0 with crate(futures/async-await) < 0.4.0~)
BuildRequires: (crate(futures/default) >= 0.3.0 with crate(futures/default) < 0.4.0~)
BuildRequires: (crate(libc/default) >= 0.2.42 with crate(libc/default) < 0.3.0~)
BuildRequires: (crate(loom/checkpoint) >= 0.5.2 with crate(loom/checkpoint) < 0.6.0~)
BuildRequires: (crate(loom/default) >= 0.5.2 with crate(loom/default) < 0.6.0~)
BuildRequires: (crate(loom/futures) >= 0.5.2 with crate(loom/futures) < 0.6.0~)
BuildRequires: (crate(mio-aio/default) >= 0.6.0 with crate(mio-aio/default) < 0.7.0~)
BuildRequires: (crate(mio-aio/tokio) >= 0.6.0 with crate(mio-aio/tokio) < 0.7.0~)
BuildRequires: (crate(mockall/default) >= 0.11.1 with crate(mockall/default) < 0.12.0~)
BuildRequires: (crate(nix/fs) >= 0.24.0 with crate(nix/fs) < 0.25.0~)
BuildRequires: (crate(nix/socket) >= 0.24.0 with crate(nix/socket) < 0.25.0~)
BuildRequires: (crate(ntapi/default) >= 0.3.6 with crate(ntapi/default) < 0.4.0~)
BuildRequires: (crate(proptest/default) >= 1.0.0 with crate(proptest/default) < 2.0.0~)
BuildRequires: (crate(rand/default) >= 0.8.0 with crate(rand/default) < 0.9.0~)
BuildRequires: (crate(socket2/default) >= 0.4.0 with crate(socket2/default) < 0.5.0~)
BuildRequires: (crate(tempfile/default) >= 3.1.0 with crate(tempfile/default) < 4.0.0~)
BuildRequires: (crate(tokio-stream/default) >= 0.1.0 with crate(tokio-stream/default) < 0.2.0~)
BuildRequires: (crate(tokio-test/default) >= 0.4.0 with crate(tokio-test/default) < 0.5.0~)
BuildRequires: (crate(wasm-bindgen-test/default) >= 0.3.0 with crate(wasm-bindgen-test/default) < 0.4.0~)
%endif
%global _description %{expand:
Event-driven, non-blocking I/O platform for writing asynchronous I/O
backed applications.}
Event-driven, non-blocking I/O platform for writing asynchronous I/O backed
applications.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%license LIC1
%license LIC2
%doc DOC1
%doc DOC2
%{_bindir}/tokio
%package devel
Summary: %{summary}
BuildArch: noarch
@ -251,6 +247,7 @@ Requires: cargo
Requires: (crate(mio/net) >= 0.8.1 with crate(mio/net) < 0.9.0~)
Requires: (crate(mio/os-ext) >= 0.8.1 with crate(mio/os-ext) < 0.9.0~)
Requires: (crate(mio/os-poll) >= 0.8.1 with crate(mio/os-poll) < 0.9.0~)
Requires: (crate(winapi/namedpipeapi) >= 0.3.8 with crate(winapi/namedpipeapi) < 0.4.0~)
Requires: crate(tokio) = 1.19.2
Requires: crate(tokio/libc) = 1.19.2
Requires: crate(tokio/socket2) = 1.19.2
@ -319,6 +316,7 @@ Requires: cargo
Requires: (crate(mio/net) >= 0.8.1 with crate(mio/net) < 0.9.0~)
Requires: (crate(mio/os-ext) >= 0.8.1 with crate(mio/os-ext) < 0.9.0~)
Requires: (crate(mio/os-poll) >= 0.8.1 with crate(mio/os-poll) < 0.9.0~)
Requires: (crate(winapi/threadpoollegacyapiset) >= 0.3.8 with crate(winapi/threadpoollegacyapiset) < 0.4.0~)
Requires: crate(tokio) = 1.19.2
Requires: crate(tokio/bytes) = 1.19.2
Requires: crate(tokio/libc) = 1.19.2
@ -374,6 +372,7 @@ Requires: cargo
Requires: (crate(mio/net) >= 0.8.1 with crate(mio/net) < 0.9.0~)
Requires: (crate(mio/os-ext) >= 0.8.1 with crate(mio/os-ext) < 0.9.0~)
Requires: (crate(mio/os-poll) >= 0.8.1 with crate(mio/os-poll) < 0.9.0~)
Requires: (crate(winapi/consoleapi) >= 0.3.8 with crate(winapi/consoleapi) < 0.4.0~)
Requires: crate(tokio) = 1.19.2
Requires: crate(tokio/libc) = 1.19.2
Requires: crate(tokio/once_cell) = 1.19.2
@ -499,6 +498,43 @@ use the "tokio-macros" feature of the "%{crate}" crate.
%files -n %{name}+tokio-macros-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+tracing-devel
Summary: %{summary}
BuildArch: noarch
Provides: crate(tokio/tracing) = 1.19.2
Requires: cargo
Requires: (crate(tracing/std) >= 0.1.25 with crate(tracing/std) < 0.2.0~)
Requires: crate(tokio) = 1.19.2
%description -n %{name}+tracing-devel %{_description}
This package contains library source intended for building other packages which
use the "tracing" feature of the "%{crate}" crate.
%files -n %{name}+tracing-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+winapi-devel
Summary: %{summary}
BuildArch: noarch
Provides: crate(tokio/winapi) = 1.19.2
Requires: cargo
Requires: (crate(winapi/handleapi) >= 0.3.8 with crate(winapi/handleapi) < 0.4.0~)
Requires: (crate(winapi/mswsock) >= 0.3.8 with crate(winapi/mswsock) < 0.4.0~)
Requires: (crate(winapi/std) >= 0.3.8 with crate(winapi/std) < 0.4.0~)
Requires: (crate(winapi/winsock2) >= 0.3.8 with crate(winapi/winsock2) < 0.4.0~)
Requires: (crate(winapi/ws2ipdef) >= 0.3.8 with crate(winapi/ws2ipdef) < 0.4.0~)
Requires: (crate(winapi/ws2tcpip) >= 0.3.8 with crate(winapi/ws2tcpip) < 0.4.0~)
Requires: crate(tokio) = 1.19.2
%description -n %{name}+winapi-devel %{_description}
This package contains library source intended for building other packages which
use the "winapi" feature of the "%{crate}" crate.
%files -n %{name}+winapi-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{real_crate}-%{version_no_tilde} -p1
%cargo_prep

View file

@ -1,12 +1,12 @@
from importlib import resources
import os
from pathlib import Path
import re
import time
import pytest
from cargo2rpm.metadata import Metadata
from rust2rpm.core.metadata import Metadata as OldMetadata
from rust2rpm.generator import to_list, spec_file_render
from rust2rpm.__main__ import get_parser, package_name_suffixed, drop_foreign_dependencies
@ -29,23 +29,33 @@ def test_to_list():
FIXED_DATE = time.gmtime(12345)
@pytest.mark.parametrize("filename", ["cxx-build-1.0.71.json", "nix-0.24.1.json", "tokio-1.19.2.json"])
@pytest.mark.parametrize("filename", ["cxx-build-1.0.71.toml", "nix-0.24.1.toml", "tokio-1.19.2.toml"])
@pytest.mark.parametrize("target", ["plain", "fedora", "mageia", "opensuse"])
def test_spec_file_render(filename: str, target: str):
crate = filename.removesuffix(".crate")
def test_spec_file_render(filename: str, target: str, tmp_path: Path):
crate = filename.removesuffix(".toml")
args = get_parser().parse_args(["foobar", f"--target={target}", "-a" if target == "fedora" else "--no-rpmautospec"])
pkg_name = package_name_suffixed(crate, args.suffix)
metadata = Metadata.from_json(resources.files("rust2rpm.tests.samples").joinpath(filename).read_text())
real_path = resources.files("rust2rpm.tests.samples").joinpath(filename)
fake_path = tmp_path.joinpath("Cargo.toml")
with open(real_path) as file, open(fake_path, "w") as fake:
print("Copying", real_path, "to", fake_path)
fake.write(file.read())
(tmp_path / "src").mkdir()
(tmp_path / "src" / "lib.rs").write_text("")
metadata = OldMetadata.from_file(fake_path)[0]
rendered = spec_file_render(
args=args,
pkg_name=pkg_name,
crate=crate,
metadata=metadata,
patch_file_automatic=None,
patch_file_manual=None,
patch_file_automatic=f"{crate}-patch1.diff",
patch_file_manual=f"{crate}-patch2.diff",
packager="Jane Jane <jane@jane.org>",
doc_files=["DOC1", "DOC2"],
license_files=["LIC1", "LIC2"],