python3-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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.3
  11. Release: 3%{?_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.xz
  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, Takemikaduchi
  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. Requires: %{name} = %{version}-%{release}
  56. %description devel
  57. The Python programming language's interpreter can be extended with
  58. dynamically loaded extensions and can be embedded in other programs.
  59. This package contains the header files and libraries needed to do
  60. these types of tasks.
  61. Install python-devel if you want to develop Python extensions. The
  62. python package will also need to be installed. You'll probably also
  63. want to install the python-docs package, which contains Python
  64. documentation.
  65. %package tkinter
  66. Summary: A graphical user interface for the Python scripting language.
  67. Group: Development/Languages
  68. Requires: %{name} = %{version}-%{release}
  69. Requires: tcl, tk, tix
  70. Requires: libX11, libxcb, libXau, libXdmcp
  71. BuildRequires: tcl, tk, tix
  72. BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel
  73. %description tkinter
  74. The Tkinter (Tk interface) program is an graphical user interface for
  75. the Python scripting language.
  76. You should install the tkinter package if you'd like to use a graphical
  77. user interface for Python programming.
  78. %package tools
  79. Summary: A collection of development tools included with Python.
  80. Group: Development/Tools
  81. Requires: %{name} = %{version}-%{release}
  82. Requires: %{name}-tkinter = %{version}
  83. %description tools
  84. The Python package includes several development tools that are used
  85. to build python programs.
  86. %package docs
  87. Summary: Documentation for the Python programming language.
  88. Group: Documentation
  89. %description docs
  90. The python-docs package contains documentation on the Python
  91. programming language and interpreter. The documentation is provided
  92. in ASCII text files and in LaTeX source files.
  93. Install the python-docs package if you'd like to use the documentation
  94. for the Python language.
  95. %prep
  96. %setup -q -n Python-%{version}
  97. %if %{_lib} == lib64
  98. %patch1 -p1 -b .lib64
  99. %endif
  100. %build
  101. ./configure \
  102. --prefix=%{_prefix} \
  103. --libdir=%{_libdir} \
  104. --enable-shared \
  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. %{_mandir}/man1/%{name}.1*
  217. %files devel
  218. %defattr(-,root,root)
  219. %dir %{_includedir}/python%{libvers}m
  220. %{_includedir}/python%{libvers}m/*.h
  221. %{_includedir}/python%{libvers}
  222. %{_libdir}/pkgconfig/*.pc
  223. %files -f tools.files tools
  224. %defattr(-,root,root)
  225. %files tkinter
  226. %defattr(-,root,root)
  227. %{python_lib}/tkinter
  228. %{python_lib}/lib-dynload/_tkinter.*.so*
  229. %files docs
  230. %defattr(-,root,root)
  231. %{config_htmldir}/*
  232. %changelog
  233. * Sun Sep 07 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-3
  234. - remove configure option "--enable-profiling"
  235. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-2
  236. - rebuild with libffi-3.0.13
  237. * Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-1
  238. - new upstream release
  239. * Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.2-1
  240. - updated python to 3.3.2
  241. * Sun Jan 6 2013 IWAI, Masaharu <iwai@alib.jp> 3.3.0-2
  242. - build with Tcl/Tk 8.5.7-1
  243. * Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
  244. - updated python to 3.3.0
  245. - update Patch1 (python-3.3.0-lib64.patch)
  246. - add BuildRequires: valgrind-devel
  247. * Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
  248. - updated python to 3.2
  249. - updated python-*-docs-html to 3.2
  250. - dropt all patchs
  251. - added python-3.2b2-lib64.patch
  252. - referred to the review Python-3.2/Misc/RPM/python-3.2.spec
  253. * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
  254. - rebuilt with openssl-1.0.0c
  255. * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
  256. - updated python to 3.1.3
  257. - added python-3.1.3-locale.patch
  258. - dropt python-3.1.2-lib64.patch
  259. - added python-3.1.3-lib64-*.patchs
  260. python-3.1.3-lib64-Makefile.patch
  261. python-3.1.3-lib64-setup.patch
  262. python-3.1.3-lib64-site.patch
  263. python-3.1.3-lib64-install.patch
  264. python-3.1.3-lib64-sysconfig.patch
  265. python-3.1.3-lib64-getpath.patch
  266. python-3.1.3-lib64-test_install.patch
  267. - added run_test macro to run unit test
  268. - added BR: libffi
  269. * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
  270. - rebuilt with rpm-4.8.1 for pkg-config
  271. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
  272. - spec in utf-8
  273. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
  274. - added missings in BuildRequires, Requires
  275. * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
  276. - initial build for VineSeed