fault/python-fmclient/opensuse/python-fmclient.spec
Erich Cordoba d235681165 Add missing Requires to fault components for opensuse
Some of the fault components rely on having all the dependencies
installed in the StarlingX ISO so having missing dependencies listed
in the spec files is not an issue. However, when we take those compo-
nents and run them in a non StarlingX installation these problems
started to arise.

This patch is the result of the analysis of all imports and a manual
execution of the fault components in opensuse. This is a summary of
the findings:

- fm-api: This component imports `fm_core` which is provided by
          `fm-common` but not listed in the dependencies. Same
          case for `six` module.
- fm-mgr: `fmManager` links to `libfmcommon` but is not listed in the
          requirements. Also, it expects to find the `/etc/fm/events.yaml`
          file which is provided by `fm-doc`.
- fm-rest-api: A set of imports that are missing. This component also
               depends on other StarlingX compoments.
- python-fmclient: Missing python imports.

Story: 2006684
Task: 36971

Change-Id: I6719ab8a8d9a35d105be1c6f7dac57b855da543e
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
2019-10-08 18:24:30 -05:00

73 lines
2.0 KiB
RPMSpec

#
# spec file for package python
#
#
%global pypi_name fmclient
Name: python-%{pypi_name}
Version: 1.0.0
Release: %{tis_patch_ver}%{?_tis_dist}
Summary: A python client library for Fault Management
License: Apache-2.0
Group: Development/Tools/Other
URL: https://opendev.org/starlingx/fault
Source0: %{name}-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: git
BuildRequires: python-setuptools
BuildRequires: python2-pbr
BuildRequires: python3-pbr
Requires: bash-completion
Requires: python2-httplib2
Requires: python2-pyOpenSSL
Requires: python2-PrettyTable
Requires: python2-python-dateutil
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-oslo.i18n >= 2.1.0
Requires: python-oslo.utils >= 3.20.0
Requires: python-pbr >= 2.0.0
Requires: python-requests
Requires: python-six >= 1.9.0
%description
A python client library for StarlingX Fault Management service
%define local_etc_bash_completiond %{_sysconfdir}/bash_completion.d/
%define pythonroot %{_libdir}/python2.7/site-packages
%define debug_package %{nil}
%prep
%autosetup -n %{name}-%{version}/fmclient
# Remove bundled egg-info
rm -rf *.egg-info
%build
export PBR_VERSION=%{version}
python setup.py build
%install
export PBR_VERSION=%{version}
python setup.py install --root=%{buildroot} \
--install-lib=%{pythonroot} \
--prefix=%{_prefix} \
--install-data=%{_datadir} \
--single-version-externally-managed
install -d -m 755 %{buildroot}%{local_etc_bash_completiond}
install -p -D -m 664 tools/fm.bash_completion %{buildroot}%{local_etc_bash_completiond}/fm.bash_completion
%fdupes %{buildroot}%{pythonroot}/fmclient
%fdupes %{buildroot}%{pythonroot}/%{pypi_name}-%{version}*.egg-info
%files
%license LICENSE
%{_bindir}/*
%config %{local_etc_bash_completiond}/*
%{pythonroot}/%{pypi_name}
%{pythonroot}/%{pypi_name}-%{version}*.egg-info
%changelog