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

Last change on this file since 980 was 980, checked in by Yuri Dario, 9 years ago

spec: python, link with libcx for memory mapping support.

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