diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..4a8e140 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e3ad7cd4c1d3fba5db19d27ad6586a249e56716004960fa1ccddfb55bf18196 +size 3246132 diff --git a/yq-4.43.1.tar.gz b/yq-4.43.1.tar.gz new file mode 100644 index 0000000..3affd2a --- /dev/null +++ b/yq-4.43.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5581d28bae2bcdf70501dfd251233c592eb3e39a210956ee74965b784435d63 +size 298557 diff --git a/yq-go1_24-replace_error_creation.diff b/yq-go1_24-replace_error_creation.diff new file mode 100644 index 0000000..617187a --- /dev/null +++ b/yq-go1_24-replace_error_creation.diff @@ -0,0 +1,29 @@ +From 6908161f1fb6713db8259909c606109770fe7673 Mon Sep 17 00:00:00 2001 +From: Marco Vito Moscaritolo +Date: Mon, 11 Nov 2024 14:06:04 +0100 +Subject: [PATCH] replace error creation + +--- + pkg/yqlib/operator_error.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pkg/yqlib/operator_error.go b/pkg/yqlib/operator_error.go +index 1a2283de87..d6a2b67fed 100644 +--- a/pkg/yqlib/operator_error.go ++++ b/pkg/yqlib/operator_error.go +@@ -1,7 +1,7 @@ + package yqlib + + import ( +- "fmt" ++ "errors" + ) + + func errorOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) { +@@ -16,5 +16,5 @@ func errorOperator(d *dataTreeNavigator, context Context, expressionNode *Expres + if rhs.MatchingNodes.Len() > 0 { + errorMessage = rhs.MatchingNodes.Front().Value.(*CandidateNode).Value + } +- return Context{}, fmt.Errorf(errorMessage) ++ return Context{}, errors.New(errorMessage) + } diff --git a/yq.spec b/yq.spec index 53aed7a..7c4b6f3 100644 --- a/yq.spec +++ b/yq.spec @@ -1,55 +1,74 @@ -%define name yq -%define version 1.0 -%define release 1 -Summary: This is what yq does. -Name: %{name} -Version: %{version} -Release: %{release}%{?dist} -Source: %{name}-%{version}.tar.gz -License: GNU GPL version 2 -Group: SMEserver/addon -BuildRoot: %{_tmppath}/%{name}-buildroot -Prefix: %{_prefix} -BuildArchitectures: noarch -BuildRequires: smeserver-devtools -Requires: smeserver-release >= 11.0 -AutoReqProv: no +%bcond_with check -%description -Yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties -processor. +%global golicenses LICENSE +%global godocs examples CODE_OF_CONDUCT.md how-it-works.md project-\\\ + words.txt release_instructions.txt CONTRIBUTING.md\\\ + README.md release_notes.txt -%changelog -* Day MMMM DD YYYY 1.0-1.sme -- Initial code - create RPM [SME:99999] +Name: yq +Version: 4.43.1 +Release: 6%{dist} +Summary: Yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties 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 +Patch1: https://github.com/mikefarah/yq/commit/6908161f1fb6713db8259909c606109770fe7673.patch#/yq-go1_24-replace_error_creation.diff +BuildRequires: go-srpm-macros, 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. %prep +%setup -qa1 -%setup -q %build +go build -buildmode=pie -mod=vendor -o bin/%{name} -ldflags=-compressdwarf=false %install -rm -rf $RPM_BUILD_ROOT -(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) -rm -f %{name}-%{version}-filelist -/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ -> %{name}-%{version}-filelist -#echo "%doc COPYING" >> %{name}-%{version}-filelist -#--dir 'attr(755,user,grp)' \ -#--file 'attr(755,root,root)' \ +install -m 0755 -vd %{buildroot}%{_bindir} +install -D -m 0755 ./bin/%{name} "%{buildroot}/%{_bindir}/%{name}" -%clean -cd .. -rm -rf %{name}-%{version} +mkdir -p %{buildroot}%{_datadir}/bash-completion/completions +%{buildroot}/%{_bindir}/%{name} shell-completion bash > %{buildroot}%{_datadir}/bash-completion/completions/%{name} -%pre -%preun +%if %{with check} +%check +%gocheck +%endif -%post +%files +%license LICENSE +%doc examples CODE_OF_CONDUCT.md how-it-works.md project-words.txt +%doc release_instructions.txt CONTRIBUTING.md README.md release_notes.txt +%{_bindir}/yq +%{_datadir}/bash-completion/completions/%{name} -%postun -#uninstall -%files -f %{name}-%{version}-filelist -%defattr(-,root,root) +%changelog +* Thu Feb 13 2025 Jean-Philippe Pialasse 4.43.1-6.sme +- first SME 11 import +- update spec to build in koji +- add bash completion +- build debugsource + +* Sun Jan 26 2025 Michel Lind - 4.43.1-5 +- Fix building with Go 1.24; Resolves: RHBZ#2341595 + +* Sun Jan 19 2025 Fedora Release Engineering - 4.43.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sat Jul 20 2024 Fedora Release Engineering - 4.43.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Apr 23 2024 Michel Lind - 4.43.1-2 +- Fix goipath and remove gopkg, thanks mikelo2 + +* Tue Apr 23 2024 Michel Lind - 4.43.1-1 +- Initial package (rhbz#2276522) +## END: Generated by rpmautospec