python3-vl.spec 12 KB

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