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

Last change on this file since 28 was 28, checked in by Yuri Dario, 15 years ago

spec: added readline package.

  • Property svn:eol-style set to native
File size: 15.3 KB
Line 
1%{!?__python_ver:%global __python_ver EMPTY}
2#global __python_ver 26
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.6
18%global pybasever_cond 26
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
45Summary: An interpreted, interactive, object-oriented programming language
46Name: %{python}
47Version: 2.6.5
48Release: 1
49License: Python
50Group: Development/Languages
51Provides: python-abi = %{pybasever}
52Provides: python(abi) = %{pybasever}
53Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
54
55Patch0: Python-%{version}-os2.diff
56Patch1: Python-%{version}-os2knix.diff
57
58%if %{main_python}
59Obsoletes: Distutils
60Provides: Distutils
61Obsoletes: python2
62Provides: python2 = %{version}
63Obsoletes: python-elementtree <= 1.2.6
64Obsoletes: python-sqlite < 2.3.2
65Provides: python-sqlite = 2.3.2
66Obsoletes: python-ctypes < 1.0.1
67Provides: python-ctypes = 1.0.1
68Obsoletes: python-hashlib < 20081120
69Provides: python-hashlib = 20081120
70Obsoletes: python-uuid < 1.31
71Provides: python-uuid = 1.31
72%endif
73
74# YD unix adds this automatically by parsing elf binaries
75Requires: %{name}-libs = %{version}-%{release}
76
77BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
78#BuildRequires: readline-devel, openssl-devel, gmp-devel
79BuildRequires: readline-devel
80#BuildRequires: gdbm-devel, zlib-devel, expat-devel
81BuildRequires: ncurses-devel, zlib-devel
82#BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
83#BuildRequires: tar findutils pkgconfig tcl-devel tk-devel
84BuildRequires: bzip2 pkgconfig
85#BuildRequires: tix-devel
86BuildRequires: bzip2-devel sqlite-devel
87#BuildRequires: autoconf
88#BuildRequires: db4-devel >= 4.8
89#BuildRequires: libffi-devel
90%if 0%{?with_valgrind}
91BuildRequires: valgrind-devel
92%endif
93
94%if 0%{?with_systemtap}
95BuildRequires: systemtap-sdt-devel
96%global tapsetdir /usr/share/systemtap/tapset
97%endif
98
99URL: http://www.python.org/
100
101%description
102Python is an interpreted, interactive, object-oriented programming
103language often compared to Tcl, Perl, Scheme or Java. Python includes
104modules, classes, exceptions, very high level dynamic data types and
105dynamic typing. Python supports interfaces to many system calls and
106libraries, as well as to various windowing systems (X11, Motif, Tk,
107Mac and MFC).
108
109Programmers can write new built-in modules for Python in C or C++.
110Python can be used as an extension language for applications that need
111a programmable interface. This package contains most of the standard
112Python modules, as well as modules for interfacing to the Tix widget
113set for Tk and RPM.
114
115Note that documentation for Python is provided in the python-docs
116package.
117
118%package libs
119Summary: The libraries for python runtime
120Group: Applications/System
121Requires: %{name} = %{version}-%{release}
122# Needed for ctypes, to load libraries, worked around for Live CDs size
123# Requires: binutils
124
125%description libs
126The python interpreter can be embedded into applications wanting to
127use python as an embedded scripting language. The python-libs package
128provides the libraries needed for this.
129
130%package devel
131Summary: The libraries and header files needed for Python development
132Group: Development/Libraries
133Requires: %{python}%{?_isa} = %{version}-%{release}
134# Needed here because of the migration of Makefile from -devel to the main
135# package
136Conflicts: %{python} < %{version}-%{release}
137%if %{main_python}
138Obsoletes: python2-devel
139Provides: python2-devel = %{version}-%{release}
140%endif
141
142%description devel
143The Python programming language's interpreter can be extended with
144dynamically loaded extensions and can be embedded in other programs.
145This package contains the header files and libraries needed to do
146these types of tasks.
147
148Install python-devel if you want to develop Python extensions. The
149python package will also need to be installed. You'll probably also
150want to install the python-docs package, which contains Python
151documentation.
152
153%package tools
154Summary: A collection of development tools included with Python
155Group: Development/Tools
156Requires: %{name} = %{version}-%{release}
157Requires: %{tkinter} = %{version}-%{release}
158%if %{main_python}
159Obsoletes: python2-tools
160Provides: python2-tools = %{version}
161%endif
162
163%description tools
164This package includes several tools to help with the development of Python
165programs, including IDLE (an IDE with editing and debugging facilities), a
166color editor (pynche), and a python gettext program (pygettext.py).
167
168%package -n %{tkinter}
169Summary: A graphical user interface for the Python scripting language
170Group: Development/Languages
171#BuildRequires: tcl, tk
172Requires: %{name} = %{version}-%{release}
173%if %{main_python}
174Obsoletes: tkinter2
175Provides: tkinter2 = %{version}
176%endif
177
178%description -n %{tkinter}
179
180The Tkinter (Tk interface) program is an graphical user interface for
181the Python scripting language.
182
183You should install the tkinter package if you'd like to use a graphical
184user interface for Python programming.
185
186%package test
187Summary: The test modules from the main python package
188Group: Development/Languages
189Requires: %{name} = %{version}-%{release}
190
191%description test
192
193The test modules from the main python package: %{name}
194These have been removed to save space, as they are never or almost
195never used in production.
196
197You might want to install the python-test package if you're developing python
198code that uses more than just unittest and/or test_support.py.
199
200%prep
201%setup -q -n Python-%{version}
202
203%if 0%{?with_systemtap}
204# Provide an example of usage of the tapset:
205cp -a %{SOURCE4} .
206cp -a %{SOURCE5} .
207%endif # with_systemtap
208
209# Ensure that we're using the system copy of various libraries, rather than
210# copies shipped by upstream in the tarball:
211# Remove embedded copy of expat:
212#rm -r Modules/expat || exit 1
213# Remove embedded copy of libffi:
214#for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
215# rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
216#done
217# Remove embedded copy of zlib:
218#rm -r Modules/zlib || exit 1
219
220#
221# Apply patches:
222#
223%patch0 -p1 -b .os2~
224%patch1 -p1 -b .os2knix~
225
226mkdir Lib/plat-os2knix
227
228# This shouldn't be necesarry, but is right now (2.2a3)
229find -name "*~" |xargs rm -f
230
231%build
232CONFIG_SHELL=/bin/sh
233export CONFIG_SHELL
234LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
235export LDFLAGS
236LIBS="-lssl -lcrypto -lurpo -lmmap -lpthread"
237export LIBS
238BASECFLAGS="-O2 -g -march=i386 -mtune=i686"
239export BASECFLAGS
240%configure \
241 --enable-shared --disable-static \
242 "--cache-file=%{_topdir}/cache/%{name}.cache"
243
244make OPT="$CFLAGS" %{?_smp_mflags}
245
246%install
247rm -rf %{buildroot}
248mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
249
250make install DESTDIR=%{buildroot}
251
252# YD fix binaries
253cp %{buildroot}%{_bindir}/python.exe %{buildroot}%{_bindir}/python
254rm -f %{buildroot}%{_bindir}/python%{pybasever_cond}.dll
255
256# Junk, no point in putting in -test sub-pkg
257rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
258
259# don't include tests that are run at build time in the package
260# This is documented, and used: rhbz#387401
261if /bin/false; then
262 # Move this to -test subpackage.
263mkdir save_bits_of_test
264for i in test_support.py __init__.py; do
265 cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
266done
267rm -rf %{buildroot}/%{pylibdir}/test
268mkdir %{buildroot}/%{pylibdir}/test
269cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
270fi
271
272#%if %{main_python}
273#ln -s python %{buildroot}%{_bindir}/python2
274#%else
275#mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
276#mv %{buildroot}/%{_mandir}/man1/python.1 %{buildroot}/%{_mandir}/man1/python%{pybasever}.1
277#%endif
278
279# tools
280
281mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
282
283#gettext
284install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
285install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
286
287# Useful development tools
288install -m755 -d %{buildroot}%{tools_dir}/scripts
289install Tools/README %{buildroot}%{tools_dir}/
290install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
291
292# Documentation tools
293install -m755 -d %{buildroot}%{doc_tools_dir}
294#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
295
296# Useful demo scripts
297install -m755 -d %{buildroot}%{demo_dir}
298cp -ar Demo/* %{buildroot}%{demo_dir}
299
300# Get rid of crap
301find %{buildroot}/ -name "*~"|xargs rm -f
302find %{buildroot}/ -name ".cvsignore"|xargs rm -f
303find . -name "*~"|xargs rm -f
304find . -name ".cvsignore"|xargs rm -f
305#zero length
306rm -f %{buildroot}%{site_packages}/modulator/Templates/copyright
307
308rm -f %{buildroot}%{pylibdir}/LICENSE.txt
309
310
311#make the binaries install side by side with the main python
312#%if !%{main_python}
313#pushd %{buildroot}%{_bindir}
314#mv idle idle%{__python_ver}
315#mv modulator modulator%{__python_ver}
316#mv pynche pynche%{__python_ver}
317#mv pygettext.py pygettext%{__python_ver}.py
318#mv msgfmt.py msgfmt%{__python_ver}.py
319#mv smtpd.py smtpd%{__python_ver}.py
320#mv pydoc pydoc%{__python_ver}
321#popd
322#%endif
323
324# Fix for bug #136654
325rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au
326
327%global _pyconfig_h pyconfig.h
328
329# Get rid of egg-info files (core python modules are installed through rpms)
330rm %{buildroot}%{pylibdir}/*.egg-info
331
332%clean
333rm -fr %{buildroot}
334
335#%post libs -p /sbin/ldconfig
336
337#%postun libs -p /sbin/ldconfig
338
339
340%files
341%defattr(-, root, root, -)
342%doc LICENSE README
343%{_bindir}/pydoc*
344%{_bindir}/%{python}
345%{_bindir}/%{python}.exe
346%if %{main_python}
347#%{_bindir}/python2
348%endif
349%{_bindir}/python%{pybasever}.exe
350%{_mandir}/*/*
351
352%dir %{pylibdir}
353%dir %{dynload_dir}
354%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
355%{dynload_dir}/_bisect.pyd
356%{dynload_dir}/_bsddb.pyd
357%{dynload_dir}/_bytesio.pyd
358%{dynload_dir}/_codecs_.pyd
359#%{dynload_dir}/_codecs_hk.pyd
360#%{dynload_dir}/_codecs_iso2022.pyd
361#%{dynload_dir}/_codecs_jp.pyd
362#%{dynload_dir}/_codecs_kr.pyd
363#%{dynload_dir}/_codecs_tw.pyd
364%{dynload_dir}/_collect.pyd
365%{dynload_dir}/_csv.pyd
366#%{dynload_dir}/_ctypes.pyd
367%{dynload_dir}/_curses.pyd
368%{dynload_dir}/_curses_.pyd
369%{dynload_dir}/_element.pyd
370%{dynload_dir}/_fileio.pyd
371%{dynload_dir}/_functoo.pyd
372%{dynload_dir}/_hashlib.pyd
373%{dynload_dir}/_heapq.pyd
374%{dynload_dir}/_hotshot.pyd
375%{dynload_dir}/_json.pyd
376%{dynload_dir}/_locale.pyd
377%{dynload_dir}/_lsprof.pyd
378#%{dynload_dir}/_md5.pyd
379%{dynload_dir}/_multiby.pyd
380%{dynload_dir}/_multipr.pyd
381%{dynload_dir}/_random.pyd
382#%{dynload_dir}/_sha256.pyd
383#%{dynload_dir}/_sha512.pyd
384#%{dynload_dir}/_sha.pyd
385%{dynload_dir}/_socket.pyd
386%{dynload_dir}/_sqlite3.pyd
387%{dynload_dir}/_ssl.pyd
388%{dynload_dir}/_struct.pyd
389%{dynload_dir}/_weakref.pyd
390%{dynload_dir}/array.pyd
391%{dynload_dir}/audioop.pyd
392%{dynload_dir}/binascii.pyd
393%{dynload_dir}/bz2.pyd
394%{dynload_dir}/cPickle.pyd
395%{dynload_dir}/cStringI.pyd
396%{dynload_dir}/cmath.pyd
397%{dynload_dir}/crypt.pyd
398%{dynload_dir}/datetime.pyd
399%{dynload_dir}/dbm.pyd
400%{dynload_dir}/dl.pyd
401%{dynload_dir}/fcntl.pyd
402%{dynload_dir}/future_b.pyd
403#%{dynload_dir}/gdbm.pyd
404%{dynload_dir}/grp.pyd
405%{dynload_dir}/imageop.pyd
406%{dynload_dir}/itertool.pyd
407#%{dynload_dir}/linuxaudiodev.pyd
408%{dynload_dir}/math.pyd
409#%{dynload_dir}/mmap.pyd
410#%{dynload_dir}/nis.pyd
411%{dynload_dir}/operator.pyd
412#%{dynload_dir}/ossaudiodev.pyd
413%{dynload_dir}/parser.pyd
414%{dynload_dir}/pyexpat.pyd
415%{dynload_dir}/readline.pyd
416%{dynload_dir}/resource.pyd
417%{dynload_dir}/select.pyd
418#%{dynload_dir}/spwd.pyd
419%{dynload_dir}/strop.pyd
420%{dynload_dir}/syslog.pyd
421%{dynload_dir}/termios.pyd
422%{dynload_dir}/time.pyd
423#%{dynload_dir}/timing.pyd
424%{dynload_dir}/unicoded.pyd
425#%{dynload_dir}/xxsubtype.pyd
426%{dynload_dir}/zlib.pyd
427
428%dir %{site_packages}
429%{site_packages}/README
430%{pylibdir}/*.py*
431%{pylibdir}/*.doc
432%dir %{pylibdir}/bsddb
433%{pylibdir}/bsddb/*.py*
434%{pylibdir}/compiler
435%dir %{pylibdir}/ctypes
436%{pylibdir}/ctypes/*.py*
437%{pylibdir}/ctypes/macholib
438%{pylibdir}/curses
439%dir %{pylibdir}/distutils
440%{pylibdir}/distutils/*.py*
441%{pylibdir}/distutils/README
442%{pylibdir}/distutils/command
443%dir %{pylibdir}/email
444%{pylibdir}/email/*.py*
445%{pylibdir}/email/mime
446%{pylibdir}/encodings
447%{pylibdir}/hotshot
448%{pylibdir}/idlelib
449%dir %{pylibdir}/json
450%{pylibdir}/json/*.py*
451%{pylibdir}/lib2to3
452%{pylibdir}/logging
453%{pylibdir}/multiprocessing
454%{pylibdir}/plat-os2knix
455%dir %{pylibdir}/sqlite3
456%{pylibdir}/sqlite3/*.py*
457%dir %{pylibdir}/test
458%{pylibdir}/test/test_support.py*
459%{pylibdir}/test/__init__.py*
460%{pylibdir}/wsgiref
461%{pylibdir}/xml
462
463# "Makefile" and the config-32/64.h file are needed by
464# distutils/sysconfig.py:_init_posix(), so we include them in the core
465# package, along with their parent directories (bug 531901):
466%dir %{pylibdir}/config
467%{pylibdir}/config/Makefile
468%dir %{_includedir}/python%{pybasever}
469%{_includedir}/python%{pybasever}/%{_pyconfig_h}
470
471%files libs
472%defattr(-,root,root,-)
473#%doc LICENSE README
474%{_libdir}/python%{pybasever_cond}.dll
475%if 0%{?with_systemtap}
476%{tapsetdir}/%{libpython_stp}
477%doc systemtap-example.stp pyfuntop.stp
478%endif
479
480%files devel
481%defattr(-,root,root,-)
482%{pylibdir}/config/*
483%exclude %{pylibdir}/config/Makefile
484%{_includedir}/python%{pybasever}/*.h
485%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
486%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
487%if %{main_python}
488%{_bindir}/python-config
489%endif
490%{_bindir}/python%{pybasever}-config
491#%{_libdir}/libpython%{pybasever}.pyd
492%{_libdir}/python%{pybasever}_dll.a
493
494%files tools
495%defattr(-,root,root,755)
496#%doc Tools/modulator/README.modulator
497#%doc Tools/pynche/README.pynche
498#%{site_packages}/modulator
499#%{site_packages}/pynche
500%{_bindir}/smtpd*.py*
501%{_bindir}/2to3*
502%{_bindir}/idle*
503#%{_bindir}/modulator*
504#%{_bindir}/pynche*
505%{_bindir}/pygettext*.py*
506%{_bindir}/msgfmt*.py*
507%{tools_dir}
508%{demo_dir}
509%{pylibdir}/Doc
510
511%files -n %{tkinter}
512%defattr(-,root,root,755)
513%{pylibdir}/lib-tk
514#%{dynload_dir}/_tkinter.pyd
515
516%files test
517%defattr(-, root, root, -)
518%{pylibdir}/bsddb/test
519%{pylibdir}/ctypes/test
520%{pylibdir}/distutils/tests
521%{pylibdir}/email/test
522%{pylibdir}/json/tests
523%{pylibdir}/sqlite3/test
524%{pylibdir}/test/*
525# These two are shipped in the main subpackage:
526%exclude %{pylibdir}/test/test_support.py*
527%exclude %{pylibdir}/test/__init__.py*
528%{dynload_dir}/_ctypes_.pyd
529%{dynload_dir}/_testcap.pyd
530
531# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
532# ldconfig (rhbz:562980).
533#
534# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
535# debugfiles.list, and it appears that everything below /usr/lib/debug and
536# (/usr/src/debug) gets added to this file (via LISTFILES) in
537# /usr/lib/rpm/find-debuginfo.sh
538#
539# Hence by installing it below /usr/lib/debug we ensure it is added to the
540# -debuginfo subpackage
541# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
542# payload file would be unpackaged)
543
544%changelog
Note: See TracBrowser for help on using the repository browser.