summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-07-29 02:39:48 +0000
committerCoprDistGit <infra@openeuler.org>2024-07-29 02:39:48 +0000
commit49a3bbcd076b2683761372a05fbfa5b39b87b0b1 (patch)
tree3bae88bde3ee4f8565f5046501e2e8fcd5524204
parentbb3f927ec1570f209cadcdc671e07948d66aea05 (diff)
automatic import of rust-ripgrep
-rw-r--r--.gitignore2
-rw-r--r--cargo_config5
-rw-r--r--rust-ripgrep.spec39
-rw-r--r--sources2
4 files changed, 48 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..7488ee2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/14.1.0.tar.gz
+/vendor.tar.xz
diff --git a/cargo_config b/cargo_config
new file mode 100644
index 0000000..0236928
--- /dev/null
+++ b/cargo_config
@@ -0,0 +1,5 @@
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "vendor"
diff --git a/rust-ripgrep.spec b/rust-ripgrep.spec
new file mode 100644
index 0000000..b1906f5
--- /dev/null
+++ b/rust-ripgrep.spec
@@ -0,0 +1,39 @@
+%global debug_package %{nil}
+%global crate_name ripgrep
+
+Name: rust-ripgrep
+Version: 14.1.0
+Release: 1
+Summary: Line-oriented search tool
+License: Unlicense OR MIT
+URL: https://crates.io/crates/cbindgen
+Source0: https://github.com/BurntSushi/ripgrep/archive/refs/tags/%{version}.tar.gz
+Source1: vendor.tar.xz
+Source2: cargo_config
+
+%global _description %{expand:
+Ripgrep is a line-oriented search tool that recursively searches the
+current directory for a regex pattern while respecting gitignore rules.
+ripgrep has first class support on Windows, macOS and Linux.}
+
+%description %{_description}
+
+%prep
+%setup -q -T -b 0 -n %{crate_name}-%{version}
+%setup -q -D -T -a 1 -n %{crate_name}-%{version}
+cp %{SOURCE2} .cargo/config.toml
+
+%build
+cargo build --release
+
+%install
+export CARGO_HOME=`pwd`/cargo-home/
+# cargo install appends /bin to the path
+cargo install --root=%{buildroot}%{_prefix} --path .
+# remove spurious files
+rm -f %{buildroot}%{_prefix}/.crates.toml
+rm -f %{buildroot}%{_prefix}/.crates2.json
+
+%files
+%license UNLICENSE
+%{_bindir}/rg
diff --git a/sources b/sources
new file mode 100644
index 0000000..4f846a7
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+ad6b5631a459fd20c257ca20a7eeaf73 14.1.0.tar.gz
+9c9df5fdf0908b99ed2f04531be3e875 vendor.tar.xz