From b4049622eccf9c9c471e2a125b270f54fa9e03e4 Mon Sep 17 00:00:00 2001 From: Don Penney Date: Mon, 22 Oct 2018 16:47:31 -0400 Subject: [PATCH] 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: - sm-api - sm-client - sm-tools Change-Id: If6ebbdaaad5ee7623cbbaa07b48d216461a16dec Story: 2003907 Task: 27527 Signed-off-by: Don Penney --- centos_wheels.inc | 3 +++ service-mgmt-api/centos/sm-api.spec | 13 +++++++++++++ service-mgmt-client/centos/sm-client.spec | 13 +++++++++++++ service-mgmt-tools/centos/sm-tools.spec | 13 +++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 centos_wheels.inc diff --git a/centos_wheels.inc b/centos_wheels.inc new file mode 100644 index 00000000..fc50ccb7 --- /dev/null +++ b/centos_wheels.inc @@ -0,0 +1,3 @@ +sm-api-wheels +sm-client-wheels +sm-tools-wheels diff --git a/service-mgmt-api/centos/sm-api.spec b/service-mgmt-api/centos/sm-api.spec index ddea7dfd..ebab3bb4 100644 --- a/service-mgmt-api/centos/sm-api.spec +++ b/service-mgmt-api/centos/sm-api.spec @@ -12,6 +12,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: python BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel BuildRequires: util-linux # BuildRequires systemd is to get %_unitdir I think BuildRequires: systemd @@ -29,10 +31,13 @@ Requires: mtce-pmon %build %{__python2} setup.py build +%py2_build_wheel %install %global _buildsubdir %{_builddir}/%{name}-%{version} %{__python2} setup.py install -O1 --skip-build --root %{buildroot} +mkdir -p $RPM_BUILD_ROOT/wheels +install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/ install -d %{buildroot}/etc/sm install -d %{buildroot}/etc/init.d install -d %{buildroot}/etc/pmon.d @@ -82,3 +87,11 @@ Service Management API #%defattr(-,-,-,-) #"/usr/src/sm-api-1.0.tar.bz2" +%package wheels +Summary: %{name} wheels + +%description wheels +Contains python wheels for %{name} + +%files wheels +/wheels/* diff --git a/service-mgmt-client/centos/sm-client.spec b/service-mgmt-client/centos/sm-client.spec index 6d98098b..f922d626 100644 --- a/service-mgmt-client/centos/sm-client.spec +++ b/service-mgmt-client/centos/sm-client.spec @@ -12,6 +12,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: python BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel Requires: python-libs Requires: python-six %prep @@ -19,10 +21,13 @@ Requires: python-six %build %{__python2} setup.py build +%py2_build_wheel %install %global _buildsubdir %{_builddir}/%{name}-%{version} %{__python2} setup.py install -O1 --skip-build --root %{buildroot} +mkdir -p $RPM_BUILD_ROOT/wheels +install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/ install -d %{buildroot}/usr/bin install -m 755 %{_buildsubdir}/usr/bin/smc %{buildroot}/usr/bin @@ -56,3 +61,11 @@ Service Management Client and CLI #%defattr(-,-,-,-) #"/usr/src/sm-client-1.0.tar.bz2" +%package wheels +Summary: %{name} wheels + +%description wheels +Contains python wheels for %{name} + +%files wheels +/wheels/* diff --git a/service-mgmt-tools/centos/sm-tools.spec b/service-mgmt-tools/centos/sm-tools.spec index 8a53cd35..26cc7d8d 100644 --- a/service-mgmt-tools/centos/sm-tools.spec +++ b/service-mgmt-tools/centos/sm-tools.spec @@ -12,6 +12,8 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: python BuildRequires: python-setuptools +BuildRequires: python2-pip +BuildRequires: python2-wheel Requires: python-libs %prep @@ -19,10 +21,13 @@ Requires: python-libs %build %{__python2} setup.py build +%py2_build_wheel %install %global _buildsubdir %{_builddir}/%{name}-%{version} %{__python2} setup.py install -O1 --skip-build --root %{buildroot} +mkdir -p $RPM_BUILD_ROOT/wheels +install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/ %description Service Management Tools @@ -54,3 +59,11 @@ Service Management Tools #%defattr(-,-,-,-) #"/usr/src/sm-tools-1.0.tar.bz2" +%package wheels +Summary: %{name} wheels + +%description wheels +Contains python wheels for %{name} + +%files wheels +/wheels/*