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

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

spec: python, multiple updates for tickets #182 and #185.

  • Property svn:eol-style set to native
File size: 18.0 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 775
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: 13%{?dist}
53License: Python
54Group: Development/Languages
55Provides: python-abi = %{pybasever}
56Provides: python(abi) = %{pybasever}
57
58%define svn_url http://svn.netlabs.org/repos/rpm/python/trunk
59%define svn_rev 611
60
61Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
62
63BuildRequires: gcc make subversion zip
64
65%if %{main_python}
66Obsoletes: Distutils
67Provides: Distutils
68Obsoletes: python2
69Provides: python2 = %{version}
70Obsoletes: python-elementtree <= 1.2.6
71Obsoletes: python-sqlite < 2.3.2
72Provides: python-sqlite = 2.3.2
73Obsoletes: python-ctypes < 1.0.1
74Provides: python-ctypes = 1.0.1
75Obsoletes: python-hashlib < 20081120
76Provides: python-hashlib = 20081120
77Obsoletes: python-uuid < 1.31
78Provides: python-uuid = 1.31
79%endif
80
81# YD unix adds this automatically by parsing elf binaries
82Requires: %{name}-libs = %{version}-%{release}
83
84BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
85BuildRequires: readline-devel, openssl-devel, gmp-devel
86#BuildRequires: gdbm-devel, zlib-devel, expat-devel
87BuildRequires: ncurses-devel, zlib-devel, expat-devel
88#BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
89#BuildRequires: tar findutils pkgconfig tcl-devel tk-devel
90BuildRequires: bzip2 pkgconfig tcl-devel
91#BuildRequires: tix-devel
92BuildRequires: bzip2-devel sqlite-devel
93BuildRequires: autoconf
94BuildRequires: db4-devel >= 4.8
95#BuildRequires: libffi-devel
96%if 0%{?with_valgrind}
97BuildRequires: valgrind-devel
98%endif
99
100%if 0%{?with_systemtap}
101BuildRequires: systemtap-sdt-devel
102%global tapsetdir /usr/share/systemtap/tapset
103%endif
104
105# OS/2 specific
106BuildRequires: mmap urpo-devel
107
108URL: http://www.python.org/
109
110%description
111Python is an interpreted, interactive, object-oriented programming
112language often compared to Tcl, Perl, Scheme or Java. Python includes
113modules, classes, exceptions, very high level dynamic data types and
114dynamic typing. Python supports interfaces to many system calls and
115libraries, as well as to various windowing systems (X11, Motif, Tk,
116Mac and MFC).
117
118Programmers can write new built-in modules for Python in C or C++.
119Python can be used as an extension language for applications that need
120a programmable interface. This package contains most of the standard
121Python modules, as well as modules for interfacing to the Tix widget
122set for Tk and RPM.
123
124Note that documentation for Python is provided in the python-docs
125package.
126
127%package common
128Summary: An interpreted, interactive, object-oriented programming language
129Group: Development/Languages
130
131%description common
132Only binary files without versioned name. Allows multiple installations.
133
134%package libs
135Summary: The libraries for python runtime
136Group: Applications/System
137Requires: %{name} = %{version}-%{release}
138# Needed for ctypes, to load libraries, worked around for Live CDs size
139# Requires: binutils
140
141%description libs
142The python interpreter can be embedded into applications wanting to
143use python as an embedded scripting language. The python-libs package
144provides the libraries needed for this.
145
146%package devel
147Summary: The libraries and header files needed for Python development
148Group: Development/Libraries
149Requires: %{python}%{?_isa} = %{version}-%{release}
150# Needed here because of the migration of Makefile from -devel to the main
151# package
152Conflicts: %{python} < %{version}-%{release}
153%if %{main_python}
154Obsoletes: python2-devel
155Provides: python2-devel = %{version}-%{release}
156%endif
157
158%description devel
159The Python programming language's interpreter can be extended with
160dynamically loaded extensions and can be embedded in other programs.
161This package contains the header files and libraries needed to do
162these types of tasks.
163
164Install python-devel if you want to develop Python extensions. The
165python package will also need to be installed. You'll probably also
166want to install the python-docs package, which contains Python
167documentation.
168
169%package tools
170Summary: A collection of development tools included with Python
171Group: Development/Tools
172Requires: %{name} = %{version}-%{release}
173Requires: %{tkinter} = %{version}-%{release}
174%if %{main_python}
175Obsoletes: python2-tools
176Provides: python2-tools = %{version}
177%endif
178
179%description tools
180This package includes several tools to help with the development of Python
181programs, including IDLE (an IDE with editing and debugging facilities), a
182color editor (pynche), and a python gettext program (pygettext.py).
183
184%package -n %{tkinter}
185Summary: A graphical user interface for the Python scripting language
186Group: Development/Languages
187#BuildRequires: tcl, tk
188Requires: %{name} = %{version}-%{release}
189%if %{main_python}
190Obsoletes: tkinter2
191Provides: tkinter2 = %{version}
192%endif
193
194%description -n %{tkinter}
195
196The Tkinter (Tk interface) program is an graphical user interface for
197the Python scripting language.
198
199You should install the tkinter package if you'd like to use a graphical
200user interface for Python programming.
201
202%package test
203Summary: The test modules from the main python package
204Group: Development/Languages
205Requires: %{name} = %{version}-%{release}
206
207%description test
208
209The test modules from the main python package: %{name}
210These have been removed to save space, as they are never or almost
211never used in production.
212
213You might want to install the python-test package if you're developing python
214code that uses more than just unittest and/or test_support.py.
215
216%debug_package
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 LDFLAGS="-g -Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
253export LIBS="-lssl -lcrypto -lurpo -lpthread -lintl"
254%configure \
255 --enable-shared \
256 --with-system-expat \
257 --enable-unicode=ucs4 \
258 --with-system-ffi
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%changelog
577* Mon Jun 06 2016 yd <yd@os2power.com> 2.7.6-13
578- enable support for ucs4 unicode set.
579- r775, generate both 8.3 and long names for pyd dynamic libraries. fixes ticket#185.
580- r611, Add dummy plat-os2knix directory.
581- r610, Fix silly typo.
582- r609, Fix a typo in r529.
583- r608, Make os.path.defpath return '$UNIXROOT/usr/bin' on OS/2 when it is set.
584- r607, Replace altsep to sep in paths returned by os.path.join.
585- r606, Add ignore patterns for *.pyc and generated files.
586- r605, configure: Generate correct OS/2 defs and remove pre-built configure.
587- r604, Fix building with no OS/2 Toolkit headers in include paths.
588- r603, Use configured SHELL in subprocess module.
589
590* Sat Dec 12 2015 Dmitriy Kuminov <coding@dmik.org> 2.7.6-12
591- Provide dummy _dlopen in ctypes to make colorama package happy.
592- Use configured SHELL for subprocess.Popen(shell=True) instead of
593 hardcoded '/bin/sh'.
594- Make os.path.join replace all altsep (\) with sep (/) on return (to
595 fix joining names with components of PATH-like env. vars and passing
596 the results to a unix shell).
597- Make os.path.defpath return '$UNIXROOT\\usr\\bin'.
598- r568, build mmap module, by psmedley.
599
600* Thu Feb 26 2015 yd <yd@os2power.com> 2.7.6-11
601- r560, -O3 breaks the build, at least for pentium4 march.
602- r529, use unixroot path for script path replacement. Fixes ticket#114.
603
604* Mon Apr 07 2014 yd
605- build for python 2.7.
606
607* Sat Mar 15 2014 yd
608- r385 and others, added support for virtualenv.
609- added debug package with symbolic info for exceptq.
610
611* Wed Jun 05 2013 yd
612- r348, add samefile, sameopenfile, samestat to os.path module.
613
614* Thu Dec 27 2012 yd
615- fix local/bin requirements for python-tools.
616
617* Mon Jan 16 2012 yd
618- rebuild with libc 0.6.4 runtime.
Note: See TracBrowser for help on using the repository browser.