From a616822c17c82739c8a2dc6048c9969182e1ea83 Mon Sep 17 00:00:00 2001 From: madomado Date: Mon, 30 Oct 2023 14:25:04 +0800 Subject: [PATCH] fix: youki --- anda/rust/youki/anda.hcl | 2 +- anda/rust/youki/rust-youki.spec | 58 ++++++++++++++++++++++++++++++ anda/rust/youki/update.rhai | 2 +- anda/rust/youki/youki.spec | 62 --------------------------------- 4 files changed, 60 insertions(+), 64 deletions(-) create mode 100644 anda/rust/youki/rust-youki.spec delete mode 100644 anda/rust/youki/youki.spec diff --git a/anda/rust/youki/anda.hcl b/anda/rust/youki/anda.hcl index 400560e42f..57d84ec6d5 100644 --- a/anda/rust/youki/anda.hcl +++ b/anda/rust/youki/anda.hcl @@ -1,6 +1,6 @@ project pkg { rpm { - spec = "youki.spec" + spec = "rust-youki.spec" // enable_scm = true diff --git a/anda/rust/youki/rust-youki.spec b/anda/rust/youki/rust-youki.spec new file mode 100644 index 0000000000..03ddf728ec --- /dev/null +++ b/anda/rust/youki/rust-youki.spec @@ -0,0 +1,58 @@ +# Generated by rust2rpm 25 +#bcond_without check + +%global crate youki + +Name: rust-youki +Version: 0.3.0 +Release: %autorelease +Summary: Container runtime written in Rust + +License: None +URL: https://crates.io/crates/youki +Source: %{crates_source} + +BuildRequires: anda-srpm-macros cargo-rpm-macros >= 24 +BuildRequires: pkg-config +BuildRequires: systemd-devel +BuildRequires: dbus-devel +BuildRequires: libseccomp-devel +BuildRequires: elfutils-libelf-devel +BuildRequires: binutils + +%global _description %{expand: +A container runtime written in Rust.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: Apache-2.0 + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%doc README.md +%{_bindir}/youki + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep_online + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/anda/rust/youki/update.rhai b/anda/rust/youki/update.rhai index 1a65ed0082..628c1b1619 100644 --- a/anda/rust/youki/update.rhai +++ b/anda/rust/youki/update.rhai @@ -1 +1 @@ -rpm.version(gh("containers/youki")); +rpm.version(crates("youki")); diff --git a/anda/rust/youki/youki.spec b/anda/rust/youki/youki.spec deleted file mode 100644 index 17d5ed0bac..0000000000 --- a/anda/rust/youki/youki.spec +++ /dev/null @@ -1,62 +0,0 @@ -Name: youki -Version: 0.3.0 -Release: 1%{?dist} -Summary: A container runtime written in Rust - -License: Apache-2.0 -URL: https://github.com/containers/youki -Source0: https://github.com/containers/youki/archive/refs/tags/v%{version}.tar.gz - -BuildRequires: pkg-config -BuildRequires: rust-packaging -BuildRequires: anda-srpm-macros -BuildRequires: systemd-devel -BuildRequires: git-core -BuildRequires: dbus-devel -BuildRequires: libseccomp-devel -BuildRequires: elfutils-libelf-devel -BuildRequires: binutils -BuildRequires: fdupes - -%description -youki is an implementation of the OCI runtime-spec in Rust, similar to runc. - -%prep -%autosetup -n youki-%{version} -S git -v -p0 - -git remote add origin https://github.com/containers/youki -git fetch origin -git checkout v%{version} - -# add host key for github -# mkdir -p ~/.ssh -# ssh-keyscan github.com >> ~/.ssh/known_hosts - -git submodule set-url integration_tests/oci-runtime-tests https://github.com/opencontainers/runtime-tools -git submodule sync - -# download git submodules -git submodule update --init --recursive - -%cargo_prep_online - - -%build - -pushd crates/ -%cargo_build - - -%install -install -D -m 0755 target/release/youki %{buildroot}%{_bindir}/youki -%fdupes docs/ - -%files -%license LICENSE -%doc docs -%{_bindir}/youki - - -%changelog -* Wed Oct 05 2022 Cappy Ishihara - 0.0.5-1 -- Initial Release