python-pip-vl.spec 6.2 KB

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