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

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

spec: initial import for base .spec files.

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