Add hooks for python wheel generation
This update adds hooks to the spec files for the following packages to generate wheels for the python modules: - fm-api - fm-common - fm-rest-api - python-fmclient Change-Id: I0542650b52b9c5b0627023a2ce1996176135411d Story: 2003907 Task: 27525 Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
parent
8080f496b6
commit
4d82104ecf
4
centos_wheels.inc
Normal file
4
centos_wheels.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
fm-api-wheels
|
||||||
|
fm-common-wheels
|
||||||
|
fm-rest-api-wheels
|
||||||
|
python-fmclient-wheels
|
@ -12,6 +12,8 @@ Source1: LICENSE
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
|
BuildRequires: python2-pip
|
||||||
|
BuildRequires: python2-wheel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
CGTS platform Fault Management Client Library that provides APIs
|
CGTS platform Fault Management Client Library that provides APIs
|
||||||
@ -34,6 +36,7 @@ the Alarms & Logs Doc Yaml file
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
%{__python} setup.py build
|
%{__python} setup.py build
|
||||||
|
%py2_build_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
|
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
|
||||||
@ -41,6 +44,8 @@ the Alarms & Logs Doc Yaml file
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--install-data=/usr/share \
|
--install-data=/usr/share \
|
||||||
--single-version-externally-managed
|
--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}
|
CGCS_DOC_DEPLOY=$RPM_BUILD_ROOT/%{cgcs_doc_deploy_dir}
|
||||||
install -d $CGCS_DOC_DEPLOY
|
install -d $CGCS_DOC_DEPLOY
|
||||||
@ -64,3 +69,12 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%files -n fm-api-doc
|
%files -n fm-api-doc
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{cgcs_doc_deploy_dir}/*
|
%{cgcs_doc_deploy_dir}/*
|
||||||
|
|
||||||
|
%package wheels
|
||||||
|
Summary: %{name} wheels
|
||||||
|
|
||||||
|
%description wheels
|
||||||
|
Contains python wheels for %{name}
|
||||||
|
|
||||||
|
%files wheels
|
||||||
|
/wheels/*
|
||||||
|
@ -17,6 +17,8 @@ BuildRequires: postgresql-devel
|
|||||||
BuildRequires: libuuid-devel
|
BuildRequires: libuuid-devel
|
||||||
BuildRequires: python-devel
|
BuildRequires: python-devel
|
||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
|
BuildRequires: python2-pip
|
||||||
|
BuildRequires: python2-wheel
|
||||||
|
|
||||||
%package -n fm-common-dev
|
%package -n fm-common-dev
|
||||||
Summary: CGTS Platform Fault Management Common Package - Development files
|
Summary: CGTS Platform Fault Management Common Package - Development files
|
||||||
@ -50,6 +52,7 @@ MAJOR=`echo $VER | awk -F . '{print $1}'`
|
|||||||
MINOR=`echo $VER | awk -F . '{print $2}'`
|
MINOR=`echo $VER | awk -F . '{print $2}'`
|
||||||
make MAJOR=$MAJOR MINOR=$MINOR %{?_smp_mflags}
|
make MAJOR=$MAJOR MINOR=$MINOR %{?_smp_mflags}
|
||||||
%{__python} setup.py build
|
%{__python} setup.py build
|
||||||
|
%py2_build_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
@ -62,6 +65,8 @@ make DEST_DIR=$RPM_BUILD_ROOT BIN_DIR=%{local_bindir} LIB_DIR=%{_libdir} INC_DIR
|
|||||||
--install-lib=%{pythonroot} \
|
--install-lib=%{pythonroot} \
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--install-data=/usr/share
|
--install-data=/usr/share
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/wheels
|
||||||
|
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
|
||||||
|
|
||||||
install -d $RPM_BUILD_ROOT/usr/bin
|
install -d $RPM_BUILD_ROOT/usr/bin
|
||||||
install -m 755 fm_db_sync_event_suppression.py $RPM_BUILD_ROOT/usr/bin/fm_db_sync_event_suppression.py
|
install -m 755 fm_db_sync_event_suppression.py $RPM_BUILD_ROOT/usr/bin/fm_db_sync_event_suppression.py
|
||||||
@ -98,3 +103,12 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%files -n fm-common-doc
|
%files -n fm-common-doc
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{cgcs_doc_deploy_dir}/*
|
%{cgcs_doc_deploy_dir}/*
|
||||||
|
|
||||||
|
%package wheels
|
||||||
|
Summary: %{name} wheels
|
||||||
|
|
||||||
|
%description wheels
|
||||||
|
Contains python wheels for %{name}
|
||||||
|
|
||||||
|
%files wheels
|
||||||
|
/wheels/*
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
from distutils.core import setup, Extension
|
from setuptools import setup
|
||||||
|
from distutils.core import Extension
|
||||||
|
|
||||||
setup(name="fm_core", version="1.0",
|
setup(name="fm_core", version="1.0",
|
||||||
ext_modules=[Extension("fm_core", [
|
ext_modules=[Extension("fm_core", [
|
||||||
|
@ -10,6 +10,8 @@ Source0: %{name}-%{version}.tar.gz
|
|||||||
|
|
||||||
|
|
||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
|
BuildRequires: python2-pip
|
||||||
|
BuildRequires: python2-wheel
|
||||||
BuildRequires: python-oslo-config
|
BuildRequires: python-oslo-config
|
||||||
BuildRequires: python-oslo-db
|
BuildRequires: python-oslo-db
|
||||||
BuildRequires: python-oslo-log
|
BuildRequires: python-oslo-log
|
||||||
@ -42,6 +44,7 @@ echo "Start build"
|
|||||||
|
|
||||||
export PBR_VERSION=%{version}
|
export PBR_VERSION=%{version}
|
||||||
%{__python} setup.py build
|
%{__python} setup.py build
|
||||||
|
%py2_build_wheel
|
||||||
PYTHONPATH=. oslo-config-generator --config-file=fm/config-generator.conf
|
PYTHONPATH=. oslo-config-generator --config-file=fm/config-generator.conf
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -52,6 +55,8 @@ export PBR_VERSION=%{version}
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--install-data=/usr/share \
|
--install-data=/usr/share \
|
||||||
--single-version-externally-managed
|
--single-version-externally-managed
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/wheels
|
||||||
|
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
|
||||||
|
|
||||||
install -p -D -m 644 scripts/fm-api.service %{buildroot}%{_unitdir}/fm-api.service
|
install -p -D -m 644 scripts/fm-api.service %{buildroot}%{_unitdir}/fm-api.service
|
||||||
install -d -m 755 %{buildroot}%{local_initddir}
|
install -d -m 755 %{buildroot}%{local_initddir}
|
||||||
@ -94,3 +99,11 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
# pmond config file
|
# pmond config file
|
||||||
%{local_etc_pmond}/fm-api.conf
|
%{local_etc_pmond}/fm-api.conf
|
||||||
|
|
||||||
|
%package wheels
|
||||||
|
Summary: %{name} wheels
|
||||||
|
|
||||||
|
%description wheels
|
||||||
|
Contains python wheels for %{name}
|
||||||
|
|
||||||
|
%files wheels
|
||||||
|
/wheels/*
|
||||||
|
@ -13,6 +13,8 @@ Source0: %{name}-%{version}.tar.gz
|
|||||||
BuildRequires: git
|
BuildRequires: git
|
||||||
BuildRequires: python-pbr >= 2.0.0
|
BuildRequires: python-pbr >= 2.0.0
|
||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
|
BuildRequires: python2-pip
|
||||||
|
BuildRequires: python2-wheel
|
||||||
|
|
||||||
Requires: python-keystoneauth1 >= 3.1.0
|
Requires: python-keystoneauth1 >= 3.1.0
|
||||||
Requires: python-pbr >= 2.0.0
|
Requires: python-pbr >= 2.0.0
|
||||||
@ -48,6 +50,7 @@ echo "Start build"
|
|||||||
|
|
||||||
export PBR_VERSION=%{version}
|
export PBR_VERSION=%{version}
|
||||||
%{__python} setup.py build
|
%{__python} setup.py build
|
||||||
|
%py2_build_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
echo "Start install"
|
echo "Start install"
|
||||||
@ -57,6 +60,8 @@ export PBR_VERSION=%{version}
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--install-data=/usr/share \
|
--install-data=/usr/share \
|
||||||
--single-version-externally-managed
|
--single-version-externally-managed
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/wheels
|
||||||
|
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
|
||||||
|
|
||||||
install -d -m 755 %{buildroot}%{local_etc_bash_completiond}
|
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
|
install -p -D -m 664 tools/fm.bash_completion %{buildroot}%{local_etc_bash_completiond}/fm.bash_completion
|
||||||
@ -80,3 +85,11 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%files sdk
|
%files sdk
|
||||||
/usr/share/remote-clients/%{name}-%{version}.tgz
|
/usr/share/remote-clients/%{name}-%{version}.tgz
|
||||||
|
|
||||||
|
%package wheels
|
||||||
|
Summary: %{name} wheels
|
||||||
|
|
||||||
|
%description wheels
|
||||||
|
Contains python wheels for %{name}
|
||||||
|
|
||||||
|
%files wheels
|
||||||
|
/wheels/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user