python3-vl.spec 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. # if you wanna test, add " --define '_run_test 1' " option to rpmbuild command
  2. %define run_test %{?_run_test:1}%{!?_run_test:0}
  3. %define TclTk 8.4
  4. %define pybasever 3.1
  5. %define python_lib %{_libdir}/python%{pybasever}
  6. Summary: An interpreted, interactive, object-oriented programming language.
  7. Summary(ja): オブジェクト指向 Python3 インタプリタ
  8. Name: python3
  9. Version: %{pybasever}.3
  10. Release: 1%{?_dist_release}
  11. License: Modified CNRI Open Source License
  12. Group: Development/Languages
  13. URL: http://www.python.org/download/releases/%{version}
  14. Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
  15. Source1: http://docs.python.org/py3k/archives/python-%{version}-docs-html.tar.bz2
  16. Patch0: python-3.1.3-Setup.dist.patch
  17. Patch10: python-3.1.3-locale.patch
  18. Patch100: python-3.1.3-lib64-Makefile.patch
  19. Patch101: python-3.1.3-lib64-setup.patch
  20. Patch102: python-3.1.3-lib64-site.patch
  21. Patch103: python-3.1.3-lib64-install.patch
  22. Patch104: python-3.1.3-lib64-sysconfig.patch
  23. Patch105: python-3.1.3-lib64-getpath.patch
  24. Patch106: python-3.1.3-lib64-test_install.patch
  25. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  26. BuildRequires: gzip tar gcc-c++ pkgconfig sed findutils
  27. BuildRequires: bzip2-devel
  28. BuildRequires: gdbm-devel
  29. BuildRequires: glibc-devel
  30. BuildRequires: ncurses-devel
  31. BuildRequires: openssl-devel
  32. BuildRequires: readline-devel
  33. BuildRequires: sqlite3-devel
  34. BuildRequires: zlib-devel
  35. BuildRequires: libffi-devel
  36. Requires: bzip2
  37. Requires: gdbm
  38. Requires: ncurses
  39. Requires: openssl
  40. Requires: readline
  41. Requires: sqlite3
  42. Requires: zlib
  43. Packager: owa
  44. Vendor: Project Vine
  45. Distribution: Vine Linux
  46. %description
  47. Python is an interpreted, interactive, object-oriented programming
  48. language often compared to Tcl, Perl, Scheme or Java. Python includes
  49. modules, classes, exceptions, very high level dynamic data types and
  50. dynamic typing. Python supports interfaces to many system calls and
  51. libraries, as well as to various windowing systems (X11, Motif, Tk,
  52. Mac and MFC).
  53. Programmers can write new built-in modules for Python in C or C++.
  54. Python can be used as an extension language for applications that need
  55. a programmable interface. This package contains most of the standard
  56. Python modules, as well as modules for interfacing to the Tix widget
  57. set for Tk and RPM.
  58. Note that documentation for Python is provided in the python-docs
  59. package.
  60. %package devel
  61. Summary: The libraries and header files needed for Python development.
  62. Group: Development/Libraries
  63. %description devel
  64. The Python programming language's interpreter can be extended with
  65. dynamically loaded extensions and can be embedded in other programs.
  66. This package contains the header files and libraries needed to do
  67. these types of tasks.
  68. Install python-devel if you want to develop Python extensions. The
  69. python package will also need to be installed. You'll probably also
  70. want to install the python-docs package, which contains Python
  71. documentation.
  72. %package tkinter
  73. Summary: A graphical user interface for the Python scripting language.
  74. Group: Development/Languages
  75. Requires: %{name} = %{version}
  76. Requires: tcl, tk, tix
  77. Requires: libX11, libxcb, libXau, libXdmcp
  78. BuildRequires: tcl, tk, tix
  79. BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel
  80. %description tkinter
  81. The Tkinter (Tk interface) program is an graphical user interface for
  82. the Python scripting language.
  83. You should install the tkinter package if you'd like to use a graphical
  84. user interface for Python programming.
  85. %package tools
  86. Summary: A collection of development tools included with Python.
  87. Group: Development/Tools
  88. Requires: %{name} = %{version}
  89. Requires: %{name}-tkinter = %{version}
  90. %description tools
  91. The Python package includes several development tools that are used
  92. to build python programs.
  93. %package docs
  94. Summary: Documentation for the Python programming language.
  95. Group: Documentation
  96. %description docs
  97. The python-docs package contains documentation on the Python
  98. programming language and interpreter. The documentation is provided
  99. in ASCII text files and in LaTeX source files.
  100. Install the python-docs package if you'd like to use the documentation
  101. for the Python language.
  102. %prep
  103. %setup -q -n Python-%{version}
  104. %patch0 -p1 -b .Setup
  105. %patch10 -p1 -b .locale
  106. %if %{_lib} == lib64
  107. %patch100 -p1 -b .lib64-Makefile
  108. %patch101 -p1 -b .lib64-setup
  109. %patch102 -p1 -b .lib64-site
  110. %patch103 -p1 -b .lib64-install
  111. %patch104 -p1 -b .lib64-sysconfig
  112. %patch105 -p1 -b .lib64-getpath
  113. %patch106 -p1 -b .test_install
  114. %endif
  115. # fix Tcl/Tk versions
  116. pushd Modules
  117. mv Setup.dist Setup.dist.old
  118. cat Setup.dist.old \
  119. | sed "s^-ltcl^-ltcl%{TclTk}^" \
  120. | sed "s^-ltk^-ltk%{TclTk}^" \
  121. | sed "s^-ltix^-ltix%{TclTk}^" \
  122. > Setup.dist
  123. rm -f Setup.dist.old
  124. popd
  125. %build
  126. topdir=`pwd`
  127. %configure \
  128. --enable-shared \
  129. --enable-ipv6 \
  130. --enable-profiling \
  131. --with-wide-unicode \
  132. --with-system-ffi \
  133. --with-signal-module \
  134. ;
  135. make %{?_smp_mflags}
  136. ## rebuild with new python
  137. export LD_LIBRARY_PATH=$topdir
  138. export PATH="$topdir:$PATH"
  139. ln -s $topdir/python $topdir/python%{pybasever}
  140. #$topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env python%{pybasever}" .
  141. make %{?_smp_mflags}
  142. %if %{run_test}
  143. #%%check
  144. find ./Lib -name '*.py[co]' -print | xargs rm -f
  145. LD_LIBRARY_PATH=$topdir:$topdir/Modules:$topdir/build/lib.linux-%{_host_cpu}-%{pybasever}
  146. PYTHONHOME=$topdir
  147. PYTHONPATH=$topdir/Lib:$topdir/Lib/test:$topdir/Lib/lib-tk:$topdir/Lib/site-packages
  148. PYTHONPATH=$PYTHONPATH:$LD_LIBRARY_PATH
  149. export PYTHONHOME PYTHONPATH LD_LIBRARY_PATH
  150. SKIPLIST="-x test_cmd_line"
  151. ./python -tt -E ./Lib/test/regrtest.py -l -w $SKIPLIST 2>&1 | tee make.check1.log
  152. ./python -tt -E ./Lib/test/regrtest.py -l -w $SKIPLIST 2>&1 | tee make.check2.log
  153. #-------------------------------##
  154. # Mon Nov 29 2010 ...last tested
  155. # 314 tests OK.
  156. # 4 tests failed:
  157. # test_cmd_line: "Lib/test/test_cmd_line.py", line 190, in test_large_PYTHONPATH
  158. # test_httpservers: Lib/test/test_httpservers.py", line 399 in tearDown
  159. # test_pydoc: Lib/test/test_pydoc.py", line 299, in test_badimport
  160. # test_warnings: Lib/test/test_warnings.py", line 707, in test_issue_8766
  161. # 22 tests skipped:
  162. # 2 skips unexpected on linux2:
  163. #-------------------------------##
  164. %endif
  165. %install
  166. rm -fr $RPM_BUILD_ROOT
  167. make DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} install
  168. ## Clean up the testsuite - we don't need compiled files for it
  169. find $RPM_BUILD_ROOT%{python_lib}/test \
  170. -name "*.pyc" -o -name "*.pyo" | xargs rm -f
  171. chmod 755 $RPM_BUILD_ROOT%{_libdir}/libpython*.so.*
  172. chmod 755 $RPM_BUILD_ROOT%{python_lib}/lib-dynload/*.so
  173. find $RPM_BUILD_ROOT%{python_lib} -perm -o=x -name '*.py' | xargs chmod -x
  174. mv $RPM_BUILD_ROOT%{_bindir}/2to3 $RPM_BUILD_ROOT%{_bindir}/2to3.1
  175. ## html document
  176. tar xvzf %SOURCE1
  177. if [ -d Doc/html ] ; then
  178. rm -r Doc/html
  179. fi
  180. mv python-%{version}-docs-html Doc/html
  181. %post -p /sbin/ldconfig
  182. %postun -p /sbin/ldconfig
  183. %clean
  184. rm -fr $RPM_BUILD_ROOT
  185. %files
  186. %defattr(-, root, root)
  187. %doc LICENSE README
  188. %{_bindir}/%{name}
  189. %{_bindir}/%{name}-config
  190. %{_bindir}/python%{pybasever}
  191. %{_bindir}/python%{pybasever}-config
  192. %{_libdir}/libpython%{pybasever}.so*
  193. %{_libdir}/pkgconfig/python-%{pybasever}.pc
  194. %{_libdir}/pkgconfig/python3.pc
  195. %{_mandir}/man1/*
  196. %dir %{python_lib}
  197. %dir %{python_lib}/site-packages
  198. %{python_lib}/LICENSE.txt
  199. %{python_lib}/*.py*
  200. %{python_lib}/*.doc
  201. %{python_lib}/ctypes
  202. %{python_lib}/curses
  203. %{python_lib}/distutils
  204. %{python_lib}/dbm
  205. %{python_lib}/email
  206. %{python_lib}/encodings
  207. %{python_lib}/html
  208. %{python_lib}/http
  209. %{python_lib}/importlib
  210. %{python_lib}/json
  211. %{python_lib}/logging
  212. %{python_lib}/multiprocessing
  213. %{python_lib}/plat-linux2
  214. %{python_lib}/pydoc_data
  215. %{python_lib}/sqlite3
  216. %{python_lib}/urllib
  217. %{python_lib}/wsgiref
  218. %{python_lib}/wsgiref.egg-info
  219. %{python_lib}/xml
  220. %{python_lib}/xmlrpc
  221. %{python_lib}/lib-dynload
  222. %exclude %{python_lib}/lib-dynload/_tkinter.so
  223. %files devel
  224. %defattr(-,root,root)
  225. %{_includedir}/python%{pybasever}
  226. %{python_lib}/config
  227. %{python_lib}/test
  228. %files tools
  229. %defattr(-,root,root)
  230. %{_bindir}/2to3.1
  231. %{_bindir}/idle3
  232. %{_bindir}/pydoc3
  233. %{python_lib}/idlelib
  234. %{python_lib}/lib2to3
  235. %{python_lib}/site-packages
  236. %files tkinter
  237. %defattr(-,root,root)
  238. %{python_lib}/tkinter
  239. %{python_lib}/lib-dynload/_tkinter.so
  240. %files docs
  241. %defattr(-,root,root)
  242. %doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/README
  243. %doc Misc/cheatsheet Misc/Porting
  244. %doc Doc/html
  245. %changelog
  246. * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
  247. - updated python to 3.1.3
  248. - added python-3.1.3-locale.patch
  249. - dropt python-3.1.2-lib64.patch
  250. - added python-3.1.3-lib64-*.patchs
  251. python-3.1.3-lib64-Makefile.patch
  252. python-3.1.3-lib64-setup.patch
  253. python-3.1.3-lib64-site.patch
  254. python-3.1.3-lib64-install.patch
  255. python-3.1.3-lib64-sysconfig.patch
  256. python-3.1.3-lib64-getpath.patch
  257. python-3.1.3-lib64-test_install.patch
  258. - added run_test macro to run unit test
  259. - added BR: libffi
  260. * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
  261. - rebuilt with rpm-4.8.1 for pkg-config
  262. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
  263. - spec in utf-8
  264. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
  265. - added missings in BuildRequires, Requires
  266. * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
  267. - initial build for VineSeed