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

Name:           graylog-sidecar
Version:        1.0.0
Release:        0
Summary:        Manage log collectors through Graylog
License:        GPL-3.0
Group:          System/Monitoring
BuildRoot:      %{_tmppath}/%{name}-%{version}-build


%setup -qn graylog-sidecar

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

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

# 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


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