fault/fm-api/centos/fm-api.spec
Saul Wold 1ace05df4b fm-api: remove extra Source: LICENSE line
fm-api already has a LICENSE file no need to copy LICENSE in

Closes-Bug: 1842667
Change-Id: I9232e73f4d38394ad7d427431d0b766c1fbadf5b
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2019-09-04 06:46:52 -07:00

80 lines
2.0 KiB
RPMSpec

Summary: CGTS Platform Fault Management Python API Package
Name: fm-api
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: Wind River <info@windriver.com>
URL: unknown
Source0: %{name}-%{version}.tar.gz
%define debug_package %{nil}
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
%description
CGTS platform Fault Management Client Library that provides APIs
for applications to raise/clear/update active alarms.
%package -n fm-api-doc
Summary: fm-api deploy doc
Group: doc
Provides: fm-api-doc
%description -n fm-api-doc
Contains contansts which is to be used by fm-doc package to validate
the Alarms & Logs Doc Yaml file
%define pythonroot /usr/lib64/python2.7/site-packages
%define cgcs_doc_deploy_dir /opt/deploy/cgcs_doc
%prep
%setup
%build
%{__python} setup.py build
%py2_build_wheel
%install
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
--install-lib=%{pythonroot} \
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
CGCS_DOC_DEPLOY=$RPM_BUILD_ROOT/%{cgcs_doc_deploy_dir}
install -d $CGCS_DOC_DEPLOY
# install constants.py in CGCS_DOC_DEPLOY_DIR
# used by fm-doc package to validate the Alarms & Logs Doc Yaml file
install -m 644 fm_api/constants.py $CGCS_DOC_DEPLOY
%clean
rm -rf $RPM_BUILD_ROOT
# Note: RPM package name is fm-api but import package name is fm_api so can't
# use '%{name}'.
%files
%license LICENSE
%defattr(-,root,root,-)
%dir %{pythonroot}/fm_api
%{pythonroot}/fm_api/*
%dir %{pythonroot}/fm_api-%{version}.0-py2.7.egg-info
%{pythonroot}/fm_api-%{version}.0-py2.7.egg-info/*
%files -n fm-api-doc
%defattr(-,root,root,-)
%{cgcs_doc_deploy_dir}/*
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*