python-setuptools-vl.spec 7.4 KB

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