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

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

spec: added gettext build.

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