python-setuptools-vl.spec 9.2 KB

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