fault/fm-api/opensuse/fm-api.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

67 lines
1.8 KiB
RPMSpec

%define debug_package %{nil}
Name: fm-api
Version: 1.0.0
Release: %{tis_patch_ver}%{?_tis_dist}
Summary: StarlingX Platform Fault Management Python API Package
License: Apache-2.0
Group: Development/Tools/Other
URL: https://opendev.org/starlingx/fault
Source0: %{name}-%{version}.tar.gz
BuildRequires: python-setuptools
BuildRequires: python2-pip
Requires: fm-common
Requires: python2-six
%description
StarlingX platform Fault Management Client Library that provides APIs
for applications to raise/clear/update active alarms.
%package -n fm-api-doc
Summary: StarlingX fm-api deploy doc
Group: Documentation/Other
%description -n fm-api-doc
Contains constants which is to be used by fm-doc package to validate
the Alarms & Logs Doc Yaml file
%define pythonroot %{_libdir}/python2.7/site-packages
%define doc_deploy_dir /opt/deploy/cgcs_doc
%prep
%autosetup
%build
python setup.py build
%install
python setup.py install --root=%{buildroot} \
--install-lib=%{pythonroot} \
--prefix=%{_prefix} \
--install-data=%{_datadir} \
--single-version-externally-managed
DOC_DEPLOY=%{buildroot}/%{doc_deploy_dir}
install -d $DOC_DEPLOY
# install constants.py in DOC_DEPLOY_DIR
# used by fm-doc package to validate the Alarms & Logs Doc Yaml file
install -m 644 fm_api/constants.py $DOC_DEPLOY
# Note: RPM package name is fm-api but import package name is fm_api so can't
# use '%%{name}'.
%files
%defattr(-,root,root,-)
%license LICENSE
%dir %{pythonroot}/fm_api
%{pythonroot}/fm_api/*
%dir %{pythonroot}/fm_api-%{version}-py2.7.egg-info
%{pythonroot}/fm_api-%{version}-py2.7.egg-info/*
%files -n fm-api-doc
%defattr(-,root,root,-)
%dir /opt/deploy
%dir %{doc_deploy_dir}
%{doc_deploy_dir}/*
%changelog