python3-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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.4
  4. %define binsuffix 3.4
  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.4.2
  11. Release: 2%{?_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.4.2-lib64.patch
  18. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  19. BuildRequires: expat-devel
  20. BuildRequires: libdb-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-devel, tk-devel, 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. Summary(ja): Python プログラミング言語のドキュメント
  89. Group: Documentation
  90. %description docs
  91. The python-docs package contains documentation on the Python
  92. programming language and interpreter. The documentation is provided
  93. in ASCII text files and in LaTeX source files.
  94. Install the python-docs package if you'd like to use the documentation
  95. for the Python language.
  96. %prep
  97. %setup -q -n Python-%{version}
  98. %if %{_lib} == lib64
  99. %patch1 -p1 -b .lib64
  100. %endif
  101. %build
  102. ./configure \
  103. --prefix=%{_prefix} \
  104. --libdir=%{_libdir} \
  105. --enable-shared \
  106. --enable-ipv6 \
  107. --with-fpectl \
  108. --with-doc-strings \
  109. --with-pymalloc \
  110. --with-signal-module \
  111. --with-system-ffi \
  112. --with-threads \
  113. --with-valgrind \
  114. --without-ensurepip \
  115. %ifarch x86_64
  116. --with-universal-archs=64-bit \
  117. %endif
  118. CXX=g++;
  119. make %{?_smp_mflags}
  120. %if %{run_test}
  121. make test
  122. %endif
  123. %install
  124. [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
  125. echo '[install_scripts]' >setup.cfg
  126. echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg
  127. mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload
  128. make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
  129. # if --with-wide-unicode at configure
  130. ln -s python%{libvers}m $RPM_BUILD_ROOT%{_includedir}/python%{libvers}
  131. # replace path in pydoc
  132. if [ ! -z "%{binsuffix}" ]
  133. then
  134. (
  135. cd $RPM_BUILD_ROOT%{_bindir}
  136. mv pydoc%{libvers} pydoc.old
  137. sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \
  138. pydoc.old > pydoc%{libvers}
  139. chmod 755 pydoc%{libvers}
  140. rm -f pydoc.old
  141. )
  142. fi
  143. # Tools
  144. echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  145. echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  146. echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  147. echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  148. echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
  149. chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
  150. cp -a Tools $RPM_BUILD_ROOT%{python_lib}
  151. # make file lists
  152. rm -f mainpkg.files
  153. find "$RPM_BUILD_ROOT"%{python_lib} -type f |
  154. sed "s|^${RPM_BUILD_ROOT}|/|" |
  155. grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >> mainpkg.files
  156. rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
  157. find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
  158. sed "s|^${RPM_BUILD_ROOT}|/|" |
  159. grep -v -e '/bin/2to3%{binsuffix}$' |
  160. grep -v -e '/bin/pydoc%{binsuffix}$' |
  161. grep -v -e '/bin/smtpd.py%{binsuffix}$' |
  162. grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
  163. rm -f tools.files
  164. find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
  165. "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
  166. sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
  167. echo %{_bindir}/2to3-%{binsuffix} >> tools.files
  168. echo %{_bindir}/pydoc%{binsuffix} >> tools.files
  169. ##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
  170. echo %{_bindir}/idle%{binsuffix} >> tools.files
  171. # docs
  172. mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
  173. (
  174. cd "$RPM_BUILD_ROOT"%{config_htmldir}
  175. bunzip2 < %{SOURCE1} | tar x
  176. )
  177. # fix the #! line in installed files
  178. find "$RPM_BUILD_ROOT" -type f -print0 |
  179. xargs -0 grep -l /usr/local/bin/python | while read file
  180. do
  181. FIXFILE="$file"
  182. sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
  183. "$FIXFILE" >/tmp/fix-python-path.$$
  184. cat /tmp/fix-python-path.$$ > "$FIXFILE"
  185. rm -f /tmp/fix-python-path.$$
  186. done
  187. # check to see if there are any straggling #! lines
  188. find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
  189. | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
  190. if [ -s /tmp/python-rpm-files.$$ ]
  191. then
  192. echo '*****************************************************'
  193. cat /tmp/python-rpm-files.$$
  194. cat <<@EOF
  195. *****************************************************
  196. There are still files referencing /usr/local/bin/python in the
  197. install directory. They are listed above. Please fix the .spec
  198. file and try again. If you are an end-user, you probably want
  199. to report this to jafo-rpms@tummy.com as well.
  200. *****************************************************
  201. @EOF
  202. rm -f /tmp/python-rpm-files.$$
  203. exit 1
  204. fi
  205. rm -f /tmp/python-rpm-files.$$
  206. %post -p /sbin/ldconfig
  207. %postun -p /sbin/ldconfig
  208. %clean
  209. rm -fr $RPM_BUILD_ROOT
  210. %files -f mainpkg.files
  211. %defattr(-, root, root)
  212. %doc LICENSE
  213. %doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README
  214. %attr(755,root,root) %dir %{python_lib}/
  215. %{_libdir}/libpython*
  216. %{_mandir}/man1/python%{libvers}.1*
  217. %{_mandir}/man1/%{name}.1*
  218. %files devel
  219. %defattr(-,root,root)
  220. %dir %{_includedir}/python%{libvers}m
  221. %{_includedir}/python%{libvers}m/*.h
  222. %{_includedir}/python%{libvers}
  223. %{_libdir}/pkgconfig/*.pc
  224. %files -f tools.files tools
  225. %defattr(-,root,root)
  226. %files tkinter
  227. %defattr(-,root,root)
  228. %{python_lib}/tkinter
  229. %{python_lib}/lib-dynload/_tkinter.*.so*
  230. %files docs
  231. %defattr(-,root,root)
  232. %{config_htmldir}/*
  233. %changelog
  234. * Sun Mar 22 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.4.2-2
  235. - rebuilt with readline 6.3
  236. - changed BuildRequires: tcl-devel, tk-devel instead of tcl, tk respectively
  237. - changed BuildRequires: libdb-devel instead of db4-devel
  238. * Sun Jan 11 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2-1
  239. - new upstream release
  240. - update Patch1 (python-3.4.2-lib64.patch)
  241. * Sun Sep 07 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-3
  242. - remove configure option "--enable-profiling"
  243. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-2
  244. - rebuild with libffi-3.0.13
  245. * Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-1
  246. - new upstream release
  247. * Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.2-1
  248. - updated python to 3.3.2
  249. * Sun Jan 6 2013 IWAI, Masaharu <iwai@alib.jp> 3.3.0-2
  250. - build with Tcl/Tk 8.5.7-1
  251. * Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
  252. - updated python to 3.3.0
  253. - update Patch1 (python-3.3.0-lib64.patch)
  254. - add BuildRequires: valgrind-devel
  255. * Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
  256. - updated python to 3.2
  257. - updated python-*-docs-html to 3.2
  258. - dropt all patchs
  259. - added python-3.2b2-lib64.patch
  260. - referred to the review Python-3.2/Misc/RPM/python-3.2.spec
  261. * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
  262. - rebuilt with openssl-1.0.0c
  263. * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
  264. - updated python to 3.1.3
  265. - added python-3.1.3-locale.patch
  266. - dropt python-3.1.2-lib64.patch
  267. - added python-3.1.3-lib64-*.patchs
  268. python-3.1.3-lib64-Makefile.patch
  269. python-3.1.3-lib64-setup.patch
  270. python-3.1.3-lib64-site.patch
  271. python-3.1.3-lib64-install.patch
  272. python-3.1.3-lib64-sysconfig.patch
  273. python-3.1.3-lib64-getpath.patch
  274. python-3.1.3-lib64-test_install.patch
  275. - added run_test macro to run unit test
  276. - added BR: libffi
  277. * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
  278. - rebuilt with rpm-4.8.1 for pkg-config
  279. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
  280. - spec in utf-8
  281. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
  282. - added missings in BuildRequires, Requires
  283. * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
  284. - initial build for VineSeed