python-wheel-vl.spec 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. %bcond_with bootstrap
  2. %bcond_without python2
  3. %bcond_without python3
  4. %bcond_with signatures
  5. %bcond_without tool
  6. %bcond_with test
  7. %global pypi_name wheel
  8. Name: python-%{pypi_name}
  9. Version: 0.35.0
  10. Release: 1%{?_dist_release}
  11. Summary: A built-package format for Python
  12. Group: programming
  13. Vendor: Project Vine
  14. Distribution: Vine Linux
  15. License: MIT
  16. URL: https://bitbucket.org/pypa/wheel
  17. Source0: https://files.pythonhosted.org/packages/source/%(n=%{pypi_name}; echo ${n:0:1})/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
  18. BuildArch: noarch
  19. BuildRequires: python-rpm-macros
  20. %if %{with python2}
  21. BuildRequires: python-devel
  22. BuildRequires: python2-setuptools
  23. %if ! %{with bootstrap}
  24. %if %{with test}
  25. BuildRequires: python3-pytest
  26. BuildRequires: python-jsonschema
  27. %endif
  28. %if %{with signatures}
  29. BuildRequires: pyxdg
  30. BuildRequires: python-keyring
  31. %endif
  32. %endif
  33. %{?python_provide:%python_provide python2-%{pypi_name}}
  34. %endif
  35. %if %{with python3}
  36. BuildRequires: python3-devel
  37. BuildRequires: python3-setuptools
  38. BuildRequires: python3-rpm-macros
  39. %if ! %{with bootstrap}
  40. %if %{with test}
  41. BuildRequires: python3-pytest
  42. BuildRequires: python3-jsonschema
  43. %endif
  44. %if %{with signatures}
  45. BuildRequires: python3-pyxdg
  46. BuildRequires: python3-keyring
  47. %endif
  48. %endif
  49. %endif
  50. %global _description \
  51. A built-package format for Python.\
  52. \
  53. A wheel is a ZIP-format archive with a specially formatted filename and the\
  54. .whl extension. It is designed to contain all the files for a PEP 376\
  55. compatible install in a way that is very close to the on-disk format.
  56. %description %{_description}
  57. Python 2 version.
  58. %if %{with python3}
  59. %package -n python3-%{pypi_name}
  60. Summary: %{summary}
  61. Group: programming
  62. BuildRequires: python3-devel
  63. BuildRequires: python3-setuptools
  64. %if ! %{with bootstrap}
  65. %if %{with test}
  66. BuildRequires: python3-pytest
  67. BuildRequires: python3-jsonschema
  68. %endif
  69. %if %{with signatures}
  70. BuildRequires: python3-pyxdg
  71. BuildRequires: python3-keyring
  72. %endif
  73. %endif
  74. %{?python_provide:%python_provide python3-%{pypi_name}}
  75. %description -n python3-%{pypi_name} %{_description}
  76. Python 3 version.
  77. %endif
  78. %prep
  79. %setup -q -n %{pypi_name}-%{version}
  80. %build
  81. %if %{with python2}
  82. %py_build
  83. %endif
  84. %if %{with python3}
  85. %py3_build
  86. %endif
  87. %install
  88. rm -rf %{buildroot}
  89. %if %{with python2}
  90. %py_install
  91. %if %{with tool}
  92. mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python_version}}
  93. ln -s %{pypi_name}-%{python_version} %{buildroot}%{_bindir}/%{pypi_name}-2
  94. %endif
  95. %endif
  96. %if %{with python3}
  97. %py3_install
  98. %if %{with tool}
  99. mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}}
  100. ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3
  101. %endif
  102. %endif
  103. %if %{with test}
  104. %check
  105. rm -f setup.cfg
  106. %if %{with python2}
  107. PYTHONPATH=%{buildroot}%{python_sitelib} py.test-2 -v --ignore build
  108. %endif
  109. %if %{with python3}
  110. PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -v --ignore build
  111. %endif
  112. %endif
  113. %if %{with python2}
  114. %pre
  115. if [ ! -L %{_bindir}/%{pypi_name} ]; then
  116. rm -f %{_bindir}/%{pypi_name}
  117. fi
  118. %post
  119. /sbin/update-alternatives \
  120. --install %{_bindir}/%{pypi_name} %{pypi_name} \
  121. %{_bindir}/%{pypi_name}-%{python_version} %{python_version_nodots}
  122. %preun
  123. if [ "$1" = 0 ]; then
  124. /sbin/update-alternatives \
  125. --remove %{pypi_name} %{_bindir}/%{pypi_name}-%{python_version}
  126. fi
  127. %endif
  128. %if %{with python3}
  129. %pre -n python3-%{pypi_name}
  130. if [ ! -L %{_bindir}/%{pypi_name} ]; then
  131. rm -f %{_bindir}/%{pypi_name}
  132. fi
  133. %post -n python3-%{pypi_name}
  134. /sbin/update-alternatives \
  135. --install %{_bindir}/%{pypi_name} %{pypi_name} \
  136. %{_bindir}/%{pypi_name}-%{python3_version} %{python3_version_nodots}
  137. %preun -n python3-%{pypi_name}
  138. if [ "$1" = 0 ]; then
  139. /sbin/update-alternatives \
  140. --remove %{pypi_name} %{_bindir}/%{pypi_name}-%{python3_version}
  141. fi
  142. %endif
  143. %if %{with python2}
  144. %files
  145. %license LICENSE.txt
  146. %doc CHANGES.txt README.txt
  147. %if %{with tool}
  148. %{_bindir}/%{pypi_name}-2
  149. %{_bindir}/%{pypi_name}-%{python_version}
  150. %endif
  151. %{python_sitelib}/%{pypi_name}*
  152. %exclude %{python_sitelib}/%{pypi_name}/test
  153. %endif
  154. %if %{with python3}
  155. %files -n python3-%{pypi_name}
  156. %license LICENSE.txt
  157. %doc CHANGES.txt README.txt
  158. %if %{with tool}
  159. %{_bindir}/%{pypi_name}-3
  160. %{_bindir}/%{pypi_name}-%{python3_version}
  161. %endif
  162. %{python3_sitelib}/%{pypi_name}*
  163. %exclude %{python3_sitelib}/%{pypi_name}/test
  164. %endif
  165. %changelog
  166. * Sat Aug 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 0.35.0-1
  167. - new upstream release.
  168. * Mon Dec 18 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 0.30.0a0-8
  169. - initial build for Vine Linux.
  170. * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0a0-7
  171. - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
  172. * Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0a0-6
  173. - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
  174. * Tue Jan 03 2017 Charalampos Stratakis <cstratak@redhat.com> - 0.30.0a0-5
  175. - Enable tests
  176. * Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.30.0a0-4
  177. - Rebuild for Python 3.6 without tests
  178. * Tue Dec 06 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.30.0a0-3
  179. - Add bootstrap method
  180. * Mon Sep 19 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.30.0a0-2
  181. - Use the python_provide macro
  182. * Mon Sep 19 2016 Charalampos Stratakis <cstratak@redhat.com> - 0.30.0a0-1
  183. - Update to 0.30.0a0
  184. - Added patch to remove keyrings.alt dependency
  185. * Wed Aug 10 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.29.0-1
  186. - Update to 0.29.0
  187. - Cleanups and fixes
  188. * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.26.0-3
  189. - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
  190. * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.0-2
  191. - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
  192. * Tue Oct 13 2015 Robert Kuska <rkuska@redhat.com> - 0.26.0-1
  193. - Update to 0.26.0
  194. - Rebuilt for Python3.5 rebuild
  195. * Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.24.0-4
  196. - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
  197. * Tue Jan 13 2015 Slavek Kabrda <bkabrda@redhat.com> - 0.24.0-3
  198. - Make spec buildable in EPEL 6, too.
  199. - Remove additional sources added to upstream tarball.
  200. * Sat Jan 03 2015 Matej Cepl <mcepl@redhat.com> - 0.24.0-2
  201. - Make python3 conditional (switched off for RHEL-7; fixes #1131111).
  202. * Mon Nov 10 2014 Slavek Kabrda <bkabrda@redhat.com> - 0.24.0-1
  203. - Update to 0.24.0
  204. - Remove patches merged upstream
  205. * Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.0-4
  206. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
  207. * Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 0.22.0-3
  208. - Another rebuild with python 3.4
  209. * Fri Apr 18 2014 Matej Stuchlik <mstuchli@redhat.com> - 0.22.0-2
  210. - Rebuild with python 3.4
  211. * Thu Nov 28 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 0.22.0-1
  212. - Initial package.