* Thu Feb 13 2025 Jean-Philippe Pialasse <jpp@koozali.org> 4.43.1-6.sme

- first SME 11 import
- update spec to build in koji
- add bash completion
- build debugsource
This commit is contained in:
Jean-Philippe Pialasse 2025-02-13 02:07:32 -05:00
parent 84d4f50915
commit f857693cdc
4 changed files with 95 additions and 41 deletions

BIN
vendor.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
yq-4.43.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,29 @@
From 6908161f1fb6713db8259909c606109770fe7673 Mon Sep 17 00:00:00 2001
From: Marco Vito Moscaritolo <mavimo@gmail.com>
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)
}

101
yq.spec
View File

@ -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 <brianr@koozali.org> 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 <dir> 'attr(755,user,grp)' \
#--file <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 <jpp@koozali.org> 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 <salimma@fedoraproject.org> - 4.43.1-5
- Fix building with Go 1.24; Resolves: RHBZ#2341595
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 4.43.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.43.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Apr 23 2024 Michel Lind <salimma@fedoraproject.org> - 4.43.1-2
- Fix goipath and remove gopkg, thanks mikelo2
* Tue Apr 23 2024 Michel Lind <salimma@fedoraproject.org> - 4.43.1-1
- Initial package (rhbz#2276522)
## END: Generated by rpmautospec