python3-vl.spec 9.3 KB

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