python3-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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: 5%{?_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 \
  174. -e '/python%{libvers}/config$' \
  175. -e '_tkinter.so$' \
  176. -e '_tkinter.cpython-' \
  177. >> mainpkg.files
  178. rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
  179. find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
  180. sed "s|^${RPM_BUILD_ROOT}|/|" |
  181. grep -v -e '/bin/2to3%{binsuffix}$' |
  182. grep -v -e '/bin/pydoc%{binsuffix}$' |
  183. grep -v -e '/bin/smtpd.py%{binsuffix}$' |
  184. grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
  185. rm -f tools.files
  186. find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
  187. "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
  188. sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
  189. echo %{_bindir}/2to3-%{binsuffix} >> tools.files
  190. echo %{_bindir}/pydoc%{binsuffix} >> tools.files
  191. ##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
  192. echo %{_bindir}/idle%{binsuffix} >> tools.files
  193. # docs
  194. mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
  195. (
  196. cd "$RPM_BUILD_ROOT"%{config_htmldir}
  197. bunzip2 < %{SOURCE1} | tar x
  198. )
  199. # fix the #! line in installed files
  200. find "$RPM_BUILD_ROOT" -type f -print0 |
  201. xargs -0 grep -l /usr/local/bin/python | while read file
  202. do
  203. FIXFILE="$file"
  204. sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
  205. "$FIXFILE" >/tmp/fix-python-path.$$
  206. cat /tmp/fix-python-path.$$ > "$FIXFILE"
  207. rm -f /tmp/fix-python-path.$$
  208. done
  209. # check to see if there are any straggling #! lines
  210. find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
  211. | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
  212. if [ -s /tmp/python-rpm-files.$$ ]
  213. then
  214. echo '*****************************************************'
  215. cat /tmp/python-rpm-files.$$
  216. cat <<@EOF
  217. *****************************************************
  218. There are still files referencing /usr/local/bin/python in the
  219. install directory. They are listed above. Please fix the .spec
  220. file and try again. If you are an end-user, you probably want
  221. to report this to jafo-rpms@tummy.com as well.
  222. *****************************************************
  223. @EOF
  224. rm -f /tmp/python-rpm-files.$$
  225. exit 1
  226. fi
  227. rm -f /tmp/python-rpm-files.$$
  228. %post -p /sbin/ldconfig
  229. %postun -p /sbin/ldconfig
  230. %clean
  231. rm -fr $RPM_BUILD_ROOT
  232. %files -f mainpkg.files
  233. %defattr(-, root, root)
  234. %license LICENSE
  235. %doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README
  236. %attr(755,root,root) %dir %{python_lib}/
  237. %{_libdir}/libpython*
  238. %{_mandir}/man1/python%{libvers}.1*
  239. %{_mandir}/man1/%{name}.1*
  240. %files devel
  241. %defattr(-,root,root)
  242. %dir %{_includedir}/python%{libvers}m
  243. %{_includedir}/python%{libvers}m/*.h
  244. %{_includedir}/python%{libvers}
  245. %{_libdir}/pkgconfig/*.pc
  246. %files -f tools.files tools
  247. %defattr(-,root,root)
  248. %files tkinter
  249. %defattr(-,root,root)
  250. %{python_lib}/tkinter
  251. %{python_lib}/lib-dynload/_tkinter.*.so*
  252. %files docs
  253. %defattr(-,root,root)
  254. %{config_htmldir}/*
  255. %changelog
  256. * Sat Oct 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-5
  257. - fixed %%files.
  258. * Tue Oct 15 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-4
  259. - rebuilt with tix-8.4.3-5.
  260. * Fri Oct 04 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-3
  261. - rebuilt with tcl/tk-8.6.9.
  262. * Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> 3.5.7-2
  263. - rebuild with readline-8.0 and ncurses-6.1
  264. * Sun May 12 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-1
  265. - new upstream release.
  266. - rebuilt with gdbm-1.18.1.
  267. - added R:libtirpc-devel to python3-devel.
  268. * Thu Feb 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.6-3
  269. - added BR:libxcrypt-devel.
  270. - added BR:libtirpc-devel.
  271. - added BR:libnsl2-devel.
  272. * Sat Jan 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.6-2
  273. - rebuilt with new toolchain.
  274. * Mon Nov 19 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.6-1
  275. - new upstream release.
  276. - really rebuilt with openssl-1.1.1.
  277. * Fri Nov 02 2018 Toshiaki Ara <ara_t@384.jp> 3.5.2-2
  278. - rebuild with openssl-1.1.1
  279. * Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.2-1
  280. - new upstream release
  281. - update Patch1 (python-3.5.2-lib64.patch)
  282. * Sun Mar 27 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.4-2
  283. - rebuild with openssl-1.0.2g
  284. * Sat Feb 13 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.4-1
  285. - new upstream release
  286. - add Patch2 (python3-3.4.4-revert-makefile.patch)
  287. * Sun Apr 12 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.3-1
  288. - new upstream release
  289. * Sun Mar 22 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.4.2-2
  290. - rebuilt with readline 6.3
  291. - changed BuildRequires: tcl-devel, tk-devel instead of tcl, tk respectively
  292. - changed BuildRequires: libdb-devel instead of db4-devel
  293. * Sun Jan 11 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2-1
  294. - new upstream release
  295. - update Patch1 (python-3.4.2-lib64.patch)
  296. * Sun Sep 07 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-3
  297. - remove configure option "--enable-profiling"
  298. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-2
  299. - rebuild with libffi-3.0.13
  300. * Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-1
  301. - new upstream release
  302. * Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.2-1
  303. - updated python to 3.3.2
  304. * Sun Jan 6 2013 IWAI, Masaharu <iwai@alib.jp> 3.3.0-2
  305. - build with Tcl/Tk 8.5.7-1
  306. * Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
  307. - updated python to 3.3.0
  308. - update Patch1 (python-3.3.0-lib64.patch)
  309. - add BuildRequires: valgrind-devel
  310. * Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
  311. - updated python to 3.2
  312. - updated python-*-docs-html to 3.2
  313. - dropt all patchs
  314. - added python-3.2b2-lib64.patch
  315. - referred to the review Python-3.2/Misc/RPM/python-3.2.spec
  316. * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
  317. - rebuilt with openssl-1.0.0c
  318. * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
  319. - updated python to 3.1.3
  320. - added python-3.1.3-locale.patch
  321. - dropt python-3.1.2-lib64.patch
  322. - added python-3.1.3-lib64-*.patchs
  323. python-3.1.3-lib64-Makefile.patch
  324. python-3.1.3-lib64-setup.patch
  325. python-3.1.3-lib64-site.patch
  326. python-3.1.3-lib64-install.patch
  327. python-3.1.3-lib64-sysconfig.patch
  328. python-3.1.3-lib64-getpath.patch
  329. python-3.1.3-lib64-test_install.patch
  330. - added run_test macro to run unit test
  331. - added BR: libffi
  332. * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
  333. - rebuilt with rpm-4.8.1 for pkg-config
  334. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
  335. - spec in utf-8
  336. * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
  337. - added missings in BuildRequires, Requires
  338. * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
  339. - initial build for VineSeed