python-setuptools-vl.spec 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. %bcond_without python3
  2. %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  3. %if %{with python3}
  4. %{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
  5. %{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
  6. %endif
  7. Name: python-setuptools
  8. Version: 18.5
  9. Release: 3%{?_dist_release}
  10. Summary: Download, build, install, upgrade, and uninstall Python packages
  11. Summary(ja): Python パッケージのダウンロード、ビルド、インストール、アップグレードおよびアンインストール用ツール
  12. Group: Development/Tools
  13. License: PSFL/ZPL
  14. URL: https://pypi.python.org/pypi/setuptools
  15. Source0: https://pypi.python.org/packages/source/s/setuptools/setuptools-%{version}.tar.gz
  16. Source1: psfl.txt
  17. Source2: zpl.txt
  18. Patch0: add-setter-for-test_args.patch
  19. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  20. Requires(post): alternatives
  21. BuildArch: noarch
  22. BuildRequires: python-devel
  23. %description
  24. setuptools is a collection of enhancements to the Python distutils that allow
  25. you to more easily build and distribute Python packages, especially ones that
  26. have dependencies on other packages.
  27. %description -l ja
  28. setuptools は Python distutils の拡張機能を集めたツールです。
  29. このツールにより Python パッケージの構築や配布が簡単に行えるように
  30. なります。特に他のパッケージに依存しているパッケージを扱う際に便利
  31. です。
  32. %if %{with python3}
  33. %package -n python3-setuptools
  34. Summary: Download, build, install, upgrade, and uninstall Python3 packages
  35. Summary(ja): Python3 パッケージのダウンロード、ビルド、インストール、アップグレードおよびアンインストール用ツール
  36. Group: Development/Tools
  37. BuildRequires: python3-devel
  38. Requires(post): alternatives
  39. %description -n python3-setuptools
  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 -n python3-setuptools -l ja
  44. setuptools は Python distutils の拡張機能を集めたツールです。
  45. このツールにより Python パッケージの構築や配布が簡単に行えるように
  46. なります。特に他のパッケージに依存しているパッケージを扱う際に便利
  47. です。
  48. %endif
  49. %prep
  50. %setup -T -c -n setuptools-%{version}
  51. mkdir py2
  52. pushd py2
  53. tar xvf %{SOURCE0}
  54. pushd setuptools-%{version}
  55. %patch0 -p1
  56. #find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
  57. cp *.txt ../../
  58. popd
  59. popd
  60. %if %{with python3}
  61. cp -a py2 py3
  62. %endif
  63. %build
  64. pushd py2/setuptools-%{version}
  65. CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
  66. popd
  67. %if %{with python3}
  68. pushd py3/setuptools-%{version}
  69. CFLAGS="$RPM_OPT_FLAGS" python3 setup.py build
  70. popd
  71. %endif
  72. %install
  73. rm -rf $RPM_BUILD_ROOT
  74. pushd py2/setuptools-%{version}
  75. %{__python} setup.py install -O1 --skip-build \
  76. --root $RPM_BUILD_ROOT \
  77. --single-version-externally-managed
  78. install -p -m 0644 %{SOURCE1} %{SOURCE2} .
  79. find $RPM_BUILD_ROOT%{python_sitelib} -name '*.exe' | xargs rm -f
  80. # for alternatives
  81. %__rm -f $RPM_BUILD_ROOT%{_bindir}/easy_install
  82. popd
  83. %if %{with python3}
  84. pushd py3/setuptools-%{version}
  85. python3 setup.py install -O1 --skip-build \
  86. --root $RPM_BUILD_ROOT \
  87. --single-version-externally-managed
  88. install -p -m 0644 %{SOURCE1} %{SOURCE2} .
  89. find $RPM_BUILD_ROOT%{python3_sitelib} -name '*.exe' | xargs rm -f
  90. # for alternatives
  91. %__rm -f $RPM_BUILD_ROOT%{_bindir}/easy_install
  92. popd
  93. %endif
  94. %clean
  95. rm -rf $RPM_BUILD_ROOT
  96. %post
  97. update-alternatives --install %{_bindir}/easy_install easy_install \
  98. %{_bindir}/easy_install-%{python_version} 30
  99. %triggerpostun -- python-setuptools < 5.4.2-2
  100. update-alternatives --auto easy_install
  101. %preun
  102. if [ "$1" = "0" ]
  103. then
  104. update-alternatives --remove easy_install %{_bindir}/easy_install-%{python_version}
  105. fi
  106. %if %{with python3}
  107. %post -n python3-setuptools
  108. update-alternatives --install %{_bindir}/easy_install easy_install \
  109. %{_bindir}/easy_install-%{python3_version} 20
  110. %preun -n python3-setuptools
  111. if [ "$1" = "0" ]
  112. then
  113. update-alternatives --remove easy_install %{_bindir}/easy_install-%{python3_version}
  114. fi
  115. %endif
  116. %files
  117. %defattr(-,root,root,-)
  118. %doc *.txt
  119. %{_bindir}/easy_install-%{python_version}
  120. %{python_sitelib}/*
  121. %if %{with python3}
  122. %files -n python3-setuptools
  123. %defattr(-,root,root,-)
  124. %doc *.txt
  125. %{_bindir}/easy_install-%{python3_version}
  126. %{python3_sitelib}/*
  127. %endif
  128. %changelog
  129. * Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 18.5-3
  130. - rebuild with python3-3.5.2
  131. * Thu Dec 24 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 18.5-2
  132. - added a subpackage: python3-setuptools.
  133. * Sun Nov 15 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 18.5-1
  134. - new upstream release.
  135. - imported patch0 from rawhide.
  136. * Mon Mar 9 2015 IWAI, Masaharu <iwaim.sub@gmail.com> - 5.4.2-2
  137. - alternatives for easy_install
  138. * Fri Aug 08 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.4.2-1
  139. - new upstream release
  140. * Sat Jul 26 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.4.1-1
  141. - new upstream release
  142. * Sun Jul 06 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 5.4-1
  143. - new upstream release
  144. * Sat Apr 26 2014 Toshiharu Kudoh <toshi.kd2@gmail.com> 3.4.4-1
  145. - new upstream release
  146. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.6c11-2
  147. - rebuild with python-2.7.2
  148. * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.6c11-1
  149. - new upstream release
  150. * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.6c9-2
  151. - rebuild with python-2.6
  152. * Sun Dec 07 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.6c9-1
  153. - new upstream release
  154. - add japanese summary and description
  155. * Mon Jul 21 2008 Shu KONNO <owa@bg.wakwak.com> - 0.6c3-1vl5
  156. - rebuilt with python-2.5.2
  157. - applied new versioning policy
  158. * Sat Nov 25 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.6c3-1vl2
  159. - rebuilt for Vine Linux 4.0
  160. - changed Group to Development/Tools
  161. * Wed Nov 15 2006 Susumu Tanimura <stanimura-ngs@umin.ac.jp>
  162. - Refurbished for VineLinux3.2
  163. * Tue Sep 12 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c2-1
  164. - Upstream 0.6c2
  165. - Ghostbusting
  166. * Mon Jul 31 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c1-2
  167. - Set perms on license files (#200768)
  168. * Sat Jul 22 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c1-1
  169. - Version 0.6c1
  170. * Wed Jun 28 2006 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6b3-1
  171. - Taking over from Ignacio
  172. - Version 0.6b3
  173. - Ghost .pyo files in sitelib
  174. - Add license files
  175. - Remove manual python-abi, since we're building FC4 and up
  176. - Kill .exe files
  177. * Wed Feb 15 2006 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 0.6a10-1
  178. - Upstream update
  179. * Mon Jan 16 2006 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 0.6a9-1
  180. - Upstream update
  181. * Sat Dec 24 2005 Ignacio Vazquez-Abrams <ivazquez@ivazquez.net> 0.6a8-1
  182. - Initial RPM release