python3-vl.spec 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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 libvers 3.3
  4. %define binsuffix 3.3
  5. %define python_lib %{_libdir}/python%{libvers}
  6. %define config_htmldir /var/www/html/python
  7. Summary: An interpreted, interactive, object-oriented programming language.
  8. Summary(ja): オブジェクト指向 Python3 インタプリタ
  9. Name: python3
  10. Version: 3.3.0
  11. Release: 1%{?_dist_release}
  12. License: PSF
  13. Group: Development/Languages
  14. URL: http://www.python.org/download/releases/%{version}
  15. Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
  16. Source1: http://docs.python.org/py3k/archives/python-%{version}-docs-html.tar.bz2
  17. Patch1: python-3.3.0-lib64.patch
  18. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  19. BuildRequires: expat-devel
  20. BuildRequires: db4-devel
  21. BuildRequires: gdbm-devel
  22. BuildRequires: sqlite3-devel
  23. BuildRequires: gzip tar gcc-c++ pkgconfig sed findutils
  24. BuildRequires: bzip2-devel
  25. BuildRequires: glibc-devel
  26. BuildRequires: ncurses-devel
  27. BuildRequires: openssl-devel
  28. BuildRequires: readline-devel
  29. BuildRequires: zlib-devel
  30. BuildRequires: libffi-devel
  31. BuildRequires: valgrind-devel
  32. Requires: bzip2
  33. Requires: gdbm
  34. Requires: ncurses
  35. Requires: openssl
  36. Requires: readline
  37. Requires: sqlite3
  38. Requires: zlib
  39. Packager: owa
  40. Vendor: Project Vine
  41. Distribution: Vine Linux
  42. %description
  43. Python is an interpreted, interactive, object-oriented programming
  44. language. It incorporates modules, exceptions, dynamic typing, very high
  45. level dynamic data types, and classes. Python combines remarkable power
  46. with very clear syntax. It has interfaces to many system calls and
  47. libraries, as well as to various window systems, and is extensible in C or
  48. C++. It is also usable as an extension language for applications that need
  49. a programmable interface. Finally, Python is portable: it runs on many
  50. brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the
  51. Mac.
  52. %package devel
  53. Summary: The libraries and header files needed for Python development.
  54. Group: Development/Libraries
  55. %description devel
  56. The Python programming language's interpreter can be extended with
  57. dynamically loaded extensions and can be embedded in other programs.
  58. This package contains the header files and libraries needed to do
  59. these types of tasks.
  60. Install python-devel if you want to develop Python extensions. The
  61. python package will also need to be installed. You'll probably also
  62. want to install the python-docs package, which contains Python
  63. documentation.
  64. %package tkinter
  65. Summary: A graphical user interface for the Python scripting language.
  66. Group: Development/Languages
  67. Requires: %{name} = %{version}
  68. Requires: tcl, tk, tix
  69. Requires: libX11, libxcb, libXau, libXdmcp
  70. BuildRequires: tcl, tk, tix
  71. BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel
  72. %description tkinter
  73. The Tkinter (Tk interface) program is an graphical user interface for
  74. the Python scripting language.
  75. You should install the tkinter package if you'd like to use a graphical
  76. user interface for Python programming.
  77. %package tools
  78. Summary: A collection of development tools included with Python.
  79. Group: Development/Tools
  80. Requires: %{name} = %{version}
  81. Requires: %{name}-tkinter = %{version}
  82. %description tools
  83. The Python package includes several development tools that are used
  84. to build python programs.
  85. %package docs
  86. Summary: Documentation for the Python programming language.
  87. Group: Documentation
  88. %description docs
  89. The python-docs package contains documentation on the Python
  90. programming language and interpreter. The documentation is provided
  91. in ASCII text files and in LaTeX source files.
  92. Install the python-docs package if you'd like to use the documentation
  93. for the Python language.
  94. %prep
  95. %setup -q -n Python-%{version}
  96. %if %{_lib} == lib64
  97. %patch1 -p1 -b .lib64
  98. %endif
  99. %build
  100. ./configure \
  101. --prefix=%{_prefix} \
  102. --libdir=%{_libdir} \
  103. --enable-shared \
  104. --enable-profiling \
  105. --enable-ipv6 \
  106. --with-fpectl \
  107. --with-wide-unicode \
  108. --with-doc-strings \
  109. --with-pymalloc \
  110. --with-signal-module \
  111. --with-system-ffi \
  112. --with-threads \
  113. --with-valgrind \
  114. %ifarch x86_64
  115. --with-universal-archs=64-bit \
  116. %endif
  117. CXX=g++;
  118. make %{?_smp_mflags}
  119. %if %{run_test}
  120. make test
  121. %endif
  122. %install
  123. [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
  124. echo '[install_scripts]' >setup.cfg
  125. echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg
  126. mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload
  127. make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
  128. # if --with-wide-unicode at configure
  129. ln -s python%{libvers}u $RPM_BUILD_ROOT%{_includedir}/python%{libvers}
  130. # replace path in pydoc
  131. if [ ! -z "%{binsuffix}" ]
  132. then
  133. (
  134. cd $RPM_BUILD_ROOT%{_bindir}
  135. mv pydoc%{libvers} pydoc.old
  136. sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \
  137. pydoc.old > pydoc%{libvers}
  138. chmod 755 pydoc%{libvers}
  139. rm -f pydoc.old
  140. )
  141. fi
  142. # Tools
  143. echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  144. echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  145. echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  146. echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  147. echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  148. chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
  149. cp -a Tools $RPM_BUILD_ROOT%{python_lib}
  150. # make file lists
  151. rm -f mainpkg.files
  152. find "$RPM_BUILD_ROOT"%{python_lib} -type f |
  153. sed "s|^${RPM_BUILD_ROOT}|/|" |
  154. grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >> mainpkg.files
  155. rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
  156. find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
  157. sed "s|^${RPM_BUILD_ROOT}|/|" |
  158. grep -v -e '/bin/2to3%{binsuffix}$' |
  159. grep -v -e '/bin/pydoc%{binsuffix}$' |
  160. grep -v -e '/bin/smtpd.py%{binsuffix}$' |
  161. grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
  162. rm -f tools.files
  163. find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
  164. "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
  165. sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
  166. echo %{_bindir}/2to3-%{binsuffix} >> tools.files
  167. echo %{_bindir}/pydoc%{binsuffix} >> tools.files
  168. ##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
  169. echo %{_bindir}/idle%{binsuffix} >> tools.files
  170. # docs
  171. mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
  172. (
  173. cd "$RPM_BUILD_ROOT"%{config_htmldir}
  174. bunzip2 < %{SOURCE1} | tar x
  175. )
  176. # fix the #! line in installed files
  177. find "$RPM_BUILD_ROOT" -type f -print0 |
  178. xargs -0 grep -l /usr/local/bin/python | while read file
  179. do
  180. FIXFILE="$file"
  181. sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
  182. "$FIXFILE" >/tmp/fix-python-path.$$
  183. cat /tmp/fix-python-path.$$ > "$FIXFILE"
  184. rm -f /tmp/fix-python-path.$$
  185. done
  186. # check to see if there are any straggling #! lines
  187. find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
  188. | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
  189. if [ -s /tmp/python-rpm-files.$$ ]
  190. then
  191. echo '*****************************************************'
  192. cat /tmp/python-rpm-files.$$
  193. cat <<@EOF
  194. *****************************************************
  195. There are still files referencing /usr/local/bin/python in the
  196. install directory. They are listed above. Please fix the .spec
  197. file and try again. If you are an end-user, you probably want
  198. to report this to jafo-rpms@tummy.com as well.
  199. *****************************************************
  200. @EOF
  201. rm -f /tmp/python-rpm-files.$$
  202. exit 1
  203. fi
  204. rm -f /tmp/python-rpm-files.$$
  205. %post -p /sbin/ldconfig
  206. %postun -p /sbin/ldconfig
  207. %clean
  208. rm -fr $RPM_BUILD_ROOT
  209. %files -f mainpkg.files
  210. %defattr(-, root, root)
  211. %doc LICENSE
  212. %doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README
  213. %attr(755,root,root) %dir %{python_lib}/
  214. %{_libdir}/libpython*
  215. %{_mandir}/man1/python%{libvers}.1*
  216. %files devel
  217. %defattr(-,root,root)
  218. %dir %{_includedir}/python%{libvers}m
  219. %{_includedir}/python%{libvers}m/*.h
  220. %{_includedir}/python%{libvers}
  221. %{_libdir}/pkgconfig/*.pc
  222. %files -f tools.files tools
  223. %defattr(-,root,root)
  224. %files tkinter
  225. %defattr(-,root,root)
  226. %{python_lib}/tkinter
  227. %{python_lib}/lib-dynload/_tkinter.*.so*
  228. %files docs
  229. %defattr(-,root,root)
  230. %{config_htmldir}/*
  231. %changelog
  232. * Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
  233. - updated python to 3.3.0
  234. - update Patch1 (python-3.3.0-lib64.patch)
  235. - add BuildRequires: valgrind-devel
  236. * Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
  237. - updated python to 3.2
  238. - updated python-*-docs-html to 3.2
  239. - dropt all patchs
  240. - added python-3.2b2-lib64.patch
  241. - referred to the review Python-3.2/Misc/RPM/python-3.2.spec
  242. * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
  243. - rebuilt with openssl-1.0.0c
  244. * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
  245. - updated python to 3.1.3
  246. - added python-3.1.3-locale.patch
  247. - dropt python-3.1.2-lib64.patch
  248. - added python-3.1.3-lib64-*.patchs
  249. python-3.1.3-lib64-Makefile.patch
  250. python-3.1.3-lib64-setup.patch
  251. python-3.1.3-lib64-site.patch
  252. python-3.1.3-lib64-install.patch
  253. python-3.1.3-lib64-sysconfig.patch
  254. python-3.1.3-lib64-getpath.patch
  255. python-3.1.3-lib64-test_install.patch
  256. - added run_test macro to run unit test
  257. - added BR: libffi
  258. * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
  259. - rebuilt with rpm-4.8.1 for pkg-config
  260. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
  261. - spec in utf-8
  262. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
  263. - added missings in BuildRequires, Requires
  264. * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
  265. - initial build for VineSeed