python-setuptools-vl.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. %bcond_without bootstrap
  2. %bcond_without python3
  3. %global srcname setuptools
  4. %define _unpackaged_files_terminate_build 1
  5. %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
  6. %if %{with python3}
  7. %global python3_wheelname %python_wheelname
  8. %global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD
  9. %endif
  10. Name: python-setuptools
  11. Version: 49.6.0
  12. Release: 1%{?_dist_release}
  13. Summary: Download, build, install, upgrade, and uninstall Python packages
  14. Summary(ja): Python パッケージのダウンロード、ビルド、インストール、アップグレードおよびアンインストール用ツール
  15. Group: programming
  16. License: PSFL/ZPL
  17. URL: https://pypi.python.org/pypi/setuptools
  18. Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.zip
  19. Source1: psfl.txt
  20. Source2: zpl.txt
  21. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  22. BuildArch: noarch
  23. BuildRequires: python-rpm-macros
  24. %if %{with python3}
  25. BuildRequires: python3
  26. BuildRequires: python3-devel
  27. BuildRequires: python3-rpm-macros
  28. %if %{without bootstrap}
  29. BuildRequires: python3-pip
  30. BuildRequires: python3-wheel
  31. %endif # without bootstrap
  32. %endif # with python3
  33. %description
  34. setuptools is a collection of enhancements to the Python distutils that allow
  35. you to more easily build and distribute Python packages, especially ones that
  36. have dependencies on other packages.
  37. %description -l ja
  38. setuptools は Python distutils の拡張機能を集めたツールです。
  39. このツールにより Python パッケージの構築や配布が簡単に行えるように
  40. なります。特に他のパッケージに依存しているパッケージを扱う際に便利
  41. です。
  42. %if %{with python3}
  43. %package -n python3-setuptools
  44. Summary: Download, build, install, upgrade, and uninstall Python3 packages
  45. Summary(ja): Python3 パッケージのダウンロード、ビルド、インストール、アップグレードおよびアンインストール用ツール
  46. Group: programming
  47. Requires(post,postun): alternatives
  48. %description -n python3-setuptools
  49. setuptools is a collection of enhancements to the Python distutils that allow
  50. you to more easily build and distribute Python packages, especially ones that
  51. have dependencies on other packages.
  52. %description -n python3-setuptools -l ja
  53. setuptools は Python distutils の拡張機能を集めたツールです。
  54. このツールにより Python パッケージの構築や配布が簡単に行えるように
  55. なります。特に他のパッケージに依存しているパッケージを扱う際に便利
  56. です。
  57. %endif
  58. %prep
  59. %setup -q -n %{srcname}-%{version}
  60. # We can't remove .egg-info (but it doesn't matter, since it'll be rebuilt):
  61. # The problem is that to properly execute setuptools' setup.py,
  62. # it is needed for setuptools to be loaded as a Distribution
  63. # (with egg-info or .dist-info dir), it's not sufficient
  64. # to just have them on PYTHONPATH
  65. # Running "setup.py install" without having setuptools installed
  66. # as a distribution gives warnings such as
  67. # ... distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
  68. # and doesn't create "easy_install" and .egg-info directory
  69. # Note: this is only a problem if bootstrapping wheel or building on RHEL,
  70. # otherwise setuptools are installed as dependency into buildroot
  71. # Strip shbang
  72. find setuptools -name \*.py | xargs sed -i -e '1 {/^#!\//d}'
  73. # Remove bundled exes
  74. rm -f setuptools/*.exe
  75. # These tests require internet connection
  76. rm setuptools/tests/test_integration.py
  77. %build
  78. %if %{with python3}
  79. %if %{without bootstrap}
  80. %py3_build_wheel
  81. %else
  82. %py3_build
  83. %endif
  84. %endif # with python3
  85. %install
  86. rm -rf %{buildroot}
  87. # Must do the python3 install first because the scripts in /usr/bin are
  88. # overwritten with every setup.py install (and we want the python2 version to
  89. # be the default for now).
  90. %if %{with python3}
  91. %if %{without bootstrap}
  92. %py3_install_wheel %{python3_wheelname}
  93. # Remove /usr/bin/easy_install from the record as later on we delete the file
  94. sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
  95. %else
  96. %py3_install
  97. %endif
  98. # TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have to
  99. rm %{buildroot}%{_bindir}/easy_install
  100. rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
  101. %if %{without bootstrap}
  102. sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
  103. %endif
  104. find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
  105. %endif # with python3
  106. # Don't ship these
  107. rm -r docs/{Makefile,conf.py,_*}
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT
  110. %if %{with python3}
  111. %pre -n python3-setuptools
  112. if [ ! -L %{_bindir}/easy_install ]; then
  113. rm -f %{_bindir}/easy_install
  114. fi
  115. %post -n python3-setuptools
  116. /sbin/update-alternatives \
  117. --install %{_bindir}/easy_install easy_install \
  118. %{_bindir}/easy_install-%{python3_version} %{python3_version_nodots}
  119. %preun -n python3-setuptools
  120. if [ "$1" = "0" ]; then
  121. /sbin/update-alternatives \
  122. --remove easy_install %{_bindir}/easy_install-%{python3_version}
  123. fi
  124. %endif
  125. %if %{with python3}
  126. %files -n python3-setuptools
  127. %license LICENSE
  128. %doc docs/* CHANGES.rst README.rst
  129. %{python3_sitelib}/easy_install.py
  130. %{python3_sitelib}/distutils-precedence.pth
  131. %{python3_sitelib}/pkg_resources/
  132. %{python3_sitelib}/setuptools*/
  133. %{python3_sitelib}/__pycache__/*
  134. %{python3_sitelib}/_distutils_hack
  135. %{_bindir}/easy_install-3*
  136. %endif
  137. %changelog
  138. * Sat Aug 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 49.6.0-1
  139. - updated to 49.6.0.
  140. - built with python3 only.
  141. * Wed Apr 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 44.1.0-1
  142. - updated to 44.1.0 (last release for Python2).
  143. * Sun Dec 17 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 38.2.4-1
  144. - new upstream release.
  145. - dropped Patch0.
  146. - made to use python{,3}-rpm-macros.
  147. * Sat Jul 30 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 25.1.1-1
  148. - new upstream release.
  149. - enable to build on Vine6.
  150. * Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 18.5-3
  151. - rebuild with python3-3.5.2
  152. * Thu Dec 24 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 18.5-2
  153. - added a subpackage: python3-setuptools.
  154. * Sun Nov 15 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 18.5-1
  155. - new upstream release.
  156. - imported patch0 from rawhide.
  157. * Mon Mar 9 2015 IWAI, Masaharu <iwaim.sub@gmail.com> - 5.4.2-2
  158. - alternatives for easy_install
  159. * Fri Aug 08 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.4.2-1
  160. - new upstream release
  161. * Sat Jul 26 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.4.1-1
  162. - new upstream release
  163. * Sun Jul 06 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.4-1
  164. - new upstream release
  165. * Sat Apr 26 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 3.4.4-1
  166. - new upstream release
  167. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.6c11-2
  168. - rebuild with python-2.7.2
  169. * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.6c11-1
  170. - new upstream release
  171. * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.6c9-2
  172. - rebuild with python-2.6
  173. * Sun Dec 07 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6c9-1
  174. - new upstream release
  175. - add japanese summary and description
  176. * Mon Jul 21 2008 Shu KONNO <owa@bg.wakwak.com> - 0.6c3-1vl5
  177. - rebuilt with python-2.5.2
  178. - applied new versioning policy
  179. * Sat Nov 25 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.6c3-1vl2
  180. - rebuilt for Vine Linux 4.0
  181. - changed Group to Development/Tools
  182. * Wed Nov 15 2006 Susumu Tanimura <stanimura-ngs@umin.ac.jp>
  183. - Refurbished for VineLinux3.2
  184. * Tue Sep 12 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c2-1
  185. - Upstream 0.6c2
  186. - Ghostbusting
  187. * Mon Jul 31 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c1-2
  188. - Set perms on license files (#200768)
  189. * Sat Jul 22 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c1-1
  190. - Version 0.6c1
  191. * Wed Jun 28 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6b3-1
  192. - Taking over from Ignacio
  193. - Version 0.6b3
  194. - Ghost .pyo files in sitelib
  195. - Add license files
  196. - Remove manual python-abi, since we're building FC4 and up
  197. - Kill .exe files
  198. * Wed Feb 15 2006 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 0.6a10-1
  199. - Upstream update
  200. * Mon Jan 16 2006 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 0.6a9-1
  201. - Upstream update
  202. * Sat Dec 24 2005 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 0.6a8-1
  203. - Initial RPM release