Guest User

Untitled

a guest
Oct 8th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %global pypi_name zuul-client
  2.  
  3. Name:       python-%{pypi_name}
  4. Version:    0.0.2
  5. Release:    1%{?dist}
  6. Summary:    The zuulclient Python module
  7. License:    ASL 2.0
  8. URL:        https://zuul-ci.org
  9.  
  10. Source0:    %pypi_source
  11.  
  12. Source1:    fake-zuul-client
  13.  
  14. BuildArch:  noarch
  15.  
  16. %description
  17. The zuulclient Python module is a client library for
  18. Zuul Gating System's REST API. It includes zuul-client,
  19. a CLI utility to interact with Zuul instances.
  20.  
  21. %package -n python3-%{pypi_name}
  22. Summary: %summary
  23. BuildRequires:  python3-testtools
  24. BuildRequires:  python3-stestr
  25. BuildRequires: python3-devel
  26. BuildRequires: python3-requests
  27. # Doc requirements
  28. BuildRequires:  python3-zuul-sphinx
  29. BuildRequires:  python3-sphinx-autodoc-typehints
  30. BuildRequires:  python3-sphinxcontrib-blockdiag
  31. BuildRequires:  python3-sphinxcontrib-programoutput
  32. BuildRequires:  python3-reno
  33.  
  34. %{?python_provide:%python_provide python3-%{pypi_name}}
  35.  
  36. %prep
  37. %autosetup -n %{pypi_name}-%{version}
  38.  
  39. %description -n python3-%{pypi_name}
  40. The zuulclient Python module is a client library for
  41. Zuul Gating System's REST API. It includes zuul-client,
  42. a CLI utility to interact with Zuul instances.
  43.  
  44. %package doc
  45. Summary: zuul-client documentation
  46.  
  47. %description doc
  48. Documentation for the zuulclient library and the zuul-client CLI.
  49.  
  50. %build
  51. %py3_build
  52.  
  53. cp %{SOURCE1} build/zuul-client
  54. chmod +x build/zuul-client
  55. # Generate documentation (without release note because source doesn't have git log)
  56. sed -e 's/^ *releasenotes$//' -i doc/source/index.rst
  57. rm doc/source/releasenotes.rst
  58. # Build HTML doc
  59. PYTHONPATH=../../build/lib PATH=$PATH:$(pwd)/build PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build-3 \
  60.     -b html doc/source build/html
  61. # Remove empty stub files
  62. find build -type f -name "*.pyi" -size 0 -delete
  63. # rm doc build leftovers
  64. rm -Rf build/html/.buildinfo build/html/.doctrees
  65. # Fix file-not-utf8
  66. iconv -f iso8859-1 -t utf-8 build/html/objects.inv > build/html/objects.inv.conv && \
  67.     mv -f build/html/objects.inv.conv build/html/objects.inv
  68. # Fix wrong-file-end-of-line-encoding
  69. sed -i 's/\r$//' LICENSE
  70. sed -i 's/\r$//' build/html/objects.inv
  71.  
  72. %install
  73. %py3_install
  74.  
  75. %check
  76. PYTHON=%{__python3} stestr run
  77.  
  78. %files -n python3-%{pypi_name}
  79. %doc README.rst
  80. %license LICENSE
  81. %{_bindir}/*
  82. %{python3_sitelib}/zuulclient
  83. %{python3_sitelib}/zuul_client*.egg-info
  84.  
  85. %files doc
  86. %license LICENSE
  87. %doc build/html
  88.  
  89. %changelog
  90. * Thu Oct  1 2020 Matthieu Huin <mhuin@redhat.com> - 0.0.2-1
  91. - Initial packaging
  92.  
Add Comment
Please, Sign In to add comment