From a3d5ac34ca205ceef35d55b23734a5de8916ff36 Mon Sep 17 00:00:00 2001 From: Bradford Dabbs Date: Mon, 25 Mar 2019 20:58:38 -0500 Subject: [PATCH] Add spec file for RPM flavored systems --- redhat/yq.spec | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 redhat/yq.spec diff --git a/redhat/yq.spec b/redhat/yq.spec new file mode 100644 index 00000000..52d75dc0 --- /dev/null +++ b/redhat/yq.spec @@ -0,0 +1,57 @@ +%global git_org mikefarah + +# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 +%global _dwz_low_mem_die_limit 0 + +Name: yq +Version: 2.3.0 +Release: 1%{?dist} +Summary: Process YAML documents from the CLI + +License: MIT +URL: https://github.com/%{git_org}/%{name} +Source0: https://github.com/%{git_org}/%{name}/archive/%{version}.tar.gz + +BuildRequires: golang rsync + +%description +yq is a lightweight and portable command-line YAML processor. + +The aim of the project is to be the jq or sed of yaml files. + + + +%prep +%autosetup -n %{name}-%{version} + +%build + +mkdir -p gopath/src/github.com/%{git_org}/%{name} +export GOPATH=${PWD}/gopath +export PATH=${GOPATH}:${PATH} +rsync -az --exclude=gopath/ ./ gopath/src/github.com/%{git_org}/%{name} +cd gopath/src/github.com/%{git_org}/%{name} + +# Get go dependencies +go get -u github.com/kardianos/govendor +go install github.com/kardianos/govendor + +# Build the yq binary +${GOPATH}/bin/govendor sync +go build -o %{name} -ldflags=-linkmode=external + +%install +rm -rf %{buildroot} + +# Install binaries & scripts +install -d %{buildroot}%{_bindir} +install -p -m 755 gopath/src/github.com/%{git_org}/%{name}/%{name} %{buildroot}%{_bindir} + +%files +%doc README.md LICENSE + +%{_bindir}/%{name} + +%changelog +* Mon Mar 25 2019 Bradford Dabbs + - Initial creation of spec file