summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-09-15 11:38:42 +0000
committerCoprDistGit <infra@openeuler.org>2025-09-15 11:38:42 +0000
commitbf06fcb733fe8fe0e8eb356c29d49a4186abd4a4 (patch)
treed7be617a5a8e4328a0b7f615174c2a1ef1fc0c4a
parent356727e12aa8ee17dcd9b8315b0aca134ab793b1 (diff)
-rw-r--r--.gitignore2
-rw-r--r--sources2
-rw-r--r--yq.spec113
3 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..f391586 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/vendor.tar.gz
+/yq-4.47.1.tar.gz
diff --git a/sources b/sources
new file mode 100644
index 0000000..ac2608b
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+b552a80037f265438238977e686ddf07 vendor.tar.gz
+7e4ea6944ac22ef085dc8eccc8e979e0 yq-4.47.1.tar.gz
diff --git a/yq.spec b/yq.spec
new file mode 100644
index 0000000..681202a
--- /dev/null
+++ b/yq.spec
@@ -0,0 +1,113 @@
+#
+# spec file for package yq
+#
+# Copyright (c) 2023 SUSE LLC
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
+#
+
+
+%global provider_prefix github.com/mikefarah/yq
+%global import_path %{provider_prefix}
+
+Name: yq
+Version: 4.47.1
+Release: 1
+Summary: A portable command-line YAML processor
+License: MIT
+URL: https://github.com/mikefarah/yq
+Source0: https://github.com/mikefarah/yq/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+Source1: vendor.tar.gz
+# conflict with all python3X-yq packages since they install /usr/bin/yq
+# we need to handle Leap 15.4 specially since the python3dist() is not
+# generated there
+%if 0%{?suse_version} >= 1550
+Conflicts: python3dist(yq)
+%else
+Conflicts: python3-yq
+%endif
+BuildRequires: golang
+
+%description
+A lightweight and portable command-line YAML processor. yq uses jq like syntax
+but works with yaml files as well as json. It doesn't yet support everything
+jq does - but it does support the most common operations and functions, and more
+is being added continuously.
+
+%package bash-completion
+Summary: Bash Completion for %{name}
+Requires: %{name} = %{version}
+Supplements: (%{name} and bash-completion)
+BuildArch: noarch
+
+%description bash-completion
+Bash command line completion support for %{name}.
+
+%package zsh-completion
+Summary: Zsh Completion for %{name}
+Requires: %{name} = %{version}
+Supplements: (%{name} and zsh)
+BuildArch: noarch
+
+%description zsh-completion
+Zsh command line completion support for %{name}.
+
+%package fish-completion
+Summary: Fish Completion for %{name}
+Requires: %{name} = %{version}
+Supplements: (%{name} and fish)
+BuildArch: noarch
+
+%description fish-completion
+Fish command line completion support for %{name}.
+
+%prep
+%setup -qa1
+
+%build
+go build -buildmode=pie -mod=vendor -ldflags="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -o bin/%{name}
+
+%install
+install -D -m 0755 ./bin/%{name} "%{buildroot}/%{_bindir}/%{name}"
+mkdir -p %{buildroot}%{_datarootdir}/bash-completion/completions
+%{buildroot}/%{_bindir}/%{name} shell-completion bash > %{buildroot}%{_datarootdir}/bash-completion/completions/%{name}
+mkdir -p %{buildroot}%{_datarootdir}/zsh_completion.d
+%{buildroot}/%{_bindir}/%{name} shell-completion zsh > %{buildroot}%{_datarootdir}/zsh_completion.d/_%{name}
+mkdir -p %{buildroot}%{_datadir}/fish/vendor_completions.d
+%{buildroot}/%{_bindir}/%{name} shell-completion fish > %{buildroot}%{_datarootdir}/fish/vendor_completions.d/%{name}.fish
+
+%files bash-completion
+%defattr(-,root,root)
+%dir %{_datarootdir}/bash-completion/completions/
+%{_datarootdir}/bash-completion/completions/%{name}
+
+%files zsh-completion
+%defattr(-,root,root)
+%dir %{_datarootdir}/zsh_completion.d/
+%{_datarootdir}/zsh_completion.d/_%{name}
+
+%files fish-completion
+%defattr(-,root,root)
+%dir %{_datarootdir}/fish
+%dir %{_datarootdir}/fish/vendor_completions.d
+%{_datarootdir}/fish/vendor_completions.d/%{name}.fish
+
+%files
+%{_bindir}/%{name}
+%license LICENSE
+%doc README.md
+
+
+%changelog
+
+* Tue Oct 19 2021 rombert@apache.org
+- Initial package