1 %define vendor_ver 4.30.8
3 Summary: Command-line YAML, JSON, XML, CSV and properties processor
8 Group: Applications/Text
9 Source0: https://github.com/mikefarah/yq/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5: 78ccc739a27454c9564019a3a0515906
11 Source1: %{name}-vendor-%{vendor_ver}.tar.xz
12 # Source1-md5: 00401f6d57414f386cea4893efabdfa9
13 URL: https://mikefarah.gitbook.io/yq/
14 BuildRequires: golang >= 1.19
15 BuildRequires: rpm-build >= 4.6
16 BuildRequires: rpmbuild(macros) >= 2.009
17 BuildRequires: tar >= 1:1.22
19 ExclusiveArch: %go_arches
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _debugsource_packages 0
25 A lightweight and portable command-line YAML, JSON and XML processor.
26 yq uses jq like syntax but works with yaml files as well as json, xml,
27 properties, csv and tsv. It doesn't yet support everything jq does -
28 but it does support the most common operations and functions, and more
29 is being added continuously.
31 %package -n bash-completion-yq
32 Summary: Bash completion for yq command line
33 Group: Applications/Shells
34 Requires: %{name} = %{version}-%{release}
35 Requires: bash-completion >= 1:2.0
38 %description -n bash-completion-yq
39 Bash completion for yq command line.
41 %package -n fish-completion-yq
42 Summary: fish-completion for yq
43 Group: Applications/Shells
44 Requires: %{name} = %{version}-%{release}
48 %description -n fish-completion-yq
49 fish-completion for yq.
51 %package -n zsh-completion-yq
52 Summary: ZSH completion for yq command line
53 Group: Applications/Shells
54 Requires: %{name} = %{version}-%{release}
58 %description -n zsh-completion-yq
59 ZSH completion for yq command line.
63 %{__mv} %{name}-%{vendor_ver}/vendor .
66 %__go build -v -mod=vendor -o target/yq
69 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT{%{_bindir},%{bash_compdir},%{fish_compdir},%{zsh_compdir}}
73 cp -p target/yq $RPM_BUILD_ROOT%{_bindir}/yq
75 ./target/yq shell-completion bash > $RPM_BUILD_ROOT%{bash_compdir}/yq
76 ./target/yq shell-completion fish > $RPM_BUILD_ROOT%{fish_compdir}/yq.fish
77 ./target/yq shell-completion zsh > $RPM_BUILD_ROOT%{zsh_compdir}/_yq
80 rm -rf $RPM_BUILD_ROOT
83 %defattr(644,root,root,755)
84 %doc CONTRIBUTING.md README.md
85 %attr(755,root,root) %{_bindir}/yq
87 %files -n bash-completion-yq
88 %defattr(644,root,root,755)
91 %files -n fish-completion-yq
92 %defattr(644,root,root,755)
93 %{fish_compdir}/yq.fish
95 %files -n zsh-completion-yq
96 %defattr(644,root,root,755)