source: spec/trunk/SPECS/python.spec@ 1555

Last change on this file since 1555 was 1555, checked in by Silvan Scherrer, 7 years ago

spec: python: Release version 2.7.6-23.

  • Property svn:eol-style set to native
File size: 18.9 KB
Line 
1%{!?__python_ver:%global __python_ver EMPTY}
2#global __python_ver 2.7
3%global unicode ucs4
4
5%global _default_patch_fuzz 2
6
7%if "%{__python_ver}" != "EMPTY"
8%global main_python 0
9%global python python%{__python_ver}
10%global tkinter tkinter%{__python_ver}
11%else
12%global main_python 1
13%global python python
14%global tkinter tkinter
15%endif
16
17%global pybasever 2.7
18%global pybasever_cond 27
19%global pylibdir %{_libdir}/python%{pybasever}
20%global tools_dir %{pylibdir}/Tools
21%global demo_dir %{pylibdir}/Demo
22%global doc_tools_dir %{pylibdir}/Doc/tools
23%global dynload_dir %{pylibdir}/lib-dynload
24%global site_packages %{pylibdir}/site-packages
25
26%global with_gdb_hooks 0
27
28%global with_systemtap 0
29
30%global with_valgrind 0
31
32# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
33# are deliberately invalid, leading to SyntaxError exceptions if they get
34# byte-compiled.
35#
36# These errors are ignored by the normal python build, and aren't normally a
37# problem in the buildroots since /usr/bin/python isn't present.
38#
39# However, for the case where we're rebuilding the python srpm on a machine
40# that does have python installed we need to set this to avoid
41# brp-python-bytecompile treating these as fatal errors:
42#
43%global _python_bytecompile_errors_terminate_build 0
44
45# Completely disable python dependency generators as we enforce the right
46# provides/requires manually. This, in particular, prevents python-libs from
47# having the python(abi) dependency so that it can be installed anone.
48%global __python_provides %{nil}
49%global __python_requires %{nil}
50
51# Exclude Windows installer stubs from debug info stripping
52%define _strip_opts --debuginfo -x "wininst-*.exe"
53
54Summary: An interpreted, interactive, object-oriented programming language
55Name: %{python}
56Version: 2.7.6
57Release: 23%{?dist}
58License: Python
59Group: Development/Languages
60Vendor: bww bitwise works GmbH
61
62Requires: %{name}-libs = %{version}-%{release}
63Provides: python-abi = %{pybasever}
64Provides: python(abi) = %{pybasever}
65
66%scm_source svn http://svn.netlabs.org/repos/rpm/python/trunk 1551
67
68%if %{main_python}
69Obsoletes: Distutils
70Provides: Distutils
71Obsoletes: python2
72Provides: python2 = %{version}
73Obsoletes: python-elementtree <= 1.2.6
74Obsoletes: python-sqlite < 2.3.2
75Provides: python-sqlite = 2.3.2
76Obsoletes: python-ctypes < 1.0.1
77Provides: python-ctypes = 1.0.1
78Obsoletes: python-hashlib < 20081120
79Provides: python-hashlib = 20081120
80Obsoletes: python-uuid < 1.31
81Provides: python-uuid = 1.31
82%endif
83
84# Because of getaddrinfo
85Requires: libcx >= 0.6.3
86# Because of DosEnterCritSec removal
87Requires: pthread >= 20171227
88
89# YD because of libcx
90Requires: db4 > 4.8.30-6
91
92# YD because of ucs4
93Conflicts: python-pycurl < 7.19.5.1-2
94Conflicts: rpm < 4.13.0-8
95Conflicts: yum-metadata-parser < 1.1.4-6
96
97BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
98BuildRequires: readline-devel, openssl-devel, gmp-devel
99#BuildRequires: gdbm-devel, zlib-devel, expat-devel
100BuildRequires: ncurses-devel, zlib-devel, expat-devel
101#BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
102#BuildRequires: tar findutils pkgconfig tcl-devel tk-devel
103BuildRequires: bzip2 pkgconfig tcl-devel
104#BuildRequires: tix-devel
105BuildRequires: bzip2-devel sqlite-devel
106BuildRequires: autoconf
107BuildRequires: db4-devel >= 4.8
108BuildRequires: libffi-devel
109%if 0%{?with_valgrind}
110BuildRequires: valgrind-devel
111%endif
112
113%if 0%{?with_systemtap}
114BuildRequires: systemtap-sdt-devel
115%global tapsetdir /usr/share/systemtap/tapset
116%endif
117
118BuildRequires: libcx-devel >= 0.6.1-2
119BuildRequires: pthread-devel >= 20171227
120
121URL: http://www.python.org/
122
123%description
124Python is an interpreted, interactive, object-oriented programming
125language often compared to Tcl, Perl, Scheme or Java. Python includes
126modules, classes, exceptions, very high level dynamic data types and
127dynamic typing. Python supports interfaces to many system calls and
128libraries, as well as to various windowing systems (X11, Motif, Tk,
129Mac and MFC).
130
131Programmers can write new built-in modules for Python in C or C++.
132Python can be used as an extension language for applications that need
133a programmable interface. This package contains most of the standard
134Python modules, as well as modules for interfacing to the Tix widget
135set for Tk and RPM.
136
137Note that documentation for Python is provided in the python-docs
138package.
139
140%package common
141Summary: An interpreted, interactive, object-oriented programming language
142Group: Development/Languages
143
144%description common
145Only binary files without versioned name. Allows multiple installations.
146
147%package libs
148Summary: The libraries for python runtime
149Group: Applications/System
150
151# Needed for ctypes, to load libraries, worked around for Live CDs size
152# Requires: binutils
153
154%description libs
155The python interpreter can be embedded into applications wanting to
156use python as an embedded scripting language. The python-libs package
157provides the libraries needed for this.
158
159%package devel
160Summary: The libraries and header files needed for Python development
161Group: Development/Libraries
162Requires: %{python} = %{version}-%{release}
163Requires: python-rpm-macros
164Requires: python2-rpm-macros
165# Needed here because of the migration of Makefile from -devel to the main
166# package
167Conflicts: %{python} < %{version}-%{release}
168%if %{main_python}
169Obsoletes: python2-devel
170Provides: python2-devel = %{version}-%{release}
171%endif
172
173%description devel
174The Python programming language's interpreter can be extended with
175dynamically loaded extensions and can be embedded in other programs.
176This package contains the header files and libraries needed to do
177these types of tasks.
178
179Install python-devel if you want to develop Python extensions. The
180python package will also need to be installed. You'll probably also
181want to install the python-docs package, which contains Python
182documentation.
183
184%package tools
185Summary: A collection of development tools included with Python
186Group: Development/Tools
187Requires: %{name} = %{version}-%{release}
188Requires: %{tkinter} = %{version}-%{release}
189%if %{main_python}
190Obsoletes: python2-tools
191Provides: python2-tools = %{version}-%{release}
192%endif
193
194%description tools
195This package includes several tools to help with the development of Python
196programs, including IDLE (an IDE with editing and debugging facilities), a
197color editor (pynche), and a python gettext program (pygettext.py).
198
199%package -n %{tkinter}
200Summary: A graphical user interface for the Python scripting language
201Group: Development/Languages
202#BuildRequires: tcl, tk
203Requires: %{name} = %{version}-%{release}
204%if %{main_python}
205Obsoletes: tkinter2
206Provides: tkinter2 = %{version}-%{release}
207%endif
208
209%description -n %{tkinter}
210
211The Tkinter (Tk interface) program is an graphical user interface for
212the Python scripting language.
213
214You should install the tkinter package if you'd like to use a graphical
215user interface for Python programming.
216
217%package test
218Summary: The test modules from the main python package
219Group: Development/Languages
220Requires: %{name} = %{version}-%{release}
221
222%description test
223
224The test modules from the main python package: %{name}
225These have been removed to save space, as they are never or almost
226never used in production.
227
228You might want to install the python-test package if you're developing python
229code that uses more than just unittest and/or test_support.py.
230
231%debug_package
232
233%prep
234%scm_setup
235
236%if 0%{?with_systemtap}
237# Provide an example of usage of the tapset:
238cp -a %{SOURCE4} .
239cp -a %{SOURCE5} .
240%endif # with_systemtap
241
242# Ensure that we're using the system copy of various libraries, rather than
243# copies shipped by upstream in the tarball:
244# Remove embedded copy of expat:
245#rm -r Modules/expat || exit 1
246# Remove embedded copy of libffi:
247#for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
248# rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
249#done
250# Remove embedded copy of zlib:
251#rm -r Modules/zlib || exit 1
252
253# This shouldn't be necesarry, but is right now (2.2a3)
254find -name "*~" |xargs rm -f
255
256# generate configure & friends
257autoreconf -fvi
258
259%build
260
261# NOTE: Put -lcx to LDFLAGS instead of LIBS to have LIBCx linked to all shared
262# (.pyd) modules in addition to the python DLL and EXE itself
263export LDFLAGS="-g -Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp -Zmap -lcx"
264export LIBS="-lssl -lcrypto -lintl"
265%configure \
266 --enable-shared \
267 --with-system-expat \
268 --enable-unicode=ucs4 \
269 --with-system-ffi
270
271make OPT="$CFLAGS" %{?_smp_mflags}
272
273%install
274rm -rf %{buildroot}
275mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
276
277make install DESTDIR=%{buildroot}
278
279# YD fix binaries
280ln -s %{_bindir}/python.exe %{buildroot}%{_bindir}/python
281rm -f %{buildroot}%{_bindir}/python%{pybasever_cond}.dll
282
283# Junk, no point in putting in -test sub-pkg
284rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
285
286# don't include tests that are run at build time in the package
287# This is documented, and used: rhbz#387401
288if /bin/false; then
289 # Move this to -test subpackage.
290mkdir save_bits_of_test
291for i in test_support.py __init__.py; do
292 cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
293done
294rm -rf %{buildroot}/%{pylibdir}/test
295mkdir %{buildroot}/%{pylibdir}/test
296cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
297fi
298
299#%if %{main_python}
300#ln -s python %{buildroot}%{_bindir}/python2
301#%else
302#mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
303#mv %{buildroot}/%{_mandir}/man1/python.1 %{buildroot}/%{_mandir}/man1/python%{pybasever}.1
304#%endif
305
306# tools
307
308mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
309
310#gettext
311install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
312install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
313
314# Useful development tools
315install -m755 -d %{buildroot}%{tools_dir}/scripts
316install Tools/README %{buildroot}%{tools_dir}/
317install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
318
319# Documentation tools
320install -m755 -d %{buildroot}%{doc_tools_dir}
321#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
322
323# Useful demo scripts
324install -m755 -d %{buildroot}%{demo_dir}
325cp -ar Demo/* %{buildroot}%{demo_dir}
326
327# Get rid of crap
328find %{buildroot}/ -name "*~"|xargs rm -f
329find %{buildroot}/ -name ".cvsignore"|xargs rm -f
330find . -name "*~"|xargs rm -f
331find . -name ".cvsignore"|xargs rm -f
332#zero length
333rm -f %{buildroot}%{site_packages}/modulator/Templates/copyright
334
335rm -f %{buildroot}%{pylibdir}/LICENSE.txt
336
337
338#make the binaries install side by side with the main python
339#%if !%{main_python}
340#pushd %{buildroot}%{_bindir}
341#mv idle idle%{__python_ver}
342#mv modulator modulator%{__python_ver}
343#mv pynche pynche%{__python_ver}
344#mv pygettext.py pygettext%{__python_ver}.py
345#mv msgfmt.py msgfmt%{__python_ver}.py
346#mv smtpd.py smtpd%{__python_ver}.py
347#mv pydoc pydoc%{__python_ver}
348#popd
349#%endif
350
351# Fix for bug #136654
352rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au
353
354%global _pyconfig_h pyconfig.h
355
356# Get rid of egg-info files (core python modules are installed through rpms)
357rm %{buildroot}%{pylibdir}/*.egg-info
358
359# Get rid of all .pyo files as they are identical to .pyc (only needed in
360# python -O mode which is used rarely or not at all on OS/2)
361find %{buildroot}%{pylibdir} -type f -name *.pyo -exec rm -f {} +
362
363%clean
364rm -fr %{buildroot}
365
366#%post libs -p /sbin/ldconfig
367
368#%postun libs -p /sbin/ldconfig
369
370
371%post
372if [ "$1" = 1 ] ; then
373#execute only on first install
374%cube {DELLINE "SET PYTHONPATH="} %{os2_config_sys} > NUL
375%cube {DELLINE "SET PYTHONHOME="} %{os2_config_sys} > NUL
376fi
377
378
379%files -f %{debug_package_exclude_files}
380%defattr(-, root, root, -)
381%doc LICENSE README
382%{_bindir}/pydoc*
383%{_bindir}/python
384%{_bindir}/python.exe
385%{_bindir}/python2
386%if %{main_python}
387#%{_bindir}/python2
388%endif
389%{_bindir}/python%{pybasever}.exe
390%{_mandir}/*/*
391
392%dir %{pylibdir}
393%dir %{dynload_dir}
394%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
395%{dynload_dir}/*.pyd
396%exclude %{dynload_dir}/*.map
397%exclude %{dynload_dir}/_ctypes_test.pyd
398%exclude %{dynload_dir}/_ct3574.pyd
399%exclude %{dynload_dir}/_testcapi.pyd
400%exclude %{dynload_dir}/_te3228.pyd
401
402%dir %{site_packages}
403%{site_packages}/README
404%{pylibdir}/*.py*
405%{pylibdir}/*.doc
406%dir %{pylibdir}/bsddb
407%{pylibdir}/bsddb/*.py*
408%{pylibdir}/compiler
409%dir %{pylibdir}/ctypes
410%{pylibdir}/ctypes/*.py*
411%{pylibdir}/ctypes/macholib
412%{pylibdir}/curses
413%dir %{pylibdir}/distutils
414%{pylibdir}/distutils/*.py*
415%{pylibdir}/distutils/README
416%{pylibdir}/distutils/command
417%dir %{pylibdir}/email
418%{pylibdir}/email/*.py*
419%{pylibdir}/email/mime
420%{pylibdir}/encodings
421%{pylibdir}/hotshot
422%{pylibdir}/idlelib
423%{pylibdir}/importlib
424%dir %{pylibdir}/json
425%{pylibdir}/json/*.py*
426%{pylibdir}/lib2to3
427%{pylibdir}/logging
428%{pylibdir}/multiprocessing
429%{pylibdir}/plat-os2knix
430%{pylibdir}/pydoc_data
431%dir %{pylibdir}/sqlite3
432%{pylibdir}/sqlite3/*.py*
433%dir %{pylibdir}/test
434%{pylibdir}/test/test_support.py*
435%{pylibdir}/test/__init__.py*
436%{pylibdir}/wsgiref
437%{pylibdir}/xml
438
439# "Makefile" and the config-32/64.h file are needed by
440# distutils/sysconfig.py:_init_posix(), so we include them in the core
441# package, along with their parent directories (bug 531901):
442%dir %{pylibdir}/config
443%{pylibdir}/config/Makefile
444%dir %{_includedir}/python%{pybasever}
445%{_includedir}/python%{pybasever}/%{_pyconfig_h}
446
447%files libs -f %{debug_package_exclude_files}
448%defattr(-,root,root,-)
449#%doc LICENSE README
450%{_libdir}/python%{pybasever_cond}.dll
451%if 0%{?with_systemtap}
452%{tapsetdir}/%{libpython_stp}
453%doc systemtap-example.stp pyfuntop.stp
454%endif
455%{pylibdir}/unittest/*
456
457%files devel
458%defattr(-,root,root,-)
459%{pylibdir}/config/*
460%exclude %{pylibdir}/config/Makefile
461%{_includedir}/python%{pybasever}/*.h
462%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
463%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
464%if %{main_python}
465%{_bindir}/python-config
466%endif
467%{_bindir}/python?*-config
468#%{_libdir}/libpython%{pybasever}.pyd
469%{_libdir}/python%{pybasever}_dll.a
470%{_libdir}/pkgconfig
471
472%files tools
473%defattr(-,root,root,755)
474#%doc Tools/modulator/README.modulator
475#%doc Tools/pynche/README.pynche
476#%{site_packages}/modulator
477#%{site_packages}/pynche
478%{_bindir}/smtpd*.py*
479%{_bindir}/2to3*
480%{_bindir}/idle*
481#%{_bindir}/modulator*
482#%{_bindir}/pynche*
483%{_bindir}/pygettext*.py*
484%{_bindir}/msgfmt*.py*
485%{tools_dir}
486%{demo_dir}
487%{pylibdir}/Doc
488
489%files -n %{tkinter}
490%defattr(-,root,root,755)
491%{pylibdir}/lib-tk
492#%{dynload_dir}/_tkinter.pyd
493
494%files test
495%defattr(-, root, root, -)
496%{pylibdir}/bsddb/test
497%{pylibdir}/ctypes/test
498%{pylibdir}/distutils/tests
499%{pylibdir}/email/test
500%{pylibdir}/json/tests
501%{pylibdir}/sqlite3/test
502%{pylibdir}/test/*
503# These two are shipped in the main subpackage:
504%exclude %{pylibdir}/test/test_support.py*
505%exclude %{pylibdir}/test/__init__.py*
506%{dynload_dir}/_ctypes_test.pyd
507%{dynload_dir}/_ct3574.pyd
508%{dynload_dir}/_testcapi.pyd
509%{dynload_dir}/_te3228.pyd
510
511# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
512# ldconfig (rhbz:562980).
513#
514# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
515# debugfiles.list, and it appears that everything below /usr/lib/debug and
516# (/usr/src/debug) gets added to this file (via LISTFILES) in
517# /usr/lib/rpm/find-debuginfo.sh
518#
519# Hence by installing it below /usr/lib/debug we ensure it is added to the
520# -debuginfo subpackage
521# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
522# payload file would be unpackaged)
523
524%changelog
525* Mon Jan 14 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.7.6-23
526- fix ticket #326
527
528* Fri Dec 21 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.7.6-22
529- adjust getaddrinfo and friends to latest libcx
530- don't add .exe to symlinks
531
532* Mon Jun 18 2018 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.7.6-21
533- use %{os2_config_sys} macro instead of fixed c:\config.sys
534
535* Wed Apr 18 2018 Dmitriy Kuminov <coding@dmik.org> 2.7.6-20.
536- Understand `*module.pyd` and `*module.dll` extensions for Python modules.
537- Improve handling of BEGINLIBPATH and other pseudo-env vars (#299).
538
539* Mon Jan 8 2018 Dmitriy Kuminov <coding@dmik.org> 2.7.6-19
540- Make sys.executable work for fancy python exe names on OS/2.
541- Enable real os.spawnv* implementation on OS/2.
542- Use LIBCx spawn2 instead of fork in subprocess module to improve performance.
543- Don't flatten case of tempdir (fixes file name comparison in some apps).
544- Support NUMBER_OF_PROCESSORS in multitasking.cpu_count() on OS/2.
545- Fix handling drive letters in urllib.url2pathname and pathname2url on OS/2.
546- Bring pthread dependency back (it's still used).
547
548* Sat Jun 3 2017 Dmitriy Kuminov <coding@dmik.org> 2.7.6-18
549- Put the LIBCx library to LDFLAGS rather than LIBS to have all module DLLs
550 linked against it as well.
551- Rebuild against LIBCx 0.5.3 to incorporate DosRead JFS workaround for fread.
552- Remove urpo as it conflicts with LIBCx.
553- Remove pthread from libraries as not needed any more.
554- Remove .pyo files (needed only in python -O mode which is rarely used).
555- Remove .dbg files for Windows stubs (wininst-*.exe).
556- Use scm_source/scm_setup for downloading sources.
557
558* Mon Apr 24 2017 yd <yd@os2power.com> 2.7.6-17
559- add new requirements and move unittest files. ticket#248.
560
561* Fri Feb 17 2017 yd <yd@os2power.com> 2.7.6-16
562- force db4 minimal version (libcx req).
563
564* Thu Feb 09 2017 yd <yd@os2power.com> 2.7.6-15
565- link with libcx for memory mapping support.
566
567* Fri Jun 10 2016 yd <yd@os2power.com> 2.7.6-14
568- fixed Obsoletes vs Conflicts.
569- fixed python2-devel and -tools version.
570
571* Thu Jun 09 2016 yd <yd@os2power.com> 2.7.6-13
572- enable support for ucs4 unicode set. ticket#182.
573- r780, fix file deletion. ticket#185.
574- r779, remove 8.3 file name truncation, use opendir() to avoid resolving symlinks. ticket#185.
575- r775, generate both 8.3 and long names for pyd dynamic libraries. fixes ticket#185.
576
577* Sat Dec 12 2015 Dmitriy Kuminov <coding@dmik.org> 2.7.6-12
578- r611, Add dummy plat-os2knix directory.
579- r610, Fix silly typo.
580- r609, Fix a typo in r529.
581- r608, Make os.path.defpath return '$UNIXROOT/usr/bin' on OS/2 when it is set.
582- r607, Replace altsep to sep in paths returned by os.path.join.
583- r606, Add ignore patterns for *.pyc and generated files.
584- r605, configure: Generate correct OS/2 defs and remove pre-built configure.
585- r604, Fix building with no OS/2 Toolkit headers in include paths.
586- r603, Use configured SHELL in subprocess module.
587- Provide dummy _dlopen in ctypes to make colorama package happy.
588- Use configured SHELL for subprocess.Popen(shell=True) instead of
589 hardcoded '/bin/sh'.
590- Make os.path.join replace all altsep (\) with sep (/) on return (to
591 fix joining names with components of PATH-like env. vars and passing
592 the results to a unix shell).
593- Make os.path.defpath return '$UNIXROOT\\usr\\bin'.
594- r568, build mmap module, by psmedley.
595
596* Thu Feb 26 2015 yd <yd@os2power.com> 2.7.6-11
597- r560, -O3 breaks the build, at least for pentium4 march.
598- r529, use unixroot path for script path replacement. Fixes ticket#114.
599
600* Mon Apr 07 2014 yd
601- build for python 2.7.
602
603* Sat Mar 15 2014 yd
604- r385 and others, added support for virtualenv.
605- added debug package with symbolic info for exceptq.
606
607* Wed Jun 05 2013 yd
608- r348, add samefile, sameopenfile, samestat to os.path module.
609
610* Thu Dec 27 2012 yd
611- fix local/bin requirements for python-tools.
612
613* Mon Jan 16 2012 yd
614- rebuild with libc 0.6.4 runtime.
Note: See TracBrowser for help on using the repository browser.