Merge "Add hooks for python wheel generation"

This commit is contained in:
Zuul 2018-10-23 21:59:43 +00:00 committed by Gerrit Code Review
commit f9f0c00c41
4 changed files with 55 additions and 0 deletions

View File

@ -9,6 +9,8 @@ URL: unknown
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
BuildRequires: python-setuptools BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: systemd-units BuildRequires: systemd-units
BuildRequires: systemd-devel BuildRequires: systemd-devel
Requires: sysinv Requires: sysinv
@ -31,6 +33,7 @@ Handle sysinv RPC calls for long running Ceph API operations:
%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 \
@ -38,6 +41,8 @@ Handle sysinv RPC calls for long running Ceph API operations:
--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_initd} install -d -m 755 %{buildroot}%{local_etc_initd}
install -p -D -m 700 scripts/init.d/ceph-manager %{buildroot}%{local_etc_initd}/ceph-manager install -p -D -m 700 scripts/init.d/ceph-manager %{buildroot}%{local_etc_initd}/ceph-manager
@ -68,3 +73,12 @@ rm -rf $RPM_BUILD_ROOT
%{pythonroot}/ceph_manager/* %{pythonroot}/ceph_manager/*
%dir %{pythonroot}/ceph_manager-%{version}.0-py2.7.egg-info %dir %{pythonroot}/ceph_manager-%{version}.0-py2.7.egg-info
%{pythonroot}/ceph_manager-%{version}.0-py2.7.egg-info/* %{pythonroot}/ceph_manager-%{version}.0-py2.7.egg-info/*
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*

View File

@ -25,6 +25,8 @@ BuildArch: noarch
BuildRequires: python BuildRequires: python
BuildRequires: ceph BuildRequires: ceph
BuildRequires: python2-pip
BuildRequires: python2-wheel
Requires: python Requires: python
@ -44,9 +46,12 @@ rm -f requirements.txt
%build %build
%{__python2} setup.py build %{__python2} setup.py build
%py2_build_wheel
%install %install
%{__python2} setup.py install --skip-build --root %{buildroot} %{__python2} setup.py install --skip-build --root %{buildroot}
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
%files %files
%doc README.rst %doc README.rst
@ -54,3 +59,11 @@ rm -f requirements.txt
%{python2_sitelib}/cephclient %{python2_sitelib}/cephclient
%{python2_sitelib}/*.egg-info %{python2_sitelib}/*.egg-info
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*

View File

@ -10,6 +10,8 @@ Source0: %{name}-%{version}.tar.gz
Source1: LICENSE Source1: LICENSE
BuildRequires: python-setuptools BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: systemd-devel BuildRequires: systemd-devel
Requires: systemd Requires: systemd
Requires: python-daemon Requires: python-daemon
@ -32,6 +34,7 @@ rm -rf *.egg-info
%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 \
@ -39,6 +42,8 @@ rm -rf *.egg-info
--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_bindir} install -d -m 755 %{buildroot}%{local_bindir}
install -p -D -m 700 scripts/bin/logmgmt %{buildroot}%{local_bindir}/logmgmt install -p -D -m 700 scripts/bin/logmgmt %{buildroot}%{local_bindir}/logmgmt
@ -71,3 +76,12 @@ rm -rf $RPM_BUILD_ROOT
%{pythonroot}/%{name}/* %{pythonroot}/%{name}/*
%dir %{pythonroot}/%{name}-%{version}.0-py2.7.egg-info %dir %{pythonroot}/%{name}-%{version}.0-py2.7.egg-info
%{pythonroot}/%{name}-%{version}.0-py2.7.egg-info/* %{pythonroot}/%{name}-%{version}.0-py2.7.egg-info/*
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*

View File

@ -10,6 +10,8 @@ BuildArch: noarch
Source: %name-%version.tar.gz Source: %name-%version.tar.gz
BuildRequires: python-setuptools BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
%description %description
Platform utilities Platform utilities
@ -36,6 +38,7 @@ Platform utilities that packaged on controllers or one node system
%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 \
@ -43,6 +46,8 @@ Platform utilities that packaged on controllers or one node system
--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/
%global _buildsubdir %{_builddir}/%{name}-%{version} %global _buildsubdir %{_builddir}/%{name}-%{version}
install -d %{buildroot}%{local_bindir} install -d %{buildroot}%{local_bindir}
@ -96,3 +101,12 @@ systemctl enable opt-platform.service
%files -n platform-util-controller %files -n platform-util-controller
%defattr(-,root,root,-) %defattr(-,root,root,-)
/etc/systemd/system/memcached.service /etc/systemd/system/memcached.service
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*