]> git.pld-linux.org Git - packages/python.git/blob - python.spec
- rel 2
[packages/python.git] / python.spec
1 #
2 # TODO
3 # - test_distutils fails for unknown reason: (does it still do with new lib64 patch?)
4 #   AssertionError: '/tmp/tmpaomC0l/installation/share/python' != '/tmp/tmpaomC0l/installation/lib/python'
5 # - change searchpath order so /usr/lib* is before /usr/share
6 # - kill lib-tk from searchpath
7 # - kill BR: file requirement from lib64 patch
8 # - security(CVE-2008-4108)
9 #   http://securitytracker.com/alerts/2008/Sep/1020904.html
10 #
11 # Conditional build:
12 %bcond_with     info                    # build info pages (requires emacs, fails in python-2.5.0)
13 %bcond_without  tkinter                 # disables tkinter module building
14 %bcond_without  tests                   # disables Python testing
15 %bcond_with     verbose_tests           # runs tests in verbose mode
16 %bcond_with     openssl097
17 #
18 # tests which will not work on 64-bit platforms
19 %define         no64bit_tests   test_audioop test_rgbimg test_imageop
20 # tests which may fail because of builder environment limitations (no /proc or /dev/pts)
21 %define         nobuilder_tests test_resource test_openpty test_socket test_nis test_posix test_locale test_pty
22 # tests which fail because of some unknown/unresolved reason (this list should be empty)
23 %define         broken_tests test_anydbm test_bsddb test_re test_shelve test_whichdb test_zipimport test_distutils
24
25 %define beta            %{nil}
26
27 %define py_ver          2.6
28 %define py_prefix       %{_prefix}
29 %define py_libdir       %{py_prefix}/%{_lib}/python%{py_ver}
30 %define py_incdir       %{_includedir}/python%{py_ver}
31 %define py_sitedir      %{py_libdir}/site-packages
32 %define py_dyndir       %{py_libdir}/lib-dynload
33
34 Summary:        Very high level scripting language with X interface
35 Summary(es.UTF-8):      Lenguaje script de alto nivel con interfaz X
36 Summary(fr.UTF-8):      Langage de script de très haut niveau avec interface X
37 Summary(pl.UTF-8):      Python - język obiektowy wysokiego poziomu
38 Summary(pt_BR.UTF-8):   Linguagem de programação interpretada de alto nível
39 Summary(ru.UTF-8):      Язык программирования очень высокого уровня с X-интерфейсом
40 Summary(tr.UTF-8):      X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
41 Summary(uk.UTF-8):      Мова програмування дуже високого рівня з X-інтерфейсом
42 Name:           python
43 Version:        %{py_ver}.1
44 Release:        2
45 Epoch:          1
46 License:        PSF
47 Group:          Applications
48 Source0:        http://www.python.org/ftp/python/%{version}/Python-%{version}%{beta}.tar.bz2
49 # Source0-md5:  e81c2f0953aa60f8062c05a4673f2be0
50 Source1:        http://www.python.org/ftp/python/doc/%{py_ver}%{beta}/python-docs-html.tar.bz2
51 # Source1-md5:  cfcd4b9b00ba1e7496b5d823692370a4
52 Patch1:         %{name}-%{name}path.patch
53 Patch2:         %{name}-no_ndbm.patch
54 Patch3:         %{name}-ac_fixes.patch
55 Patch4:         %{name}-noarch_to_datadir.patch
56 Patch5:         %{name}-lib64.patch
57 URL:            http://www.python.org/
58 BuildRequires:  autoconf
59 BuildRequires:  bluez-libs-devel
60 BuildRequires:  bzip2-devel
61 BuildRequires:  db-devel >= 4
62 %{?with_info:BuildRequires:     emacs >= 21}
63 BuildRequires:  expat-devel >= 1:1.95.7
64 BuildRequires:  file
65 BuildRequires:  gdbm-devel >= 1.8.3
66 BuildRequires:  gmp-devel >= 4.0
67 BuildRequires:  libstdc++-devel
68 BuildRequires:  ncurses-ext-devel >= 5.2
69 %if %{with openssl097}
70 BuildRequires:  openssl-devel < 0.9.8
71 %else
72 BuildRequires:  openssl-devel >= 0.9.8
73 %endif
74 BuildRequires:  readline-devel >= 5.0
75 BuildRequires:  rpm-pythonprov
76 BuildRequires:  sed >= 4.0
77 BuildRequires:  sqlite3-devel >= 3.3.5
78 %{?with_info:BuildRequires:     tetex-makeindex}
79 %{?with_tkinter:BuildRequires:  tix-devel >= 1:8.1.4-4}
80 %{?with_tkinter:BuildRequires:  tk-devel >= 8.4.3}
81 BuildRequires:  zlib-devel
82 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
83 Obsoletes:      python2
84 Conflicts:      bzr < 1.8
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %if %{with verbose_tests}
88 %define test_flags -v -l -x
89 %else
90 %define test_flags -l -x
91 %endif
92
93 %ifarch alpha ia64 ppc64 ppc64 %{x8664}
94 %define test_list %{nobuilder_tests} %{broken_tests} %{no64bit_tests}
95 %else
96 %define test_list %{nobuilder_tests} %{broken_tests}
97 %endif
98
99 %ifarch sparc
100 %define test_list %{nobuilder_tests} %{broken_tests} test_fcntl test_ioctl
101 %endif
102
103 %ifarch sparc64
104 %define test_list %{nobuilder_tests} %{broken_tests} %{no64bit_tests} test_fcntl test_ioctl
105 %endif
106
107 %description
108 Python is an interpreted, interactive, object-oriented programming
109 language. It incorporates modules, exceptions, dynamic typing, very
110 high level dynamic data types, and classes. Python combines remarkable
111 power with very clear syntax. It has interfaces to many system calls
112 and libraries, as well as to various window systems, and is extensible
113 in C or C++. It is also usable as an extension language for
114 applications that need a programmable interface. Finally, Python is
115 portable: it runs on many brands of UNIX, on the Mac, and on PCs under
116 MS-DOS, Windows, Windows NT, and OS/2.
117
118 This package contains the Python binary.
119
120 %description -l de.UTF-8
121 Python ist eine interpretierte, interaktive, objektorientierte
122 Programmiersprache, vergleichbar zu Tcl, Perl, Scheme oder Java.
123 Python enthält Module, Klassen, Exceptions, High-Level dynamische
124 Datentypen und dynamisches Typisieren. Python unterstützt Interfaces
125 zu vielen Systemaufrufen und Libraries, sowie verschiedene
126 Fenstersysteme (X11, Motif, Tk, Mac und MFC)
127
128 Programmierer können neue built-in-Module für Python in C oder C++
129 schreiben. Python kann auch als Erweiterungssprache für Applikationen
130 benutzt werden, die ein programmierbares Interface brauchen. Dieses
131 Paket enthält die meisten Standard-Python-Module, und Module zum
132 Ansprechen von Tix (Tk-widget set) und RPM.
133
134 %description -l es.UTF-8
135 Python es un lenguaje de scripts interpretado orientado a objetos.
136 Contiene soporte para carga dinámica de objetos, clases, módulos y
137 excepciones.
138
139 Es sencillo adicionar interfaces para nuevos sistemas de biblioteca a
140 través de código C, tornando Python fácil de usar en ambientes
141 particulares/personalizados. Este paquete Python incluye la mayoría de
142 los módulos padrón Python, junto con módulos para crear interfaces
143 para el conjunto de componentes Tix para Tk y RPM.
144
145 %description -l fr.UTF-8
146 Python est un langage de script interprété et orienté objet. Il gère
147 le chargement dynamique des objets, les classes, les modules et les
148 exceptions. L'ajout d'interfaces aux nouvelles bibliothèques systèmes
149 avec du code C est simple, ce qui rend Python facile à utiliser dans
150 des configs personnalisées.
151
152 Ce paquetage Python contient la plupart des modules Python standards,
153 ainsi que ceux permettant l'interfaçage avec les widgets Tix pour Tk
154 et RPM.
155
156 %description -l pl.UTF-8
157 Python jest interpretowanym, interaktywnym i zorientowanym obiektowo
158 językiem programowania. Jest modularny, obsługuje wyjątki, dynamiczne
159 typy, zaawansowane dynamiczne struktury danych i klasy. Python łączy w
160 sobie duże możliwości i przejrzystą składnię. Posiada interfejsy do
161 wielu wywołań systemowych i bibliotek, w tym również do różnych
162 bibliotek okienkowych. Możliwości jego można jeszcze rozszerzać
163 poprzez odpowiednie moduły pisane w C lub C++. Python może być również
164 użyty jako element aplikacji, którym potrzebny jest interpreter do
165 skryptów. I wreszcie, Python jest wieloplatformowy, działa na wielu
166 odmianach UNIX-a, Macu oraz PC pod DOS-em, Windows, WindowsNT oraz
167 OS/2.
168
169 Ten pakiet zawiera binarkę Pythona.
170
171 %description -l pt_BR.UTF-8
172 Python é uma linguagem de scripts interpretada orientada a objetos.
173 Contém suporte para carga dinâmica de objetos, classes, módulos e
174 exceções. Adicionar interfaces para novos sistemas de biblioteca
175 através de código C é simples, tornando Python fácil de usar em
176 ambientes particulares/personalizados.
177
178 Este pacote Python inclui a maioria do módulos padrão Python, junto
179 com módulos para interfaceamento para o conjunto de componentes Tix
180 para Tk e RPM.
181
182 %description -l ru.UTF-8
183 Python - это интерпретируемый, объектно-ориентированный язык
184 программирования. Он поддерживает динамическую загрузку объектов,
185 классы, модули и обработку исключительных ситуаций (exceptions).
186 Простота добавления интерфейсов к новым системным библиотекам через
187 код на языке C делает Python хорошим выбором для использования в
188 специальных конфигурациях.
189
190 %description -l tr.UTF-8
191 Python, nesneye yönelik bir kabuk yorumlayıcıdır. Nesnelerin,
192 sınıfların, modüllerin ve aykırı durumların dinamik yüklenmelerine
193 destek verir. C koduyla birlikte kullanımı son derece kolaydır. Bu
194 paket, standart Python birimlerinin çoğunun yanısıra Tk ve RPM için
195 arayüz birimlerini de içerir.
196
197 %description -l uk.UTF-8
198 Python - це інтерпретована, об'єктно-орієнтована мова програмування.
199 Він підтримує динамічну загрузку об'єктів, класи, модулі та обробку
200 виключних ситуацій (exceptions). Простота додавання інтерфейсів для
201 нових системних бібліотек через код на мові C робить Python добрим
202 вибором для використання в спеціальних конфігураціях.
203
204 %package libs
205 Summary:        Python library
206 Summary(pl.UTF-8):      Biblioteka języka Python
207 Group:          Libraries/Python
208 # broken detection in rpm/pythondeps.sh
209 Provides:       python(abi) = %{py_ver}
210 # for compatibility with existing Ac packages
211 Provides:       python(bytecode) = %{py_ver}
212 %{!?with_info:Obsoletes:        python-doc-info}
213 Obsoletes:      python-intl
214
215 %description libs
216 Python shared library and very essental modules for Python binary.
217
218 %description libs -l pl.UTF-8
219 Biblioteka współdzielona języka Python oraz bardzo podstawowe moduły
220 dla Pythona.
221
222 %package modules
223 Summary:        Python modules
224 Summary(pl.UTF-8):      Moduły języka Python
225 Group:          Libraries/Python
226 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
227 Provides:       python-cElementTree
228 Provides:       python-elementtree
229 Obsoletes:      python-cElementTree
230 Obsoletes:      python-ctypes
231 Obsoletes:      python-curses
232 Obsoletes:      python-elementtree
233 Obsoletes:      python-gdbm
234 Obsoletes:      python-hashlib
235 Obsoletes:      python-logging
236 Obsoletes:      python-old
237 Obsoletes:      python-optik
238 Obsoletes:      python-ssl
239 Obsoletes:      python-xml
240 Obsoletes:      python-xmlrpc <= 1.0.1
241 Obsoletes:      python-zlib
242
243 %description modules
244 Python officially distributed modules.
245
246 %description modules -l pl.UTF-8
247 Oficjalnie rozprowadzane moduły języka Python.
248
249 %package modules-sqlite
250 Summary:        Python SQLite modules
251 Summary(pl.UTF-8):      Moduły SQLite języka Python
252 Group:          Libraries/Python
253 Requires:       %{name}-modules = %{epoch}:%{version}-%{release}
254
255 %description modules-sqlite
256 Python officially distributed sqlite module.
257
258 %description modules-sqlite -l pl.UTF-8
259 Oficjalnie rozprowadzany moduł sqlite języka Python.
260
261 %package -n pydoc
262 Summary:        Python interactive module documentation access support
263 Summary(pl.UTF-8):      Interaktywne korzystanie z dokumentacji modułów języka Python
264 Group:          Applications
265 Requires:       %{name}-modules = %{epoch}:%{version}-%{release}
266 Obsoletes:      python-pydoc
267
268 %description -n pydoc
269 Python interactive module documentation access support.
270
271 %description -n pydoc -l pl.UTF-8
272 Interaktywne korzystanie z dokumentacji modułów języka Python.
273
274 %package -n idle
275 Summary:        IDE for Python language
276 Summary(pl.UTF-8):      IDE dla języka Python
277 Group:          Applications
278 Requires:       %{name}-tkinter = %{epoch}:%{version}-%{release}
279 Obsoletes:      python-idle
280
281 %description -n idle
282 IDE for Python language.
283
284 %description -n idle -l pl.UTF-8
285 IDE dla języka Python.
286
287 %package devel
288 Summary:        Libraries and header files for building python code
289 Summary(de.UTF-8):      Libraries und Header-Dateien zum Erstellen von Python-Code
290 Summary(es.UTF-8):      Bibliotecas y archivos de inclusión para construir programas en python
291 Summary(fr.UTF-8):      Bibliothèques et en-têtes pour construire du code python
292 Summary(pl.UTF-8):      Pliki nagłówkowe i biblioteki Pythona
293 Summary(pt_BR.UTF-8):   Bibliotecas e arquivos de inclusão para o Python
294 Summary(ru.UTF-8):      Библиотеки и хедеры для построения кода на языке Python
295 Summary(tr.UTF-8):      Python ile geliştirme yapmak için gerekli dosyalar
296 Summary(uk.UTF-8):      Бібліотеки та хедери для програмування на мові Python
297 Group:          Development/Languages/Python
298 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
299 Obsoletes:      python2-devel
300
301 %description devel
302 The Python interpreter is relatively easy to extend with dynamically
303 loaded extensions and to embed in other programs. This package
304 contains the header files and libraries which are needed to do both of
305 these tasks.
306
307 %description devel -l de.UTF-8
308 Der Python-Interpretierer ist relativ einfach anhand von dynamisch
309 ladbaren Erweiterungen auszubauen und läßt sich in andere Programme
310 integrieren. Dieses Paket enthält die Header-Dateien und Libraries,
311 die für beide Aufgaben erforderlich sind.
312
313 %description devel -l es.UTF-8
314 El interpretador Python permite incluir con facilidad extensiones
315 cargadas dinámicamente. Python es también fácil de ser empotrado en
316 otros programas. Este paquete contiene los archivos de inclusión y
317 bibliotecas necesarios para estas dos tareas.
318
319 %description devel -l fr.UTF-8
320 L'interpréteur Python est relativement facile à étendre avec des
321 extensions chargées dynamiquement et à insérer dans d'autres
322 programmes. Ce paquetage contient les en-têtes et les bibliothèques
323 nécessaires à ces deux tâches.
324
325 %description devel -l pl.UTF-8
326 Interpreter Pythona jest w miarę łatwy do rozszerzania przy pomocy
327 dynamicznie ładowanych rozszerzeń napisanych w C lub C++ oraz
328 osadzania w innych programach. Ten pakiet zawiera pliki nagłówkowe i
329 wszystko inne co potrzebne do tych celów.
330
331 %description devel -l pt_BR.UTF-8
332 O interpretador Python permite incluir com facilidade extensões
333 carregadas dinamicamente. Python é também fácil de ser embutido em
334 outros programas. Este pacote contém os arquivos de inclusão e
335 bibliotecas necessários para estas duas tarefas.
336
337 %description devel -l ru.UTF-8
338 Интерпретатор Python относительно легко расширяется при помощи
339 динамически загружаемых расширений и встраивается в другие программы.
340 Этот пакет содержит хедеры и библиотеки, необходимые для обеих этих
341 задач.
342
343 %description devel -l tr.UTF-8
344 Bu paket, Python ile geliştirme yapılabilmesi için gerekli başlık
345 dosyalarını ve kitaplıkları içerir.
346
347 %description devel -l uk.UTF-8
348 Інтерпретатор Python відносно легко розширюється за допомогою
349 розширень з динамічною загрузкою та вбудовується в інші програми. Цей
350 пакет містить хедери та бібліотеки, необхідні для обох цих задач.
351
352 %package devel-src
353 Summary:        Python module sources
354 Summary(pl.UTF-8):      Pliki źródłowe modułów Pythona
355 Group:          Development/Languages/Python
356 Requires:       %{name}-modules = %{epoch}:%{version}-%{release}
357
358 %description devel-src
359 Python module sources.
360
361 %description devel-src -l pl.UTF-8
362 Pliki źródłowe modułów Pythona.
363
364 %package devel-tools
365 Summary:        Python development tools
366 Summary(pl.UTF-8):      Narzędzia programistyczne języka Python
367 Group:          Development/Languages/Python
368 Requires:       %{name}-modules = %{epoch}:%{version}-%{release}
369
370 %description devel-tools
371 Python development tools such as profilers and debugger.
372
373 %description devel-tools -l pl.UTF-8
374 Narzędzia programistyczne języka Python takie jak profiler oraz
375 debugger.
376
377 %package static
378 Summary:        Static python library
379 Summary(pl.UTF-8):      Statyczna biblioteka Pythona
380 Group:          Development/Languages/Python
381 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
382
383 %description static
384 Static python library.
385
386 %description static -l pl.UTF-8
387 Statyczna biblioteka Pythona.
388
389 %package doc
390 Summary:        Documentation on Python
391 Summary(de.UTF-8):      Dokumentation zu Python
392 Summary(es.UTF-8):      Documentación para Python
393 Summary(fr.UTF-8):      Documentation sur Python
394 Summary(pl.UTF-8):      Dokumentacja do Pythona
395 Summary(pt_BR.UTF-8):   Documentação para a linguagem de programação Python
396 Summary(ru.UTF-8):      Документация по языку Python
397 Summary(tr.UTF-8):      Python belgeleri
398 Summary(uk.UTF-8):      Документація по мові Python
399 Group:          Documentation
400 Obsoletes:      python-docs
401
402 %description doc
403 This package contains documentation on the Python language and
404 interpretor as a mix of plain ASCII files and LaTeX sources.
405
406 %description doc -l de.UTF-8
407 Dieses Paket enthält Dokumentationen zu Python (Sprache und
408 Interpreter) in Form von einfachen ASCII-Dateien und LaTeX-Quellen.
409
410 %description doc -l es.UTF-8
411 Documentación para Python. Contiene archivos en texto y PostScript.
412
413 %description doc -l fr.UTF-8
414 Ce paquetage contient la documentation sur le langage python et sur
415 son interpréteur sous forme de fichiers ASCII et LaTeX.
416
417 %description doc -l pl.UTF-8
418 Oficjalna dokumentacja do Pythona. Zawiera przykładowe programy,
419 narzędzia i dokumentację. Strony podręcznika man znajdują się w
420 głównym pakiecie. Ten pakiet nie zawiera źródeł dokumentacji
421 napisanych w LaTeXu, tylko gotowe do wykorzystania pliki postscriptowe
422 i HTML.
423
424 %description doc -l pt_BR.UTF-8
425 O pacote python-doc contém documentação para a linguagem de
426 programação e para o interpretador Python. Fornecida em arquivos texto
427 e Postcript.
428
429 %description doc -l ru.UTF-8
430 Этот пакет содержит документацию по собственно языку Python и по
431 исполняющему его интерпретатору в виде набора текстовых файлов и
432 исходных текстов в формате LaTeX.
433
434 %description doc -l tr.UTF-8
435 Bu paket, Python dili ile ilgili belgeleri ve düz ASCII dosyaları ve
436 LaTeX kaynaklarının bir karışımı olan yorumlayıcıyı içerir.
437
438 %description doc -l uk.UTF-8
439 Цей пакет містить документацію по власне мові Python та по виконуючому
440 її інтерпретатору у вигляді набора текстових файлів та вихідних
441 текстів у форматі LaTeX.
442
443 %package doc-info
444 Summary:        Documentation on Python in texinfo format
445 Summary(pl.UTF-8):      Dokumentacja do Pythona w formacie texinfo
446 Group:          Documentation
447
448 %description doc-info
449 Documentation on Python in texinfo format.
450
451 %description doc-info -l pl.UTF-8
452 Dokumentacja do Pythona w formacie texinfo.
453
454 %package tkinter
455 Summary:        Standard Python interface to the Tk GUI toolkit
456 Summary(de.UTF-8):      Grafische Tk-Schnittstelle für Python
457 Summary(es.UTF-8):      Interfaz de GUI Tk para Python
458 Summary(fr.UTF-8):      Interface graphique Tk pour Python
459 Summary(pl.UTF-8):      Standardowy interfejs Pythona do biblioteki Tk
460 Summary(pt_BR.UTF-8):   Interface GUI Tk para Phyton
461 Summary(tr.UTF-8):      Python için grafik kullanıcı arayüzü
462 Group:          Libraries/Python
463 Requires:       %{name}-modules = %{epoch}:%{version}-%{release}
464 Requires:       tcl >= 8.4.3
465 Requires:       tix >= 1:8.1.4-4
466 Requires:       tk >= 8.4.3
467 Obsoletes:      tkinter
468
469 %description tkinter
470 Standard Python interface to the Tk GUI toolkit.
471
472 %description tkinter -l de.UTF-8
473 Eine grafische Schnittstelle für Python, basierend auf Tcl/Tk, und von
474 vielen Konfigurations-Tools genutzt.
475
476 %description tkinter -l es.UTF-8
477 Una interfaz gráfica para Python, basada en Tcl/Tk, y usada por muchas
478 herramientas de configuración.
479
480 %description tkinter -l fr.UTF-8
481 Interface graphique pour Python, basée sur Tcl/Tk et utilisée par
482 beaucoup des outils de configuration.
483
484 %description tkinter -l pl.UTF-8
485 Standardowy interfejs Pythona do biblioteki Tk.
486
487 %description tkinter -l pt_BR.UTF-8
488 Uma interface gráfica para Python, baseada em Tcl/Tk, e usada por
489 muitas ferramentas de configuração.
490
491 %description tkinter -l ru.UTF-8
492 Графический интерфейс (GUI) для Python, построенный на Tcl/Tk.
493
494 %description tkinter -l tr.UTF-8
495 Python için Tcl/Tk'ye dayalı ve pek çok ayarlama aracı tarafından
496 kullanılan grafik bir arayüzdür.
497
498 %description tkinter -l uk.UTF-8
499 Графічний інтерфейс (GUI) для Python, побудований на Tcl/Tk.
500
501 %package examples
502 Summary:        Example programs in Python
503 Summary(pl.UTF-8):      Przykładowe programy w Pythonie
504 Group:          Development/Languages/Python
505 Obsoletes:      python-tools
506
507 %description examples
508 Example programs in Python.
509
510 These are for Python 2.3.4, not %{version}.
511
512 %description examples -l pl.UTF-8
513 Przykładowe programy w Pythonie.
514
515 Przykłady te są dla Pythona 2.3.4, nie %{version}.
516
517 %prep
518 %setup -q -n Python-%{version}%{beta}
519 %patch1 -p1
520 %patch2 -p1
521 %patch3 -p1
522 %patch5 -p1
523 %patch4 -p1
524
525 tar xjf %{SOURCE1}
526
527 %build
528 sed -i -e 's#-ltermcap#-ltinfo#g' configure*
529 %{__autoconf}
530 CPPFLAGS="-I/usr/include/ncurses"; export CPPFLAGS
531 %configure \
532         --with-threads \
533         --with-cxx-main="%{__cxx}" \
534         --enable-ipv6 \
535         --enable-unicode=ucs4 \
536         --enable-shared \
537         LINKCC='$(PURIFY) $(CXX)' \
538         LDSHARED='$(CC) $(CFLAGS) -shared' \
539         BLDSHARED='$(CC) $(CFLAGS) -shared' \
540         LDFLAGS="%{rpmcflags} %{rpmldflags}"
541
542 %{__make} \
543         OPT="%{rpmcflags}" 2>&1 | awk '
544 BEGIN { fail = 0; logmsg = ""; }
545 {
546                 if ($0 ~ /\*\*\* WARNING:/) {
547                                 fail = 1;
548                                 logmsg = logmsg $0;
549                 }
550                 print $0;
551 }
552 END { if (fail) { print "\nPROBLEMS FOUND:"; print logmsg; exit(1); } }'
553
554 LC_ALL=C
555 export LC_ALL
556 %if %{with tests}
557 binlibdir="`pwd`/`echo build/lib.*`"
558 %{__make} test \
559         TESTOPTS="%{test_flags} %{test_list}" \
560         TESTPYTHON="LD_LIBRARY_PATH=`pwd` PYTHONHOME=`pwd` PYTHONPATH=`pwd`/Lib:$binlibdir ./python -tt"
561 %endif
562
563 %install
564 rm -rf $RPM_BUILD_ROOT
565 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}} \
566         $RPM_BUILD_ROOT{%{py_sitedir},%{_mandir}/man1} \
567         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
568         $RPM_BUILD_ROOT%{_infodir} \
569         $RPM_BUILD_ROOT/etc/shrc.d
570
571 %{__make} install \
572         DESTDIR=$RPM_BUILD_ROOT
573
574 %if %{with info}
575 %{__make} -C Doc/info
576 install Doc/info/python*info* $RPM_BUILD_ROOT%{_infodir}
577 %endif
578
579 install Makefile.pre.in $RPM_BUILD_ROOT%{py_libdir}/config
580
581 mv $RPM_BUILD_ROOT{%{py_libdir}/config,%{_libdir}}/libpython%{py_ver}.a
582 ln -sf libpython%{py_ver}.a $RPM_BUILD_ROOT%{_libdir}/libpython.a
583 ln -sf libpython%{py_ver}.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libpython.so
584 ln -sf libpython%{py_ver}.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libpython%{py_ver}.so
585
586 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
587 cp -a Tools Demo $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
588
589 #
590 # create several useful aliases, such as timeit.py, profile.py, pdb.py, smtpd.py
591 #
592
593 # for python devel tools
594 for script in timeit profile pdb pstats; do
595     echo alias $script.py=\"python -m ${script}\"
596 done > $RPM_BUILD_ROOT/etc/shrc.d/python-devel.sh
597
598 sed 's/=/ /' \
599         < $RPM_BUILD_ROOT/etc/shrc.d/python-devel.sh \
600         > $RPM_BUILD_ROOT/etc/shrc.d/python-devel.csh
601
602 # for python modules
603 for script in smtpd webbrowser; do
604     echo alias $script.py=\"python -m ${script}\"
605 done > $RPM_BUILD_ROOT/etc/shrc.d/python-modules.sh
606
607 sed 's/=/ /' \
608         < $RPM_BUILD_ROOT/etc/shrc.d/python-modules.sh \
609         > $RPM_BUILD_ROOT/etc/shrc.d/python-modules.csh
610
611 # just to cut the noise, as they are not packaged (now)
612 # first tests
613 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/test
614 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/bsddb/test
615 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/ctypes/test
616 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/distutils/tests
617 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/email/test
618 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/sqlite3/test
619 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/json/tests
620 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/lib2to3/tests
621
622 # other files
623 rm -r $RPM_BUILD_ROOT%{py_scriptdir}/plat-*/regen
624 find $RPM_BUILD_ROOT%{py_scriptdir} -name \*.egg-info -exec rm {} \;
625 find $RPM_BUILD_ROOT%{py_scriptdir} -name \*.bat -exec rm {} \;
626 find $RPM_BUILD_ROOT%{py_scriptdir} -name \*.txt -exec rm {} \;
627 find $RPM_BUILD_ROOT%{py_scriptdir} -name README\* -exec rm {} \;
628
629 %clean
630 rm -rf $RPM_BUILD_ROOT
631
632 %post   libs -p /sbin/ldconfig
633 %postun libs -p /sbin/ldconfig
634
635 %post   doc-info -p /sbin/postshell
636 -/usr/sbin/fix-info-dir -c %{_infodir}
637
638 %postun doc-info -p /sbin/postshell
639 -/usr/sbin/fix-info-dir -c %{_infodir}
640
641 %files
642 %defattr(644,root,root,755)
643 %attr(755,root,root) %{_bindir}/python
644 %attr(755,root,root) %{_bindir}/python%{py_ver}
645 %{_mandir}/man1/python.1*
646
647 %files modules
648 %defattr(644,root,root,755)
649 /etc/shrc.d/python-modules*
650 %exclude %{py_scriptdir}/UserDict.py[co]
651 %exclude %{py_scriptdir}/codecs.py[co]
652 %exclude %{py_scriptdir}/copy_reg.py[co]
653 %exclude %{py_scriptdir}/locale.py[co]
654 %exclude %{py_scriptdir}/posixpath.py[co]
655 %exclude %{py_scriptdir}/pdb.py[co]
656 %exclude %{py_scriptdir}/profile.py[co]
657 %exclude %{py_scriptdir}/pstats.py[co]
658 %exclude %{py_scriptdir}/pydoc.py[co]
659 %exclude %{py_scriptdir}/site.py[co]
660 %exclude %{py_scriptdir}/stat.py[co]
661 %exclude %{py_scriptdir}/timeit.py[co]
662 %exclude %{py_scriptdir}/os.py[co]
663 %exclude %{py_scriptdir}/encodings/*.py[co]
664 %exclude %{py_scriptdir}/types.py[co]
665
666 %{py_scriptdir}/*.py[co]
667
668 %{py_dyndir}/*.egg-info
669
670 #
671 # list .so modules to be sure that all of them are built
672 #
673
674 # three modules below do not work on 64-bit architectures
675 # see Python README file for explanation
676 %ifnarch alpha ia64 ppc64 sparc64 %{x8664}
677 %attr(755,root,root) %{py_dyndir}/audioop.so
678 %attr(755,root,root) %{py_dyndir}/imageop.so
679 # sizeof(long) != sizeof(int), so dl module will not be built on 64-bit
680 # platforms
681 %attr(755,root,root) %{py_dyndir}/dl.so
682 %endif
683
684 %attr(755,root,root) %{py_dyndir}/array.so
685 %attr(755,root,root) %{py_dyndir}/binascii.so
686 %attr(755,root,root) %{py_dyndir}/_bisect.so
687 %attr(755,root,root) %{py_dyndir}/_bsddb.so
688 %attr(755,root,root) %{py_dyndir}/_bytesio.so
689 %attr(755,root,root) %{py_dyndir}/bz2.so
690 %attr(755,root,root) %{py_dyndir}/cmath.so
691 %attr(755,root,root) %{py_dyndir}/_codecs_cn.so
692 %attr(755,root,root) %{py_dyndir}/_codecs_hk.so
693 %attr(755,root,root) %{py_dyndir}/_codecs_iso2022.so
694 %attr(755,root,root) %{py_dyndir}/_codecs_jp.so
695 %attr(755,root,root) %{py_dyndir}/_codecs_kr.so
696 %attr(755,root,root) %{py_dyndir}/_codecs_tw.so
697 %attr(755,root,root) %{py_dyndir}/_collections.so
698 %attr(755,root,root) %{py_dyndir}/cPickle.so
699 %attr(755,root,root) %{py_dyndir}/crypt.so
700 %attr(755,root,root) %{py_dyndir}/cStringIO.so
701 %attr(755,root,root) %{py_dyndir}/_csv.so
702 %attr(755,root,root) %{py_dyndir}/_ctypes*.so
703 %attr(755,root,root) %{py_dyndir}/_curses_panel.so
704 %attr(755,root,root) %{py_dyndir}/_curses.so
705 %attr(755,root,root) %{py_dyndir}/datetime.so
706 %attr(755,root,root) %{py_dyndir}/_elementtree.so
707 %attr(755,root,root) %{py_dyndir}/_functools.so
708 %attr(755,root,root) %{py_dyndir}/_fileio.so
709 %attr(755,root,root) %{py_dyndir}/_hashlib.so
710 %attr(755,root,root) %{py_dyndir}/_heapq.so
711 %attr(755,root,root) %{py_dyndir}/_json.so
712 %attr(755,root,root) %{py_dyndir}/_locale.so
713 %attr(755,root,root) %{py_dyndir}/_lsprof.so
714 %attr(755,root,root) %{py_dyndir}/_multibytecodec.so
715 %attr(755,root,root) %{py_dyndir}/_multiprocessing.so
716 %attr(755,root,root) %{py_dyndir}/_random.so
717 %{?with_openssl097:%attr(755,root,root) %{py_dyndir}/_sha*.so}
718 %attr(755,root,root) %{py_dyndir}/_socket.so
719 %attr(755,root,root) %{py_dyndir}/_ssl.so
720 %attr(755,root,root) %{py_dyndir}/_testcapi.so
721 %attr(755,root,root) %{py_dyndir}/_weakref.so
722 %ifnarch sparc64
723 %attr(755,root,root) %{py_dyndir}/dbm.so
724 %endif
725 %attr(755,root,root) %{py_dyndir}/fcntl.so
726 %attr(755,root,root) %{py_dyndir}/future_builtins.so
727 %attr(755,root,root) %{py_dyndir}/gdbm.so
728 %attr(755,root,root) %{py_dyndir}/grp.so
729 %attr(755,root,root) %{py_dyndir}/itertools.so
730 %attr(755,root,root) %{py_dyndir}/linuxaudiodev.so
731 %attr(755,root,root) %{py_dyndir}/math.so
732 %attr(755,root,root) %{py_dyndir}/mmap.so
733 %attr(755,root,root) %{py_dyndir}/nis.so
734 %attr(755,root,root) %{py_dyndir}/operator.so
735 %attr(755,root,root) %{py_dyndir}/ossaudiodev.so
736 %attr(755,root,root) %{py_dyndir}/parser.so
737 %attr(755,root,root) %{py_dyndir}/pyexpat.so
738 %attr(755,root,root) %{py_dyndir}/readline.so
739 %attr(755,root,root) %{py_dyndir}/resource.so
740 %attr(755,root,root) %{py_dyndir}/select.so
741 %attr(755,root,root) %{py_dyndir}/strop.so
742 %attr(755,root,root) %{py_dyndir}/syslog.so
743 %attr(755,root,root) %{py_dyndir}/termios.so
744 %attr(755,root,root) %{py_dyndir}/time.so
745 %attr(755,root,root) %{py_dyndir}/spwd.so
746 %attr(755,root,root) %{py_dyndir}/unicodedata.so
747 %attr(755,root,root) %{py_dyndir}/zlib.so
748
749 %dir %{py_scriptdir}/plat-*
750 %{py_scriptdir}/plat-*/*.py[co]
751
752 %dir %{py_scriptdir}/bsddb
753 %{py_scriptdir}/bsddb/*.py[co]
754
755 %dir %{py_scriptdir}/compiler
756 %{py_scriptdir}/compiler/*.py[co]
757
758 %dir %{py_scriptdir}/ctypes
759 %dir %{py_scriptdir}/ctypes/macholib
760 %{py_scriptdir}/ctypes/*.py[co]
761 %{py_scriptdir}/ctypes/macholib/*.py[co]
762
763 %dir %{py_scriptdir}/curses
764 %{py_scriptdir}/curses/*.py[co]
765
766 %dir %{py_scriptdir}/distutils
767 %dir %{py_scriptdir}/distutils/command
768 %{py_scriptdir}/distutils/*.py[co]
769 %{py_scriptdir}/distutils/command/*.py[co]
770
771 %dir %{py_scriptdir}/email
772 %dir %{py_scriptdir}/email/mime
773 %{py_scriptdir}/email/*.py[co]
774 %{py_scriptdir}/email/mime/*.py[co]
775
776 %dir %{py_scriptdir}/json
777 %{py_scriptdir}/json/*.py[co]
778
779 %dir %{py_scriptdir}/logging
780 %{py_scriptdir}/logging/*.py[co]
781
782 %dir %{py_scriptdir}/multiprocessing
783 %dir %{py_scriptdir}/multiprocessing/dummy
784 %{py_scriptdir}/multiprocessing/*.py[co]
785 %{py_scriptdir}/multiprocessing/dummy/*.py[co]
786
787 %dir %{py_scriptdir}/wsgiref
788 %{py_scriptdir}/wsgiref/*.py[co]
789
790 %dir %{py_scriptdir}/xml
791 %dir %{py_scriptdir}/xml/dom
792 %dir %{py_scriptdir}/xml/etree
793 %dir %{py_scriptdir}/xml/parsers
794 %dir %{py_scriptdir}/xml/sax
795 %{py_scriptdir}/xml/*.py[co]
796 %{py_scriptdir}/xml/dom/*.py[co]
797 %{py_scriptdir}/xml/etree/*.py[co]
798 %{py_scriptdir}/xml/parsers/*.py[co]
799 %{py_scriptdir}/xml/sax/*.py[co]
800
801 %files modules-sqlite
802 %defattr(644,root,root,755)
803 %attr(755,root,root) %{py_dyndir}/_sqlite3.so
804 %dir %{py_scriptdir}/sqlite3
805 %{py_scriptdir}/sqlite3/*.py[co]
806
807 %files libs
808 %defattr(644,root,root,755)
809 %attr(755,root,root) %{_libdir}/libpython*.so.*
810
811 %dir %{py_dyndir}
812 %dir %{py_scriptdir}
813 %dir %{py_libdir}
814 %dir %{py_sitescriptdir}
815 %dir %{py_sitedir}
816
817 # shared modules required by python library
818 %attr(755,root,root) %{py_dyndir}/_struct.so
819
820 # modules required by python library
821 %{py_scriptdir}/UserDict.py[co]
822 %{py_scriptdir}/codecs.py[co]
823 %{py_scriptdir}/copy_reg.py[co]
824 %{py_scriptdir}/locale.py[co]
825 %{py_scriptdir}/posixpath.py[co]
826 %{py_scriptdir}/site.py[co]
827 %{py_scriptdir}/stat.py[co]
828 %{py_scriptdir}/os.py[co]
829 # needed by the dynamic sys.lib patch
830 %{py_scriptdir}/types.py[co]
831
832 # encodings required by python library
833 %dir %{py_scriptdir}/encodings
834 %{py_scriptdir}/encodings/*.py[co]
835
836 %files -n pydoc
837 %defattr(644,root,root,755)
838 %attr(755,root,root) %{_bindir}/pydoc
839 %{py_scriptdir}/pydoc.py[co]
840
841 %files -n idle
842 %defattr(644,root,root,755)
843 %attr(755,root,root) %{_bindir}/idle
844 %dir %{py_scriptdir}/idlelib
845 %dir %{py_scriptdir}/idlelib/Icons
846 %{py_scriptdir}/idlelib/*.py[co]
847 %{py_scriptdir}/idlelib/Icons/*
848 %{py_scriptdir}/idlelib/*.def
849
850 %files devel
851 %defattr(644,root,root,755)
852 %doc Misc/{ACKS,NEWS,README,README.valgrind,valgrind-python.supp}
853 %attr(755,root,root) %{_bindir}/python-config
854 %attr(755,root,root) %{_bindir}/python%{py_ver}-config
855 %attr(755,root,root) %{_libdir}/lib*.so
856 %dir %{py_incdir}
857 %{py_incdir}/*.h
858
859 %dir %{py_libdir}/config
860 %attr(755,root,root) %{py_libdir}/config/makesetup
861 %attr(755,root,root) %{py_libdir}/config/install-sh
862 %{py_libdir}/config/Makefile
863 %{py_libdir}/config/Makefile.pre.in
864 %{py_libdir}/config/Setup
865 %{py_libdir}/config/Setup.config
866 %{py_libdir}/config/Setup.local
867 %{py_libdir}/config/config.c
868 %{py_libdir}/config/config.c.in
869 %{py_libdir}/config/python.o
870
871 %files devel-src
872 %defattr(644,root,root,755)
873 %attr(-,root,root) %{py_scriptdir}/*.py
874 %{py_scriptdir}/plat-*/*.py
875 %{py_scriptdir}/bsddb/*.py
876 %{py_scriptdir}/ctypes/*.py
877 %{py_scriptdir}/ctypes/macholib/*.py
878 %{py_scriptdir}/compiler/*.py
879 %{py_scriptdir}/curses/*.py
880 %{py_scriptdir}/distutils/*.py
881 %{py_scriptdir}/distutils/command/*.py
882 %{py_scriptdir}/email/*.py
883 %{py_scriptdir}/email/mime/*.py
884 %{py_scriptdir}/hotshot/*.py
885 %{py_scriptdir}/json/*.py
886 %{py_scriptdir}/lib2to3/*.py
887 %{py_scriptdir}/lib2to3/fixes/*.py
888 %{py_scriptdir}/lib2to3/pgen2/*.py
889 %{py_scriptdir}/logging/*.py
890 %{py_scriptdir}/multiprocessing/*.py
891 %{py_scriptdir}/multiprocessing/dummy/*.py
892 %{py_scriptdir}/sqlite3/*.py
893 %{py_scriptdir}/wsgiref/*.py
894 %{py_scriptdir}/xml/*.py
895 %{py_scriptdir}/xml/dom/*.py
896 %{py_scriptdir}/xml/etree/*.py
897 %{py_scriptdir}/xml/parsers/*.py
898 %{py_scriptdir}/xml/sax/*.py
899 %{py_scriptdir}/encodings/*.py
900 %{py_scriptdir}/idlelib/*.py
901
902 %files devel-tools
903 %defattr(644,root,root,755)
904 %doc Lib/pdb.doc
905 /etc/shrc.d/python-devel*
906
907 %attr(755,root,root) %{_bindir}/2to3
908 %dir %{py_scriptdir}/lib2to3
909 %dir %{py_scriptdir}/lib2to3/fixes
910 %dir %{py_scriptdir}/lib2to3/pgen2
911 %{py_scriptdir}/lib2to3/*.py[co]
912 %{py_scriptdir}/lib2to3/*.pickle
913 %{py_scriptdir}/lib2to3/fixes/*.py[co]
914 %{py_scriptdir}/lib2to3/pgen2/*.py[co]
915
916 %attr(755,root,root) %{py_dyndir}/_hotshot.so
917 %dir %{py_scriptdir}/hotshot
918 %{py_scriptdir}/hotshot/*.py[co]
919 %{py_scriptdir}/pdb.py[co]
920 %{py_scriptdir}/profile.py[co]
921 %{py_scriptdir}/pstats.py[co]
922 %{py_scriptdir}/timeit.py[co]
923
924 %files static
925 %defattr(644,root,root,755)
926 %{_libdir}/lib*.a
927
928 %files examples
929 %defattr(644,root,root,755)
930 %{_examplesdir}/%{name}-%{version}
931
932
933 %files doc
934 %defattr(644,root,root,755)
935 %doc python-docs-html/*
936
937 %if %{with info}
938 %files doc-info
939 %defattr(644,root,root,755)
940 %{_infodir}/*.info*
941 %endif
942
943 %if %{with tkinter}
944 %files tkinter
945 %defattr(644,root,root,755)
946 %{py_scriptdir}/lib-tk
947 %attr(755,root,root) %{py_dyndir}/_tkinter.so
948 %endif
This page took 0.146934 seconds and 4 git commands to generate.