From e8c926fed923dbc0ccd0d6a9d86013194b9d09cb Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 14 Mar 2019 02:13:30 +0100 Subject: [PATCH] Initial import Signed-off-by: Igor Gnatenko --- .gitignore | 1 + .rust2rpm.conf | 3 ++ open-fix-metadata.diff | 15 +++++++++ rust-open.spec | 76 ++++++++++++++++++++++++++++++++++++++++++ sources | 1 + tests/.fmf/version | 1 + tests/provision.fmf | 5 +++ tests/tests.yml | 13 ++++++++ 8 files changed, 115 insertions(+) create mode 100644 .gitignore create mode 100644 .rust2rpm.conf create mode 100644 open-fix-metadata.diff create mode 100644 rust-open.spec create mode 100644 sources create mode 100644 tests/.fmf/version create mode 100644 tests/provision.fmf create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..73d832d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/open-1.2.2.crate diff --git a/.rust2rpm.conf b/.rust2rpm.conf new file mode 100644 index 0000000..37730d3 --- /dev/null +++ b/.rust2rpm.conf @@ -0,0 +1,3 @@ +[DEFAULT] +lib.requires = + /usr/bin/xdg-open diff --git a/open-fix-metadata.diff b/open-fix-metadata.diff new file mode 100644 index 0000000..200c4c3 --- /dev/null +++ b/open-fix-metadata.diff @@ -0,0 +1,15 @@ +--- open-1.2.2/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ open-1.2.2/Cargo.toml 2019-03-14T00:09:01.196574+01:00 +@@ -19,11 +19,9 @@ + keywords = ["open", "xdg-open", "start", "launch"] + license = "MIT" + repository = "https://github.com/Byron/open-rs" ++exclude = ["/etc/*", "/.clog.toml", "/.travis.yml"] + + [[bin]] + name = "open" + test = false + doc = false +-[target."cfg(windows)".dependencies.winapi] +-version = "0.3" +-features = ["shellapi"] diff --git a/rust-open.spec b/rust-open.spec new file mode 100644 index 0000000..857e0a7 --- /dev/null +++ b/rust-open.spec @@ -0,0 +1,76 @@ +# Generated by rust2rpm +%bcond_with check +%global debug_package %{nil} + +# Binary is useless +%global __cargo_is_bin() false + +%global crate open + +Name: rust-%{crate} +Version: 1.2.2 +Release: 1%{?dist} +Summary: Open a path or URL using the program configured on the system + +License: MIT +URL: https://crates.io/crates/open +Source: %{crates_source} +# Initial patched metadata +# * No windows +# * Exclude unneeded files, https://github.com/Byron/open-rs/pull/18 +Patch0: open-fix-metadata.diff + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging + +%global _description \ +Open a path or URL using the program configured on the system. + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch +Requires: /usr/bin/xdg-open + +%description devel %{_description} + +This package contains library source intended for building other packages +which use "%{crate}" crate. + +%files devel +%license LICENSE.md +%doc README.md changelog.md +%{cargo_registry}/%{crate}-%{version}/ + +%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 "default" feature of "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Thu Mar 14 2019 Igor Gnatenko - 1.2.2-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..1085dad --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (open-1.2.2.crate) = 1485d026f9db2a65d84f481e5da8777aeada7666554b95030e1f203898e4ee94b516a8b95907d6c232fc3e6f3f0263eb85fd5aff0fdd02612c74c1df6a1ea0f9 diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..503a97c --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,5 @@ +--- +standard-inventory-qcow2: + qemu: + # `cargo test` usually eats more than 1G. + m: 4G diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..b896891 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,13 @@ +--- +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + repositories: + - repo: "https://src.fedoraproject.org/tests/rust.git" + dest: rust + tests: + - rust/cargo-test + environment: + pkg: rust-open