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

Last change on this file since 624 was 624, checked in by Yuri Dario, 10 years ago

spec: undo wrong commit r623.

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