python3-vl.spec 11 KB

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