File uyuni-logs-visualizer.spec of Package uyuni-logs-visualizer

#
# spec file for package uyuni-logs-visualizer
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name:               uyuni-logs-visualizer
Version:            0.1.1
Release:            0
Summary:            A tool to graphically visualize events from Uyuni logs and Salt events bus
License:            Apache-2.0
URL:                https://github.com/meaksh/uyuni-logs-visualizer
Source:             https://github.com/meaksh/uyuni-logs-visualizer/archive/refs/tags/v%{version}.tar.gz 
BuildRequires:      %{python_module setuptools}
BuildRequires:      fdupes
BuildRequires:      python-rpm-macros
Requires:           python-jinja2
Requires(post):     update-alternatives
Requires(postun):   update-alternatives
BuildArch:          noarch
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
Provides:           uyuni-logs-visualizer
%endif
%python_subpackages


%description
A tool to graphically visualize events from Uyuni logs and Salt events bus. The tool generates a HTML output where you can navigate the collected events using your web browser.

When running this tool, you provide a path where the different logs files are stored, i.a. "rhn_web_ui.log", "master" or "salt-events.txt", or you can pass the path to your "supportconfig" tarball, then the tool will temporary unpack the supportconfig and collect the logs file from it.

%prep
%setup -q

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/uyuni-logs-visualizer
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%post
%python_install_alternative uyuni-logs-visualizer

%postun
%python_uninstall_alternative uyuni-logs-visualizer 

%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/uyuni-logs-visualizer
%{python_sitelib}/*

%changelog

openSUSE Build Service is sponsored by