SHA256
1
0
forked from pool/telegraf

Accepting request 644515 from home:nicksinger:branches:devel:languages:go

- Enable PIE for build
- Include systemd service file from upstream

OBS-URL: https://build.opensuse.org/request/show/644515
OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/telegraf?expand=0&rev=6
This commit is contained in:
Stephan Kulow 2019-03-01 07:50:25 +00:00 committed by Git OBS Bridge
parent e114d8d3d3
commit 54f790609d

View File

@ -17,7 +17,7 @@
Name: telegraf
Version: 1.6.0
Release: 0
Release: 1
License: MIT
Summary: The plugin-driven server agent for collecting & reporting metrics
Url: https://github.com/influxdata/telegraf
@ -53,6 +53,7 @@ tar -C %{_builddir}/src -xjvf %{SOURCE1}
%build
export GOPATH="%{_builddir}:$GOPATH"
export LDFLAGS="-buildmode=pie"
cd %{_telegraf_dir}
make %{name}
@ -63,7 +64,26 @@ install -m755 %{_telegraf_dir}/%{name} %{buildroot}%{_bindir}/%{name}
mkdir -p %{buildroot}/%{_config_dir}
install -m644 %{_telegraf_dir}/etc/%{name}.conf %{buildroot}/%{_config_dir}
install -D -m 644 %{_telegraf_dir}/scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
sed -i '/User=/d' %{buildroot}%{_unitdir}/%{name}.service
mkdir -p %{buildroot}%{_sbindir}
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
%pre
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%doc src/github.com/influxdata/%{name}/CHANGELOG.md
%doc src/github.com/influxdata/%{name}/CONTRIBUTING.md
%license src/github.com/influxdata/%{name}/LICENSE