From 6c3cd4286893067fc3901e4e50f6d26d5651a54b Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 4 Dec 2017 16:15:24 +0100 Subject: [PATCH] initial import Signed-off-by: Igor Gnatenko --- .gitignore | 1 + ...e-directory-if-debug-is-missing.-fix.patch | 31 +++++++++ rust-goblin.spec | 69 +++++++++++++++++++ sources | 1 + 4 files changed, 102 insertions(+) create mode 100644 .gitignore create mode 100644 0001-tests-use-release-directory-if-debug-is-missing.-fix.patch create mode 100644 rust-goblin.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57b5336 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/goblin-0.0.12.crate diff --git a/0001-tests-use-release-directory-if-debug-is-missing.-fix.patch b/0001-tests-use-release-directory-if-debug-is-missing.-fix.patch new file mode 100644 index 0000000..2af33b9 --- /dev/null +++ b/0001-tests-use-release-directory-if-debug-is-missing.-fix.patch @@ -0,0 +1,31 @@ +From 7ba903ad760e27737807221e528380e474bc5b55 Mon Sep 17 00:00:00 2001 +From: m4b +Date: Sun, 3 Dec 2017 21:02:15 -0800 +Subject: [PATCH] tests: use release directory if debug is missing. fixes #63 + +--- + tests/archive.rs | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests/archive.rs b/tests/archive.rs +index c61b42c..144d0ae 100644 +--- a/tests/archive.rs ++++ b/tests/archive.rs +@@ -54,8 +54,13 @@ fn parse_archive() { + + #[test] + fn parse_self() { ++ use std::fs; + use std::io::Read; +- let path = Path::new("target").join("debug").join("libgoblin.rlib"); ++ let mut path = Path::new("target").join("debug").join("libgoblin.rlib"); ++ // https://github.com/m4b/goblin/issues/63 ++ if !fs::metadata(&path).is_ok() { ++ path = Path::new("target").join("release").join("libgoblin.rlib"); ++ } + let buffer = { + let mut fd = File::open(path).expect("open file"); + let mut v = Vec::new(); +-- +2.15.1 + diff --git a/rust-goblin.spec b/rust-goblin.spec new file mode 100644 index 0000000..6b95b33 --- /dev/null +++ b/rust-goblin.spec @@ -0,0 +1,69 @@ +# Generated by rust2rpm +%bcond_without check +%global debug_package %{nil} + +%global crate goblin + +Name: rust-%{crate} +Version: 0.0.12 +Release: 2%{?dist} +Summary: Impish, cross-platform binary parsing and loading crate + +License: MIT +URL: https://crates.io/crates/goblin +Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# https://github.com/m4b/goblin/commit/7ba903ad760e27737807221e528380e474bc5b55 +Patch0: 0001-tests-use-release-directory-if-debug-is-missing.-fix.patch + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging +# [dependencies] +BuildRequires: (crate(log) >= 0.3.8 with crate(log) < 0.4.0) +BuildRequires: (crate(plain) >= 0.2.1 with crate(plain) < 0.3.0) +BuildRequires: (crate(scroll) >= 0.7.0 with crate(scroll) < 0.8.0) +BuildRequires: (crate(scroll_derive) >= 0.8.0 with crate(scroll_derive) < 0.9.0) +%if %{with check} +# [dev-dependencies] +BuildRequires: (crate(env_logger) >= 0.4.3 with crate(env_logger) < 0.5.0) +%endif + +%description +%{summary}. + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel +An impish, cross-platform binary parsing and loading crate. + +This package contains library source intended for building other packages +which use %{crate} from crates.io. + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%files devel +%license LICENSE +%doc CHANGELOG.md README.md +%{cargo_registry}/%{crate}-%{version}/ + +%changelog +* Mon Dec 04 2017 Igor Gnatenko - 0.0.12-2 +- Fix tests + +* Sun Dec 03 2017 Igor Gnatenko - 0.0.12-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..d5bbc1f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (goblin-0.0.12.crate) = b8a9eb3dcc8d1e2017e4ee15035abb1db898db6cf648554cd4dbdef815c9987226e48415a40df80aa04fda9902d3767c7abf1e13cb6e8f8476e81c8ded4b36e6