diff --git a/centos_wheels.inc b/centos_wheels.inc new file mode 100644 index 00000000..7e128758 --- /dev/null +++ b/centos_wheels.inc @@ -0,0 +1,4 @@ +fm-api-wheels +fm-common-wheels +fm-rest-api-wheels +python-fmclient-wheels diff --git a/fm-api/centos/fm-api.spec b/fm-api/centos/fm-api.spec index f741f403..5334a6c7 100644 --- a/fm-api/centos/fm-api.spec +++ b/fm-api/centos/fm-api.spec @@ -12,6 +12,8 @@ Source1: LICENSE %define debug_package %{nil} BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel %description CGTS platform Fault Management Client Library that provides APIs @@ -34,6 +36,7 @@ the Alarms & Logs Doc Yaml file %build %{__python} setup.py build +%py2_build_wheel %install %{__python} setup.py install --root=$RPM_BUILD_ROOT \ @@ -41,6 +44,8 @@ the Alarms & Logs Doc Yaml file --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 @@ -64,3 +69,12 @@ rm -rf $RPM_BUILD_ROOT %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/* diff --git a/fm-common/centos/fm-common.spec b/fm-common/centos/fm-common.spec index 0076ccb2..1a73419c 100644 --- a/fm-common/centos/fm-common.spec +++ b/fm-common/centos/fm-common.spec @@ -17,6 +17,8 @@ BuildRequires: postgresql-devel BuildRequires: libuuid-devel BuildRequires: python-devel BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel %package -n fm-common-dev 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}'` make MAJOR=$MAJOR MINOR=$MINOR %{?_smp_mflags} %{__python} setup.py build +%py2_build_wheel %install 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} \ --prefix=/usr \ --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 -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 %defattr(-,root,root,-) %{cgcs_doc_deploy_dir}/* + +%package wheels +Summary: %{name} wheels + +%description wheels +Contains python wheels for %{name} + +%files wheels +/wheels/* diff --git a/fm-common/sources/setup.py b/fm-common/sources/setup.py index bc19a043..f56b10b8 100644 --- a/fm-common/sources/setup.py +++ b/fm-common/sources/setup.py @@ -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", ext_modules=[Extension("fm_core", [ diff --git a/fm-rest-api/centos/fm-rest-api.spec b/fm-rest-api/centos/fm-rest-api.spec index 227e23b0..5de140e8 100644 --- a/fm-rest-api/centos/fm-rest-api.spec +++ b/fm-rest-api/centos/fm-rest-api.spec @@ -10,6 +10,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel BuildRequires: python-oslo-config BuildRequires: python-oslo-db BuildRequires: python-oslo-log @@ -42,6 +44,7 @@ echo "Start build" export PBR_VERSION=%{version} %{__python} setup.py build +%py2_build_wheel PYTHONPATH=. oslo-config-generator --config-file=fm/config-generator.conf %install @@ -52,6 +55,8 @@ export PBR_VERSION=%{version} --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/ install -p -D -m 644 scripts/fm-api.service %{buildroot}%{_unitdir}/fm-api.service install -d -m 755 %{buildroot}%{local_initddir} @@ -94,3 +99,11 @@ rm -rf $RPM_BUILD_ROOT # pmond config file %{local_etc_pmond}/fm-api.conf +%package wheels +Summary: %{name} wheels + +%description wheels +Contains python wheels for %{name} + +%files wheels +/wheels/* diff --git a/python-fmclient/centos/python-fmclient.spec b/python-fmclient/centos/python-fmclient.spec index 6e909915..494ae871 100644 --- a/python-fmclient/centos/python-fmclient.spec +++ b/python-fmclient/centos/python-fmclient.spec @@ -13,6 +13,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: git BuildRequires: python-pbr >= 2.0.0 BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel Requires: python-keystoneauth1 >= 3.1.0 Requires: python-pbr >= 2.0.0 @@ -48,6 +50,7 @@ echo "Start build" export PBR_VERSION=%{version} %{__python} setup.py build +%py2_build_wheel %install echo "Start install" @@ -57,6 +60,8 @@ export PBR_VERSION=%{version} --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/ 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 @@ -80,3 +85,11 @@ rm -rf $RPM_BUILD_ROOT %files sdk /usr/share/remote-clients/%{name}-%{version}.tgz +%package wheels +Summary: %{name} wheels + +%description wheels +Contains python wheels for %{name} + +%files wheels +/wheels/*