A new user interface for you! Read more...

File graylog-sidecar.spec of Package graylog-sidecar

#
# spec file for package graylog-collector-sidecar
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           graylog-sidecar
Version:        1.0.0
Release:        0
Summary:        Manage log collectors through Graylog
License:        GPL-3.0
Group:          System/Monitoring
Url:            https://github.com/Graylog2/collector-sidecar
Source0:        https://github.com/Graylog2/collector-sidecar/releases/download/%{version}/graylog-sidecar-%{version}.tar.gz
Source1:        https://github.com/Graylog2/collector-sidecar/raw/master/sidecar-example.yml
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description

%prep
%setup -qn graylog-sidecar

%build
# uncomment node_id information in configuration file
sed -e 's@#node_id@node_id@g' %{S:1} > sidecar.yml

%install 
install -D -m 0755 %{version}/linux/amd64/graylog-sidecar %{buildroot}%{_bindir}/graylog-sidecar
install -D -m 0644 sidecar.yml %{buildroot}%{_sysconfdir}/graylog/sidecar/sidecar.yml

%post
# Generate this node id on first install and do not reinstall it on update!!
if [ ! -f %{_sysconfdir}/graylog/sidecar/node-id ]; then
    uuidgen |tee %{_sysconfdir}/graylog/sidecar/node-id
fi

%postun

%files
%defattr(0755,root,root,0755)
%dir %{_sysconfdir}/graylog
%dir %{_sysconfdir}/graylog/sidecar
%{_bindir}/graylog-sidecar
%attr(0644,root,root) %{_sysconfdir}/graylog/sidecar/sidecar.yml
%ghost %attr(0644,root,root) %(config) %{_sysconfdir}/graylog/sidecar/node-id

%changelog