blob: e457de6ccf8b8674b605fe9a1a0e907bad95bd9b [file] [log] [blame]
Guido van Rossum2ef777f2003-02-24 01:09:53 +00001##########################
2# User-modifiable configs
3##########################
4
5# Is the resulting package and the installed binary named "python" or
6# "python2"?
7#WARNING: Commenting out doesn't work. Last line is what's used.
8%define config_binsuffix none
9%define config_binsuffix 2.3
10
11# Build tkinter? "auto" enables it if /usr/bin/wish exists.
12#WARNING: Commenting out doesn't work. Last line is what's used.
13%define config_tkinter no
14%define config_tkinter yes
15%define config_tkinter auto
16
17# Use pymalloc? The last line (commented or not) determines wether
18# pymalloc is used.
19#WARNING: Commenting out doesn't work. Last line is what's used.
20%define config_pymalloc no
21%define config_pymalloc yes
22
23# Enable IPV6?
24#WARNING: Commenting out doesn't work. Last line is what's used.
25%define config_ipv6 yes
26%define config_ipv6 no
27
28#################################
29# End of user-modifiable configs
30#################################
31
32%define name python
Guido van Rossum0f698332003-02-24 17:55:37 +000033%define version 2.3b1
Guido van Rossum2ef777f2003-02-24 01:09:53 +000034%define libvers 2.3
Guido van Rossum0f698332003-02-24 17:55:37 +000035%define release 1pydotorg
Guido van Rossum2ef777f2003-02-24 01:09:53 +000036%define __prefix /usr
37
38# kludge to get around rpm <percent>define weirdness
39%define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else echo --disable-ipv6; fi)
40%define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi)
41%define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi)
42%define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi)
43
44Summary: An interpreted, interactive, object-oriented programming language.
45Name: %{name}%{binsuffix}
46Version: %{version}
47Release: %{release}
48Copyright: Modified CNRI Open Source License
49Group: Development/Languages
50Source: Python-%{version}.tgz
51Source1: html-%{version}.tar.bz2
52Patch0: Python-2.1-pythonpath.patch
53#Patch1: Python-2.1-expat.patch
54BuildRoot: /var/tmp/%{name}-%{version}-root
55BuildPrereq: expat-devel
56BuildPrereq: db4-devel
57BuildPrereq: gdbm-devel
58Prefix: %{__prefix}
59Packager: Sean Reifschneider <jafo-rpms@tummy.com>
60
61%description
62Python is an interpreted, interactive, object-oriented programming
63language. It incorporates modules, exceptions, dynamic typing, very high
64level dynamic data types, and classes. Python combines remarkable power
65with very clear syntax. It has interfaces to many system calls and
66libraries, as well as to various window systems, and is extensible in C or
67C++. It is also usable as an extension language for applications that need
68a programmable interface. Finally, Python is portable: it runs on many
69brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the
70Mac.
71
72%package devel
73Summary: The libraries and header files needed for Python extension development.
74Prereq: python%{binsuffix} = %{PACKAGE_VERSION}
75Group: Development/Libraries
76
77%description devel
78The Python programming language's interpreter can be extended with
79dynamically loaded extensions and can be embedded in other programs.
80This package contains the header files and libraries needed to do
81these types of tasks.
82
83Install python-devel if you want to develop Python extensions. The
84python package will also need to be installed. You'll probably also
85want to install the python-docs package, which contains Python
86documentation.
87
88%if %{include_tkinter}
89%package tkinter
90Summary: A graphical user interface for the Python scripting language.
91Group: Development/Languages
92Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release}
93
94%description tkinter
95The Tkinter (Tk interface) program is an graphical user interface for
96the Python scripting language.
97
98You should install the tkinter package if you'd like to use a graphical
99user interface for Python programming.
100%endif
101
102%package tools
103Summary: A collection of development tools included with Python.
104Group: Development/Tools
105Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release}
106
107%description tools
108The Python package includes several development tools that are used
109to build python programs. This package contains a selection of those
110tools, including the IDLE Python IDE.
111
112Install python-tools if you want to use these tools to develop
113Python programs. You will also need to install the python and
114tkinter packages.
115
116%package docs
117Summary: Python-related documentation.
118Group: Development/Documentation
119
120%description docs
121Documentation relating to the Python programming language in HTML and info
122formats.
123
124%changelog
Guido van Rossum0f698332003-02-24 17:55:37 +0000125* Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg]
126- Updating to 2.3b1 release.
127
Guido van Rossum2ef777f2003-02-24 01:09:53 +0000128* Mon Feb 17 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3a1-1]
129- Updating to 2.3 release.
130
131* Sun Dec 23 2001 Sean Reifschneider <jafo-rpms@tummy.com>
132[Release 2.2-2]
133- Added -docs package.
134- Added "auto" config_tkinter setting which only enables tk if
135 /usr/bin/wish exists.
136
137* Sat Dec 22 2001 Sean Reifschneider <jafo-rpms@tummy.com>
138[Release 2.2-1]
139- Updated to 2.2.
140- Changed the extension to "2" from "2.2".
141
142* Tue Nov 18 2001 Sean Reifschneider <jafo-rpms@tummy.com>
143[Release 2.2c1-1]
144- Updated to 2.2c1.
145
146* Thu Nov 1 2001 Sean Reifschneider <jafo-rpms@tummy.com>
147[Release 2.2b1-3]
148- Changed the way the sed for fixing the #! in pydoc works.
149
150* Wed Oct 24 2001 Sean Reifschneider <jafo-rpms@tummy.com>
151[Release 2.2b1-2]
152- Fixed missing "email" package, thanks to anonymous report on sourceforge.
153- Fixed missing "compiler" package.
154
155* Mon Oct 22 2001 Sean Reifschneider <jafo-rpms@tummy.com>
156[Release 2.2b1-1]
157- Updated to 2.2b1.
158
159* Mon Oct 9 2001 Sean Reifschneider <jafo-rpms@tummy.com>
160[Release 2.2a4-4]
161- otto@balinor.mat.unimi.it mentioned that the license file is missing.
162
163* Sun Sep 30 2001 Sean Reifschneider <jafo-rpms@tummy.com>
164[Release 2.2a4-3]
165- Ignacio Vazquez-Abrams pointed out that I had a spruious double-quote in
166 the spec files. Thanks.
167
168* Wed Jul 25 2001 Sean Reifschneider <jafo-rpms@tummy.com>
169[Release 2.2a1-1]
170- Updated to 2.2a1 release.
171- Changed idle and pydoc to use binsuffix macro
172
173#######
174# PREP
175#######
176%prep
177%setup -n Python-%{version}
178%patch0 -p1
179#%patch1
180
181########
182# BUILD
183########
184%build
185./configure %{ipv6} %{pymalloc} --prefix=%{__prefix}
186make
187
188##########
189# INSTALL
190##########
191%install
192# set the install path
193echo '[install_scripts]' >setup.cfg
194echo 'install_dir='"${RPM_BUILD_ROOT}/usr/bin" >>setup.cfg
195
196[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
197mkdir -p $RPM_BUILD_ROOT%{__prefix}/lib/python%{libvers}/lib-dynload
198make prefix=$RPM_BUILD_ROOT%{__prefix} install
199
200# REPLACE PATH IN PYDOC
201if [ ! -z "%{binsuffix}" ]
202then
203 (
204 cd $RPM_BUILD_ROOT%{__prefix}/bin
205 mv pydoc pydoc.old
206 sed 's|#!.*|#!/usr/bin/env python'%{binsuffix}'|' \
207 pydoc.old >pydoc
208 chmod 755 pydoc
209 rm -f pydoc.old
210 )
211fi
212
213# add the binsuffix
214if [ ! -z "%{binsuffix}" ]
215then
216 ( cd $RPM_BUILD_ROOT%{__prefix}/bin; rm -f python[0-9a-zA-Z]*;
217 mv -f python python"%{binsuffix}" )
218 ( cd $RPM_BUILD_ROOT%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 )
219 ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f pydoc pydoc"%{binsuffix}" )
220 ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f idle idle"%{binsuffix}" )
221fi
222
223########
224# Tools
225echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
226echo 'exec %{_prefix}/bin/python%{binsuffix} /usr/lib/python%{libvers}/Tools/idle/idle.py' >>$RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
227chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
228cp -a Tools $RPM_BUILD_ROOT%{_prefix}/lib/python%{libvers}
229
230# MAKE FILE LISTS
231rm -f mainpkg.files
232find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/lib-dynload -type f |
233 sed "s|^${RPM_BUILD_ROOT}|/|" |
234 grep -v -e '_tkinter.so$' >mainpkg.files
235find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f |
236 sed "s|^${RPM_BUILD_ROOT}|/|" |
237 grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files
238
239rm -f tools.files
240find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/Tools -type f |
241 sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files
242echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files
243
244######
245# Docs
246mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python
247(
248 cd "$RPM_BUILD_ROOT"/var/www/html/python
249 bunzip2 < %{SOURCE1} | tar x
250)
251
252########
253# CLEAN
254########
255%clean
256rm -fr $RPM_BUILD_ROOT
257rm -f mainpkg.files tools.files
258
259########
260# FILES
261########
262%files -f mainpkg.files
263%defattr(-,root,root)
264%doc Misc/README Misc/cheatsheet Misc/Porting
265%doc LICENSE Misc/ACKS Misc/HISTORY Misc/NEWS
266%{__prefix}/man/man1/python%{binsuffix}.1.gz
267
268%dir %{__prefix}/include/python%{libvers}
269%dir %{__prefix}/lib/python%{libvers}/
270%{__prefix}/lib/python%{libvers}/*.txt
271%{__prefix}/lib/python%{libvers}/*.py*
272%{__prefix}/lib/python%{libvers}/pdb.doc
273%{__prefix}/lib/python%{libvers}/profile.doc
274%{__prefix}/lib/python%{libvers}/curses
275%{__prefix}/lib/python%{libvers}/distutils
276%{__prefix}/lib/python%{libvers}/encodings
277%dir %{__prefix}/lib/python%{libvers}/lib-old
278%{__prefix}/lib/python%{libvers}/plat-linux2
279%{__prefix}/lib/python%{libvers}/site-packages
280%{__prefix}/lib/python%{libvers}/test
281%{__prefix}/lib/python%{libvers}/xml
282%{__prefix}/lib/python%{libvers}/email
283%{__prefix}/lib/python%{libvers}/compiler
284%{__prefix}/lib/python%{libvers}/bsddb
285%{__prefix}/lib/python%{libvers}/hotshot
286%{__prefix}/lib/python%{libvers}/logging
287%{__prefix}/lib/python%{libvers}/lib-old
288
289%files devel
290%defattr(-,root,root)
291%{__prefix}/include/python%{libvers}/*.h
292%{__prefix}/lib/python%{libvers}/config
293
294%files -f tools.files tools
295%defattr(-,root,root)
296
297%if %{include_tkinter}
298%files tkinter
299%defattr(-,root,root)
300%{__prefix}/lib/python%{libvers}/lib-tk
301%{__prefix}/lib/python%{libvers}/lib-dynload/_tkinter.so*
302%endif
303
304%files docs
305%defattr(-,root,root)
306/var/www/html/python/*