python-pip-vl.spec 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. %bcond_with bootstrap
  2. %bcond_without python2
  3. %bcond_without python3
  4. %global srcname pip
  5. %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
  6. %if %{without bootstrap}
  7. %if %{with python2}
  8. %global python2_wheelname %python_wheelname
  9. %endif
  10. %if %{with python3}
  11. %global python3_wheelname %python_wheelname
  12. %endif
  13. %endif
  14. Summary: Pip installs Python packages. An easy_install replacement
  15. Summary(ja): Pip は easy_install を置き換える Python パッケージインストーラです。
  16. Name: python-%{srcname}
  17. Version: 20.3.4
  18. Release: 1%{?_dist_release}
  19. Group: programming
  20. Vendor: Project Vine
  21. Distribution: Vine Linux
  22. License: MIT
  23. URL: https://pip.pypa.io/en/stable/
  24. Source0: https://pypi.python.org/packages/source/p/pip/%{srcname}-%{version}.tar.gz
  25. # # Patch until the following issue gets implemented upstream:
  26. # # https://github.com/pypa/pip/issues/1351
  27. # Patch0: allow-stripping-given-prefix-from-wheel-RECORD-files.patch
  28. # # Downstream only patch
  29. # # Emit a warning to the user if pip install is run with root privileges
  30. # # Issue upstream: https://github.com/pypa/pip/issues/4288
  31. # Patch1: emit-a-warning-when-running-with-root-privileges.patch
  32. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  33. BuildArch: noarch
  34. BuildRequires: python-rpm-macros
  35. %if %{with python2}
  36. BuildRequires: python2-rpm-macros
  37. BuildRequires: python-devel
  38. BuildRequires: python-setuptools
  39. %if %{without bootstrap}
  40. BuildRequires: python-pip
  41. BuildRequires: python-wheel
  42. %endif
  43. Requires: python-setuptools
  44. Requires(post,postun): alternatives
  45. %endif
  46. %if %{with python3}
  47. BuildRequires: python3-rpm-macros
  48. BuildRequires: python3-devel
  49. BuildRequires: python3-setuptools
  50. %if %{without bootstrap}
  51. BuildRequires: python3-pip
  52. BuildRequires: python3-wheel
  53. %endif
  54. %endif
  55. %description
  56. pip is a package management system used to install and manage software packages
  57. written in Python. Many packages can be found in the Python Package Index
  58. (PyPI). pip is a recursive acronym that can stand for either "Pip Installs
  59. Packages" or "Pip Installs Python".
  60. %if %{with python3}
  61. %package -n python3-%{srcname}
  62. Summary: A tool for installing and managing Python3 packages
  63. Group: programming
  64. Requires: python3-setuptools
  65. Requires(post,postun): alternatives
  66. %description -n python3-%{srcname}
  67. pip is a package management system used to install and manage software packages
  68. written in Python. Many packages can be found in the Python Package Index
  69. (PyPI). pip is a recursive acronym that can stand for either "Pip Installs
  70. Packages" or "Pip Installs Python".
  71. %endif
  72. %prep
  73. %setup -q -n %{srcname}-%{version}
  74. %build
  75. %if %{with python2}
  76. %if %{without bootstrap}
  77. %py_build_wheel
  78. %else
  79. %py_build
  80. %endif
  81. %endif
  82. %if %{with python3}
  83. %if %{without bootstrap}
  84. %py3_build_wheel
  85. %else
  86. %py3_build
  87. %endif
  88. %endif # with python3
  89. %install
  90. %{__rm} -rf %{buildroot}
  91. %if %{with python3}
  92. %if %{without bootstrap}
  93. %py3_install_wheel %{python3_wheelname}
  94. %else
  95. %py3_install
  96. %endif
  97. rm %{buildroot}%{_bindir}/pip
  98. %endif # with python3
  99. %if %{with python2}
  100. %if %{without bootstrap}
  101. %py2_install_wheel %{python_wheelname}
  102. %else
  103. %py_install
  104. %endif
  105. rm %{buildroot}%{_bindir}/pip
  106. %endif # with python2
  107. %clean
  108. %{__rm} -rf %{buildroot}
  109. %if %{with python2}
  110. %pre
  111. if [ ! -L %{_bindir}/%{srcname} ]; then
  112. rm -f %{_bindir}/%{srcname}
  113. fi
  114. %post
  115. /sbin/update-alternatives \
  116. --install %{_bindir}/%{srcname} %{srcname} \
  117. %{_bindir}/%{srcname}%{python_version} %{python_version_nodots}
  118. %preun
  119. if [ "$1" = 0 ]; then
  120. /sbin/update-alternatives \
  121. --remove %{srcname} %{_bindir}/%{srcname}%{python_version}
  122. fi
  123. %endif
  124. %if %{with python3}
  125. %pre -n python3-%{srcname}
  126. if [ ! -L %{_bindir}/%{srcname} ]; then
  127. rm -f %{_bindir}/%{srcname}
  128. fi
  129. %post -n python3-%{srcname}
  130. /sbin/update-alternatives \
  131. --install %{_bindir}/%{srcname} %{srcname} \
  132. %{_bindir}/%{srcname}%{python3_version} %{python3_version_nodots}
  133. %preun -n python3-%{srcname}
  134. if [ "$1" = 0 ]; then
  135. /sbin/update-alternatives \
  136. --remove %{srcname} %{_bindir}/%{srcname}%{python3_version}
  137. fi
  138. %endif
  139. %if %{with python2}
  140. %files
  141. %defattr(-,root,root,-)
  142. %license LICENSE.txt
  143. %doc README.rst docs
  144. %attr(755,root,root) %{_bindir}/pip2*
  145. %{python_sitelib}/pip*
  146. %endif
  147. %if %{with python3}
  148. %files -n python3-pip
  149. %defattr(-,root,root,-)
  150. %license LICENSE.txt
  151. %doc README.rst docs
  152. %attr(755,root,root) %{_bindir}/pip3*
  153. %{python3_sitelib}/pip*
  154. %endif
  155. %changelog
  156. * Tue Feb 23 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 20.3.4-1
  157. - new upstream release.
  158. * Sat Aug 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 20.2.2-1
  159. - new upstream release.
  160. * Wed Apr 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 20.0.2-1
  161. - new upstream release.
  162. * Sat Oct 06 2018 Toshiaki Ara <ara_t@384.jp> 18.1-1
  163. - new upstream release.
  164. - drop Patches
  165. - change URL
  166. * Mon Dec 18 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
  167. - new upstream release.
  168. - made to use python{,3}-rpm-macros.
  169. - added a sub-package for python3.
  170. * Sat Jul 26 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.5.6-1
  171. - new upstream release
  172. - didn't rename pip to python-pip
  173. * Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.1-3
  174. - rebuild with VineSeed environment
  175. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.8.1-2
  176. - rebuild with python-2.7.2
  177. * Mon Nov 22 2010 Shu KONNO <owa@bg.wakwak.com> 0.8.1-1
  178. - updated pip to 0.8.1
  179. * Fri Sep 03 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8-1
  180. - initial build for Vine Linux
  181. * Mon Aug 30 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.8-1
  182. - update to 0.8 of pip
  183. * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.7.2-5
  184. - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
  185. * Wed Jul 7 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.7.2-1
  186. - update to 0.7.2 of pip
  187. * Sun May 23 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.7.1-1
  188. - update to 0.7.1 of pip
  189. * Fri Jan 1 2010 Peter Halliday <phalliday@excelsiorsystems.net> - 0.6.1.4
  190. - fix dependency issue
  191. * Fri Dec 18 2009 Peter Halliday <phalliday@excelsiorsystems.net> - 0.6.1-2
  192. - fix spec file
  193. * Thu Dec 17 2009 Peter Halliday <phalliday@excelsiorsystems.net> - 0.6.1-1
  194. - upgrade to 0.6.1 of pip
  195. * Mon Aug 31 2009 Peter Halliday <phalliday@excelsiorsystems.net> - 0.4-1
  196. - Initial package