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

Last change on this file since 1003 was 1003, checked in by Yuri Dario, 9 years ago

spec: python, force db4 minimal version (libcx req).

  • Property svn:eol-style set to native
File size: 16.9 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 977
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: 16%{?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}
155# Needed here because of the migration of Makefile from -devel to the main
156# package
157Conflicts: %{python} < %{version}-%{release}
158%if %{main_python}
159Obsoletes: python2-devel
160Provides: python2-devel = %{version}-%{release}
161%endif
162
163%description devel
164The Python programming language's interpreter can be extended with
165dynamically loaded extensions and can be embedded in other programs.
166This package contains the header files and libraries needed to do
167these types of tasks.
168
169Install python-devel if you want to develop Python extensions. The
170python package will also need to be installed. You'll probably also
171want to install the python-docs package, which contains Python
172documentation.
173
174%package tools
175Summary: A collection of development tools included with Python
176Group: Development/Tools
177Requires: %{name} = %{version}-%{release}
178Requires: %{tkinter} = %{version}-%{release}
179%if %{main_python}
180Obsoletes: python2-tools
181Provides: python2-tools = %{version}-%{release}
182%endif
183
184%description tools
185This package includes several tools to help with the development of Python
186programs, including IDLE (an IDE with editing and debugging facilities), a
187color editor (pynche), and a python gettext program (pygettext.py).
188
189%package -n %{tkinter}
190Summary: A graphical user interface for the Python scripting language
191Group: Development/Languages
192#BuildRequires: tcl, tk
193Requires: %{name} = %{version}-%{release}
194%if %{main_python}
195Obsoletes: tkinter2
196Provides: tkinter2 = %{version}-%{release}
197%endif
198
199%description -n %{tkinter}
200
201The Tkinter (Tk interface) program is an graphical user interface for
202the Python scripting language.
203
204You should install the tkinter package if you'd like to use a graphical
205user interface for Python programming.
206
207%package test
208Summary: The test modules from the main python package
209Group: Development/Languages
210Requires: %{name} = %{version}-%{release}
211
212%description test
213
214The test modules from the main python package: %{name}
215These have been removed to save space, as they are never or almost
216never used in production.
217
218You might want to install the python-test package if you're developing python
219code that uses more than just unittest and/or test_support.py.
220
221%debug_package
222
223%prep
224%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}
225%setup -q
226%else
227%setup -n "%{name}-%{version}" -Tc
228svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
229rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
230(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
231%endif
232
233%if 0%{?with_systemtap}
234# Provide an example of usage of the tapset:
235cp -a %{SOURCE4} .
236cp -a %{SOURCE5} .
237%endif # with_systemtap
238
239# Ensure that we're using the system copy of various libraries, rather than
240# copies shipped by upstream in the tarball:
241# Remove embedded copy of expat:
242#rm -r Modules/expat || exit 1
243# Remove embedded copy of libffi:
244#for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
245# rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
246#done
247# Remove embedded copy of zlib:
248#rm -r Modules/zlib || exit 1
249
250# This shouldn't be necesarry, but is right now (2.2a3)
251find -name "*~" |xargs rm -f
252
253# generate configure & friends
254autoreconf -fvi
255
256%build
257
258export SHELL=""
259export MAKESHELL=""
260export CONFIG_SHELL=""
261
262export LDFLAGS="-g -Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
263export LIBS="-lcx -lssl -lcrypto -lurpo -lpthread -lintl"
264%configure \
265 --enable-shared \
266 --with-system-expat \
267 --enable-unicode=ucs4 \
268 --with-system-ffi
269
270make OPT="$CFLAGS" %{?_smp_mflags}
271
272%install
273rm -rf %{buildroot}
274mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
275
276make install DESTDIR=%{buildroot}
277
278# YD fix binaries
279cp %{buildroot}%{_bindir}/python.exe %{buildroot}%{_bindir}/python
280rm -f %{buildroot}%{_bindir}/python%{pybasever_cond}.dll
281
282# Junk, no point in putting in -test sub-pkg
283rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
284
285# don't include tests that are run at build time in the package
286# This is documented, and used: rhbz#387401
287if /bin/false; then
288 # Move this to -test subpackage.
289mkdir save_bits_of_test
290for i in test_support.py __init__.py; do
291 cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
292done
293rm -rf %{buildroot}/%{pylibdir}/test
294mkdir %{buildroot}/%{pylibdir}/test
295cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
296fi
297
298#%if %{main_python}
299#ln -s python %{buildroot}%{_bindir}/python2
300#%else
301#mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
302#mv %{buildroot}/%{_mandir}/man1/python.1 %{buildroot}/%{_mandir}/man1/python%{pybasever}.1
303#%endif
304
305# tools
306
307mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
308
309#gettext
310install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
311install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
312
313# Useful development tools
314install -m755 -d %{buildroot}%{tools_dir}/scripts
315install Tools/README %{buildroot}%{tools_dir}/
316install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
317
318# Documentation tools
319install -m755 -d %{buildroot}%{doc_tools_dir}
320#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
321
322# Useful demo scripts
323install -m755 -d %{buildroot}%{demo_dir}
324cp -ar Demo/* %{buildroot}%{demo_dir}
325
326# Get rid of crap
327find %{buildroot}/ -name "*~"|xargs rm -f
328find %{buildroot}/ -name ".cvsignore"|xargs rm -f
329find . -name "*~"|xargs rm -f
330find . -name ".cvsignore"|xargs rm -f
331#zero length
332rm -f %{buildroot}%{site_packages}/modulator/Templates/copyright
333
334rm -f %{buildroot}%{pylibdir}/LICENSE.txt
335
336
337#make the binaries install side by side with the main python
338#%if !%{main_python}
339#pushd %{buildroot}%{_bindir}
340#mv idle idle%{__python_ver}
341#mv modulator modulator%{__python_ver}
342#mv pynche pynche%{__python_ver}
343#mv pygettext.py pygettext%{__python_ver}.py
344#mv msgfmt.py msgfmt%{__python_ver}.py
345#mv smtpd.py smtpd%{__python_ver}.py
346#mv pydoc pydoc%{__python_ver}
347#popd
348#%endif
349
350# Fix for bug #136654
351rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au
352
353%global _pyconfig_h pyconfig.h
354
355# Get rid of egg-info files (core python modules are installed through rpms)
356rm %{buildroot}%{pylibdir}/*.egg-info
357
358%clean
359rm -fr %{buildroot}
360
361#%post libs -p /sbin/ldconfig
362
363#%postun libs -p /sbin/ldconfig
364
365
366%post
367if [ "$1" = 1 ] ; then
368#execute only on first install
369%cube {DELLINE "SET PYTHONPATH="} c:\config.sys > NUL
370%cube {DELLINE "SET PYTHONHOME="} c:\config.sys > NUL
371fi
372
373
374%files
375%defattr(-, root, root, -)
376%doc LICENSE README
377%{_bindir}/pydoc*
378%{_bindir}/python
379%{_bindir}/python.exe
380%{_bindir}/python2.exe
381%if %{main_python}
382#%{_bindir}/python2
383%endif
384%{_bindir}/python%{pybasever}.exe
385%{_mandir}/*/*
386%exclude %{_bindir}/*.dbg
387
388%dir %{pylibdir}
389%dir %{dynload_dir}
390%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
391%{dynload_dir}/*.pyd
392%exclude %{dynload_dir}/_ctypes_test.pyd
393%exclude %{dynload_dir}/_ct3574.pyd
394%exclude %{dynload_dir}/_testcapi.pyd
395%exclude %{dynload_dir}/_te3228.pyd
396
397%dir %{site_packages}
398%{site_packages}/README
399%{pylibdir}/*.py*
400%{pylibdir}/*.doc
401%dir %{pylibdir}/bsddb
402%{pylibdir}/bsddb/*.py*
403%{pylibdir}/compiler
404%dir %{pylibdir}/ctypes
405%{pylibdir}/ctypes/*.py*
406%{pylibdir}/ctypes/macholib
407%{pylibdir}/curses
408%dir %{pylibdir}/distutils
409%{pylibdir}/distutils/*.py*
410%{pylibdir}/distutils/README
411%{pylibdir}/distutils/command
412%dir %{pylibdir}/email
413%{pylibdir}/email/*.py*
414%{pylibdir}/email/mime
415%{pylibdir}/encodings
416%{pylibdir}/hotshot
417%{pylibdir}/idlelib
418%{pylibdir}/importlib
419%dir %{pylibdir}/json
420%{pylibdir}/json/*.py*
421%{pylibdir}/lib2to3
422%{pylibdir}/logging
423%{pylibdir}/multiprocessing
424%{pylibdir}/plat-os2knix
425%{pylibdir}/pydoc_data
426%dir %{pylibdir}/sqlite3
427%{pylibdir}/sqlite3/*.py*
428%dir %{pylibdir}/test
429%{pylibdir}/test/test_support.py*
430%{pylibdir}/test/__init__.py*
431%{pylibdir}/wsgiref
432%{pylibdir}/xml
433
434# "Makefile" and the config-32/64.h file are needed by
435# distutils/sysconfig.py:_init_posix(), so we include them in the core
436# package, along with their parent directories (bug 531901):
437%dir %{pylibdir}/config
438%{pylibdir}/config/Makefile
439%dir %{_includedir}/python%{pybasever}
440%{_includedir}/python%{pybasever}/%{_pyconfig_h}
441
442%files libs
443%defattr(-,root,root,-)
444#%doc LICENSE README
445%{_libdir}/python%{pybasever_cond}.dll
446%if 0%{?with_systemtap}
447%{tapsetdir}/%{libpython_stp}
448%doc systemtap-example.stp pyfuntop.stp
449%endif
450%exclude %{_libdir}/*.dbg
451
452%files devel
453%defattr(-,root,root,-)
454%{pylibdir}/config/*
455%exclude %{pylibdir}/config/Makefile
456%{_includedir}/python%{pybasever}/*.h
457%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
458%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
459%if %{main_python}
460%{_bindir}/python-config
461%endif
462%{_bindir}/python?*-config
463#%{_libdir}/libpython%{pybasever}.pyd
464%{_libdir}/python%{pybasever}_dll.a
465%{_libdir}/pkgconfig
466
467%files tools
468%defattr(-,root,root,755)
469#%doc Tools/modulator/README.modulator
470#%doc Tools/pynche/README.pynche
471#%{site_packages}/modulator
472#%{site_packages}/pynche
473%{_bindir}/smtpd*.py*
474%{_bindir}/2to3*
475%{_bindir}/idle*
476#%{_bindir}/modulator*
477#%{_bindir}/pynche*
478%{_bindir}/pygettext*.py*
479%{_bindir}/msgfmt*.py*
480%{tools_dir}
481%{demo_dir}
482%{pylibdir}/Doc
483
484%files -n %{tkinter}
485%defattr(-,root,root,755)
486%{pylibdir}/lib-tk
487#%{dynload_dir}/_tkinter.pyd
488
489%files test
490%defattr(-, root, root, -)
491%{pylibdir}/bsddb/test
492%{pylibdir}/ctypes/test
493%{pylibdir}/distutils/tests
494%{pylibdir}/email/test
495%{pylibdir}/json/tests
496%{pylibdir}/sqlite3/test
497%{pylibdir}/test/*
498%{pylibdir}/unittest/*
499# These two are shipped in the main subpackage:
500%exclude %{pylibdir}/test/test_support.py*
501%exclude %{pylibdir}/test/__init__.py*
502%{dynload_dir}/_ctypes_test.pyd
503%{dynload_dir}/_ct3574.pyd
504%{dynload_dir}/_testcapi.pyd
505%{dynload_dir}/_te3228.pyd
506
507# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
508# ldconfig (rhbz:562980).
509#
510# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
511# debugfiles.list, and it appears that everything below /usr/lib/debug and
512# (/usr/src/debug) gets added to this file (via LISTFILES) in
513# /usr/lib/rpm/find-debuginfo.sh
514#
515# Hence by installing it below /usr/lib/debug we ensure it is added to the
516# -debuginfo subpackage
517# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
518# payload file would be unpackaged)
519
520%changelog
521* Fri Feb 17 2017 yd <yd@os2power.com> 2.7.6-16
522- force db4 minimal version (libcx req).
523
524* Thu Feb 09 2017 yd <yd@os2power.com> 2.7.6-15
525- link with libcx for memory mapping support.
526
527* Fri Jun 10 2016 yd <yd@os2power.com> 2.7.6-14
528- fixed Obsoletes vs Conflicts.
529- fixed python2-devel and -tools version.
530
531* Thu Jun 09 2016 yd <yd@os2power.com> 2.7.6-13
532- enable support for ucs4 unicode set. ticket#182.
533- r780, fix file deletion. ticket#185.
534- r779, remove 8.3 file name truncation, use opendir() to avoid resolving symlinks. ticket#185.
535- r775, generate both 8.3 and long names for pyd dynamic libraries. fixes ticket#185.
536
537* Sat Dec 12 2015 Dmitriy Kuminov <coding@dmik.org> 2.7.6-12
538- r611, Add dummy plat-os2knix directory.
539- r610, Fix silly typo.
540- r609, Fix a typo in r529.
541- r608, Make os.path.defpath return '$UNIXROOT/usr/bin' on OS/2 when it is set.
542- r607, Replace altsep to sep in paths returned by os.path.join.
543- r606, Add ignore patterns for *.pyc and generated files.
544- r605, configure: Generate correct OS/2 defs and remove pre-built configure.
545- r604, Fix building with no OS/2 Toolkit headers in include paths.
546- r603, Use configured SHELL in subprocess module.
547- Provide dummy _dlopen in ctypes to make colorama package happy.
548- Use configured SHELL for subprocess.Popen(shell=True) instead of
549 hardcoded '/bin/sh'.
550- Make os.path.join replace all altsep (\) with sep (/) on return (to
551 fix joining names with components of PATH-like env. vars and passing
552 the results to a unix shell).
553- Make os.path.defpath return '$UNIXROOT\\usr\\bin'.
554- r568, build mmap module, by psmedley.
555
556* Thu Feb 26 2015 yd <yd@os2power.com> 2.7.6-11
557- r560, -O3 breaks the build, at least for pentium4 march.
558- r529, use unixroot path for script path replacement. Fixes ticket#114.
559
560* Mon Apr 07 2014 yd
561- build for python 2.7.
562
563* Sat Mar 15 2014 yd
564- r385 and others, added support for virtualenv.
565- added debug package with symbolic info for exceptq.
566
567* Wed Jun 05 2013 yd
568- r348, add samefile, sameopenfile, samestat to os.path module.
569
570* Thu Dec 27 2012 yd
571- fix local/bin requirements for python-tools.
572
573* Mon Jan 16 2012 yd
574- rebuild with libc 0.6.4 runtime.
Note: See TracBrowser for help on using the repository browser.