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

Last change on this file since 1118 was 1118, checked in by Yuri Dario, 8 years ago

spec: python: Release version 2.7.6-17.

  • Property svn:eol-style set to native
File size: 17.0 KB
Line 
1#define svn_url F:/rd/rpm/python/trunk
2%define svn_url http://svn.netlabs.org/repos/rpm/python/trunk
3%define svn_rev 1117
4
5%{!?__python_ver:%global __python_ver EMPTY}
6#global __python_ver 2.7
7%global unicode ucs4
8
9%global _default_patch_fuzz 2
10
11%if "%{__python_ver}" != "EMPTY"
12%global main_python 0
13%global python python%{__python_ver}
14%global tkinter tkinter%{__python_ver}
15%else
16%global main_python 1
17%global python python
18%global tkinter tkinter
19%endif
20
21%global pybasever 2.7
22%global pybasever_cond 27
23%global pylibdir %{_libdir}/python%{pybasever}
24%global tools_dir %{pylibdir}/Tools
25%global demo_dir %{pylibdir}/Demo
26%global doc_tools_dir %{pylibdir}/Doc/tools
27%global dynload_dir %{pylibdir}/lib-dynload
28%global site_packages %{pylibdir}/site-packages
29
30%global with_gdb_hooks 0
31
32%global with_systemtap 0
33
34%global with_valgrind 0
35
36# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
37# are deliberately invalid, leading to SyntaxError exceptions if they get
38# byte-compiled.
39#
40# These errors are ignored by the normal python build, and aren't normally a
41# problem in the buildroots since /usr/bin/python isn't present.
42#
43# However, for the case where we're rebuilding the python srpm on a machine
44# that does have python installed we need to set this to avoid
45# brp-python-bytecompile treating these as fatal errors:
46#
47%global _python_bytecompile_errors_terminate_build 0
48
49Summary: An interpreted, interactive, object-oriented programming language
50Name: %{python}
51Version: 2.7.6
52Release: 17%{?dist}
53License: Python
54Group: Development/Languages
55Provides: python-abi = %{pybasever}
56Provides: python(abi) = %{pybasever}
57
58Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
59
60BuildRequires: gcc make subversion zip
61
62%if %{main_python}
63Obsoletes: Distutils
64Provides: Distutils
65Obsoletes: python2
66Provides: python2 = %{version}
67Obsoletes: python-elementtree <= 1.2.6
68Obsoletes: python-sqlite < 2.3.2
69Provides: python-sqlite = 2.3.2
70Obsoletes: python-ctypes < 1.0.1
71Provides: python-ctypes = 1.0.1
72Obsoletes: python-hashlib < 20081120
73Provides: python-hashlib = 20081120
74Obsoletes: python-uuid < 1.31
75Provides: python-uuid = 1.31
76%endif
77
78# YD because of libcx
79Requires: db4 > 4.8.30-6
80
81# YD because of ucs4
82Conflicts: python-pycurl < 7.19.5.1-2
83Conflicts: rpm < 4.13.0-8
84Conflicts: yum-metadata-parser < 1.1.4-6
85
86# YD unix adds this automatically by parsing elf binaries
87Requires: %{name}-libs = %{version}-%{release}
88
89BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
90BuildRequires: readline-devel, openssl-devel, gmp-devel
91#BuildRequires: gdbm-devel, zlib-devel, expat-devel
92BuildRequires: ncurses-devel, zlib-devel, expat-devel
93#BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
94#BuildRequires: tar findutils pkgconfig tcl-devel tk-devel
95BuildRequires: bzip2 pkgconfig tcl-devel
96#BuildRequires: tix-devel
97BuildRequires: bzip2-devel sqlite-devel
98BuildRequires: autoconf
99BuildRequires: db4-devel >= 4.8
100#BuildRequires: libffi-devel
101%if 0%{?with_valgrind}
102BuildRequires: valgrind-devel
103%endif
104
105%if 0%{?with_systemtap}
106BuildRequires: systemtap-sdt-devel
107%global tapsetdir /usr/share/systemtap/tapset
108%endif
109
110# OS/2 specific
111BuildRequires: mmap urpo-devel
112
113URL: http://www.python.org/
114
115%description
116Python is an interpreted, interactive, object-oriented programming
117language often compared to Tcl, Perl, Scheme or Java. Python includes
118modules, classes, exceptions, very high level dynamic data types and
119dynamic typing. Python supports interfaces to many system calls and
120libraries, as well as to various windowing systems (X11, Motif, Tk,
121Mac and MFC).
122
123Programmers can write new built-in modules for Python in C or C++.
124Python can be used as an extension language for applications that need
125a programmable interface. This package contains most of the standard
126Python modules, as well as modules for interfacing to the Tix widget
127set for Tk and RPM.
128
129Note that documentation for Python is provided in the python-docs
130package.
131
132%package common
133Summary: An interpreted, interactive, object-oriented programming language
134Group: Development/Languages
135
136%description common
137Only binary files without versioned name. Allows multiple installations.
138
139%package libs
140Summary: The libraries for python runtime
141Group: Applications/System
142Requires: %{name} = %{version}-%{release}
143# Needed for ctypes, to load libraries, worked around for Live CDs size
144# Requires: binutils
145
146%description libs
147The python interpreter can be embedded into applications wanting to
148use python as an embedded scripting language. The python-libs package
149provides the libraries needed for this.
150
151%package devel
152Summary: The libraries and header files needed for Python development
153Group: Development/Libraries
154Requires: %{python}%{?_isa} = %{version}-%{release}
155Requires: python-rpm-macros
156Requires: python2-rpm-macros
157# Needed here because of the migration of Makefile from -devel to the main
158# package
159Conflicts: %{python} < %{version}-%{release}
160%if %{main_python}
161Obsoletes: python2-devel
162Provides: python2-devel = %{version}-%{release}
163%endif
164
165%description devel
166The Python programming language's interpreter can be extended with
167dynamically loaded extensions and can be embedded in other programs.
168This package contains the header files and libraries needed to do
169these types of tasks.
170
171Install python-devel if you want to develop Python extensions. The
172python package will also need to be installed. You'll probably also
173want to install the python-docs package, which contains Python
174documentation.
175
176%package tools
177Summary: A collection of development tools included with Python
178Group: Development/Tools
179Requires: %{name} = %{version}-%{release}
180Requires: %{tkinter} = %{version}-%{release}
181%if %{main_python}
182Obsoletes: python2-tools
183Provides: python2-tools = %{version}-%{release}
184%endif
185
186%description tools
187This package includes several tools to help with the development of Python
188programs, including IDLE (an IDE with editing and debugging facilities), a
189color editor (pynche), and a python gettext program (pygettext.py).
190
191%package -n %{tkinter}
192Summary: A graphical user interface for the Python scripting language
193Group: Development/Languages
194#BuildRequires: tcl, tk
195Requires: %{name} = %{version}-%{release}
196%if %{main_python}
197Obsoletes: tkinter2
198Provides: tkinter2 = %{version}-%{release}
199%endif
200
201%description -n %{tkinter}
202
203The Tkinter (Tk interface) program is an graphical user interface for
204the Python scripting language.
205
206You should install the tkinter package if you'd like to use a graphical
207user interface for Python programming.
208
209%package test
210Summary: The test modules from the main python package
211Group: Development/Languages
212Requires: %{name} = %{version}-%{release}
213
214%description test
215
216The test modules from the main python package: %{name}
217These have been removed to save space, as they are never or almost
218never used in production.
219
220You might want to install the python-test package if you're developing python
221code that uses more than just unittest and/or test_support.py.
222
223%debug_package
224
225%prep
226%if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
227%setup -q
228%else
229%setup -n "%{name}-%{version}" -Tc
230svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
231rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
232(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
233%endif
234
235%if 0%{?with_systemtap}
236# Provide an example of usage of the tapset:
237cp -a %{SOURCE4} .
238cp -a %{SOURCE5} .
239%endif # with_systemtap
240
241# Ensure that we're using the system copy of various libraries, rather than
242# copies shipped by upstream in the tarball:
243# Remove embedded copy of expat:
244#rm -r Modules/expat || exit 1
245# Remove embedded copy of libffi:
246#for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
247# rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
248#done
249# Remove embedded copy of zlib:
250#rm -r Modules/zlib || exit 1
251
252# This shouldn't be necesarry, but is right now (2.2a3)
253find -name "*~" |xargs rm -f
254
255# generate configure & friends
256autoreconf -fvi
257
258%build
259
260export LDFLAGS="-g -Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
261export LIBS="-lcx -lssl -lcrypto -lurpo -lpthread -lintl"
262%configure \
263 --enable-shared \
264 --with-system-expat \
265 --enable-unicode=ucs4 \
266 --with-system-ffi
267
268make OPT="$CFLAGS" %{?_smp_mflags}
269
270%install
271rm -rf %{buildroot}
272mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
273
274make install DESTDIR=%{buildroot}
275
276# YD fix binaries
277cp %{buildroot}%{_bindir}/python.exe %{buildroot}%{_bindir}/python
278rm -f %{buildroot}%{_bindir}/python%{pybasever_cond}.dll
279
280# Junk, no point in putting in -test sub-pkg
281rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
282
283# don't include tests that are run at build time in the package
284# This is documented, and used: rhbz#387401
285if /bin/false; then
286 # Move this to -test subpackage.
287mkdir save_bits_of_test
288for i in test_support.py __init__.py; do
289 cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
290done
291rm -rf %{buildroot}/%{pylibdir}/test
292mkdir %{buildroot}/%{pylibdir}/test
293cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
294fi
295
296#%if %{main_python}
297#ln -s python %{buildroot}%{_bindir}/python2
298#%else
299#mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
300#mv %{buildroot}/%{_mandir}/man1/python.1 %{buildroot}/%{_mandir}/man1/python%{pybasever}.1
301#%endif
302
303# tools
304
305mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
306
307#gettext
308install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
309install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
310
311# Useful development tools
312install -m755 -d %{buildroot}%{tools_dir}/scripts
313install Tools/README %{buildroot}%{tools_dir}/
314install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
315
316# Documentation tools
317install -m755 -d %{buildroot}%{doc_tools_dir}
318#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
319
320# Useful demo scripts
321install -m755 -d %{buildroot}%{demo_dir}
322cp -ar Demo/* %{buildroot}%{demo_dir}
323
324# Get rid of crap
325find %{buildroot}/ -name "*~"|xargs rm -f
326find %{buildroot}/ -name ".cvsignore"|xargs rm -f
327find . -name "*~"|xargs rm -f
328find . -name ".cvsignore"|xargs rm -f
329#zero length
330rm -f %{buildroot}%{site_packages}/modulator/Templates/copyright
331
332rm -f %{buildroot}%{pylibdir}/LICENSE.txt
333
334
335#make the binaries install side by side with the main python
336#%if !%{main_python}
337#pushd %{buildroot}%{_bindir}
338#mv idle idle%{__python_ver}
339#mv modulator modulator%{__python_ver}
340#mv pynche pynche%{__python_ver}
341#mv pygettext.py pygettext%{__python_ver}.py
342#mv msgfmt.py msgfmt%{__python_ver}.py
343#mv smtpd.py smtpd%{__python_ver}.py
344#mv pydoc pydoc%{__python_ver}
345#popd
346#%endif
347
348# Fix for bug #136654
349rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au
350
351%global _pyconfig_h pyconfig.h
352
353# Get rid of egg-info files (core python modules are installed through rpms)
354rm %{buildroot}%{pylibdir}/*.egg-info
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
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%exclude %{_bindir}/*.dbg
385
386%dir %{pylibdir}
387%dir %{dynload_dir}
388%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
389%{dynload_dir}/*.pyd
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
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%exclude %{_libdir}/*.dbg
449%{pylibdir}/unittest/*
450
451%files devel
452%defattr(-,root,root,-)
453%{pylibdir}/config/*
454%exclude %{pylibdir}/config/Makefile
455%{_includedir}/python%{pybasever}/*.h
456%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
457%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
458%if %{main_python}
459%{_bindir}/python-config
460%endif
461%{_bindir}/python?*-config
462#%{_libdir}/libpython%{pybasever}.pyd
463%{_libdir}/python%{pybasever}_dll.a
464%{_libdir}/pkgconfig
465
466%files tools
467%defattr(-,root,root,755)
468#%doc Tools/modulator/README.modulator
469#%doc Tools/pynche/README.pynche
470#%{site_packages}/modulator
471#%{site_packages}/pynche
472%{_bindir}/smtpd*.py*
473%{_bindir}/2to3*
474%{_bindir}/idle*
475#%{_bindir}/modulator*
476#%{_bindir}/pynche*
477%{_bindir}/pygettext*.py*
478%{_bindir}/msgfmt*.py*
479%{tools_dir}
480%{demo_dir}
481%{pylibdir}/Doc
482
483%files -n %{tkinter}
484%defattr(-,root,root,755)
485%{pylibdir}/lib-tk
486#%{dynload_dir}/_tkinter.pyd
487
488%files test
489%defattr(-, root, root, -)
490%{pylibdir}/bsddb/test
491%{pylibdir}/ctypes/test
492%{pylibdir}/distutils/tests
493%{pylibdir}/email/test
494%{pylibdir}/json/tests
495%{pylibdir}/sqlite3/test
496%{pylibdir}/test/*
497# These two are shipped in the main subpackage:
498%exclude %{pylibdir}/test/test_support.py*
499%exclude %{pylibdir}/test/__init__.py*
500%{dynload_dir}/_ctypes_test.pyd
501%{dynload_dir}/_ct3574.pyd
502%{dynload_dir}/_testcapi.pyd
503%{dynload_dir}/_te3228.pyd
504
505# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
506# ldconfig (rhbz:562980).
507#
508# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
509# debugfiles.list, and it appears that everything below /usr/lib/debug and
510# (/usr/src/debug) gets added to this file (via LISTFILES) in
511# /usr/lib/rpm/find-debuginfo.sh
512#
513# Hence by installing it below /usr/lib/debug we ensure it is added to the
514# -debuginfo subpackage
515# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
516# payload file would be unpackaged)
517
518%changelog
519* Mon Apr 24 2017 yd <yd@os2power.com> 2.7.6-17
520- add new requirements and move unittest files. ticket#248.
521
522* Fri Feb 17 2017 yd <yd@os2power.com> 2.7.6-16
523- force db4 minimal version (libcx req).
524
525* Thu Feb 09 2017 yd <yd@os2power.com> 2.7.6-15
526- link with libcx for memory mapping support.
527
528* Fri Jun 10 2016 yd <yd@os2power.com> 2.7.6-14
529- fixed Obsoletes vs Conflicts.
530- fixed python2-devel and -tools version.
531
532* Thu Jun 09 2016 yd <yd@os2power.com> 2.7.6-13
533- enable support for ucs4 unicode set. ticket#182.
534- r780, fix file deletion. ticket#185.
535- r779, remove 8.3 file name truncation, use opendir() to avoid resolving symlinks. ticket#185.
536- r775, generate both 8.3 and long names for pyd dynamic libraries. fixes ticket#185.
537
538* Sat Dec 12 2015 Dmitriy Kuminov <coding@dmik.org> 2.7.6-12
539- r611, Add dummy plat-os2knix directory.
540- r610, Fix silly typo.
541- r609, Fix a typo in r529.
542- r608, Make os.path.defpath return '$UNIXROOT/usr/bin' on OS/2 when it is set.
543- r607, Replace altsep to sep in paths returned by os.path.join.
544- r606, Add ignore patterns for *.pyc and generated files.
545- r605, configure: Generate correct OS/2 defs and remove pre-built configure.
546- r604, Fix building with no OS/2 Toolkit headers in include paths.
547- r603, Use configured SHELL in subprocess module.
548- Provide dummy _dlopen in ctypes to make colorama package happy.
549- Use configured SHELL for subprocess.Popen(shell=True) instead of
550 hardcoded '/bin/sh'.
551- Make os.path.join replace all altsep (\) with sep (/) on return (to
552 fix joining names with components of PATH-like env. vars and passing
553 the results to a unix shell).
554- Make os.path.defpath return '$UNIXROOT\\usr\\bin'.
555- r568, build mmap module, by psmedley.
556
557* Thu Feb 26 2015 yd <yd@os2power.com> 2.7.6-11
558- r560, -O3 breaks the build, at least for pentium4 march.
559- r529, use unixroot path for script path replacement. Fixes ticket#114.
560
561* Mon Apr 07 2014 yd
562- build for python 2.7.
563
564* Sat Mar 15 2014 yd
565- r385 and others, added support for virtualenv.
566- added debug package with symbolic info for exceptq.
567
568* Wed Jun 05 2013 yd
569- r348, add samefile, sameopenfile, samestat to os.path module.
570
571* Thu Dec 27 2012 yd
572- fix local/bin requirements for python-tools.
573
574* Mon Jan 16 2012 yd
575- rebuild with libc 0.6.4 runtime.
Note: See TracBrowser for help on using the repository browser.