From cb61040ea6e1d860630c96eb29280b5122259951 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Tue, 14 Jul 2020 15:41:53 -0700 Subject: [PATCH] add SPEC file for RPM building --- pup.SPEC | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pup.SPEC diff --git a/pup.SPEC b/pup.SPEC new file mode 100644 index 0000000..6667cdf --- /dev/null +++ b/pup.SPEC @@ -0,0 +1,42 @@ +%global gopath %{_tmppath}/gopath +%global gopup %{gopath}/src/github.com/ericchiang/pup + +Name: pup +Version: 0.4.0 +Release: 1%{?dist} +Summary: CLI for processing HTML + +License: MIT +URL: https://github.com/ericchiang/pup +Source0: https://github.com/ericchiang/pup/archive/v%{version}.tar.gz + +BuildRequires: golang + +%description +Command-line tool for processing HTML + +%prep +%setup -q -n %{name}-%{version} +rm -rf %{gopath} +mkdir -p %{gopath} %{gopath}/pkg %{gopath}/bin %{gopath}/src %{gopup} + +%build +cp -R * %{gopup} +cd %{gopup} +GOPATH=%{gopath} go get -v . +#cp -a `pwd`/vendor/* %{gopath}/src +GOPATH=%{gopath} go build -a -ldflags '-s -w -extldflags "-static"' . + +%install +install -d %{buildroot}%{_bindir} +install -m 755 %{gopup}/%{name} %{buildroot}%{_bindir} + +%files +%doc LICENSE +%doc README.md +%{_bindir}/%{name} + + +%changelog +* Tue Jul 14 2020 Kilian Cavalotti 0.4.0-1 +- initial RPM release