python3-vl.spec 12 KB

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