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

Last change on this file since 1156 was 1156, checked in by dmik, 8 years ago

spec: python: Release version 2.7.6-18.

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