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

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

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