File python-zabbix-cli.spec of Package python-zabbix-cli
#
# spec file for package zabbix-cli
#
# 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 https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-zabbix-cli
Version: 2.2.1
Release: 0
Summary: Zabbbix command line interface
License: GPL-3.0-or-later
Group: System/Monitoring
Url: https://github.com/usit-gd/zabbix-cli
Source: https://github.com/usit-gd/zabbix-cli/archive/%{version}/zabbix-cli-%{version}.tar.gz
Patch0: zabbix-cli-2.1.1-fix-whitespace.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Requires: update-alternatives
Requires(post): /usr/sbin/update-alternatives
Requires(postun): /usr/sbin/update-alternatives
Requires: python-ipaddr
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
%python_subpackages
%description
Command-line interface for Zabbix monitoring system.
%prep
%setup -qn zabbix-cli-%{version}
#%%patch0
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/zabbix-cli
%python_clone -a %{buildroot}%{_bindir}/zabbix-cli-bulk-execution
%python_clone -a %{buildroot}%{_bindir}/zabbix-cli-init
%python_clone -a %{buildroot}%{_datadir}/zabbix-cli/zabbix-cli.conf
%post
%python_install_alternative zabbix-cli zabbix-cli-bulk-execution zabbix-cli-init %{_datadir}/zabbix-cli/zabbix-cli.conf
%postun
%python_uninstall_alternative zabbix-cli zabbix-cli-bulk-execution zabbix-cli-init %{_datadir}/zabbix-cli/zabbix-cli.conf
%files %{python_files}
%defattr(-,root,root)
%doc LICENSE README.md docs/manual.rst
%{python_sitelib}
%python_alternative %{_bindir}/zabbix-cli
%python_alternative %{_bindir}/zabbix-cli-bulk-execution
%python_alternative %{_bindir}/zabbix-cli-init
%dir %{_datadir}/zabbix-cli
%python_alternative %{_datadir}/zabbix-cli/zabbix-cli.conf
%changelog