3030#################################
3131
3232%define name python
33- %define version 2.3b1
33+ %define version 2.3.2
3434%define libvers 2.3
3535%define release 1pydotorg
3636%define __prefix /usr
4141%define binsuffix %(if [ "%{config_binsuffix }" = none ]; then echo ; else echo "%{config_binsuffix }"; fi)
4242%define include_tkinter %(if [ \\( "%{config_tkinter }" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter }" = yes ]; then echo 1; else echo 0; fi)
4343
44+ # detect if documentation is available
45+ %define include_docs %(if [ -f "%{_sourcedir }/html-%{version }.tar.bz2" ]; then echo 1; else echo 0; fi)
46+
4447Summary: An interpreted, interactive, object-oriented programming language.
4548Name: %{name }%{binsuffix }
4649Version: %{version }
4750Release: %{release }
4851Copyright: Modified CNRI Open Source License
4952Group: Development/Languages
5053Source: Python-%{version }.tgz
54+ %if %{include_docs }
5155Source1: html-%{version }.tar.bz2
52- Patch0: Python-2.1-pythonpath.patch
53- #Patch1: Python-2.1-expat.patch
54- BuildRoot: /var/tmp/%{name }-%{version }-root
56+ %endif
57+ BuildRoot: %{_tmppath }/%{name }-%{version }-root
5558BuildPrereq: expat-devel
5659BuildPrereq: db4-devel
5760BuildPrereq: gdbm-devel
@@ -113,15 +116,23 @@ Install python-tools if you want to use these tools to develop
113116Python programs. You will also need to install the python and
114117tkinter packages.
115118
119+ %if %{include_docs }
116120%package docs
117121Summary: Python-related documentation.
118122Group: Development/Documentation
119123
120124%description docs
121125Documentation relating to the Python programming language in HTML and info
122126formats.
127+ %endif
123128
124129%changelog
130+ * Mon Oct 13 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.2-1pydotorg]
131+ - Adding code to detect wether documentation is available to build.
132+
133+ * Fri Sep 19 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.1-1pydotorg]
134+ - Updating to the 2.3.1 release.
135+
125136* Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg]
126137- Updating to 2.3b1 release.
127138
@@ -175,14 +186,12 @@ formats.
175186#######
176187%prep
177188%setup -n Python-%{version}
178- %patch0 -p1
179- #%patch1
180189
181190########
182191# BUILD
183192########
184193%build
185- ./configure %{ipv6} %{pymalloc} --prefix=%{__prefix}
194+ ./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix}
186195make
187196
188197##########
223232########
224233# Tools
225234echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
226- echo 'exec %{_prefix }/bin/python%{binsuffix } /usr/lib/python%{libvers }/Tools/idle /idle.py' >> $RPM_BUILD_ROOT%{_bindir }/idle%{binsuffix }
235+ echo 'exec %{_prefix }/bin/python%{binsuffix } /usr/lib/python%{libvers }/idlelib /idle.py' >> $RPM_BUILD_ROOT%{_bindir }/idle%{binsuffix }
227236chmod 755 $RPM_BUILD_ROOT%{_bindir }/idle%{binsuffix }
228237cp -a Tools $RPM_BUILD_ROOT%{_prefix }/lib/python%{libvers }
229238
@@ -237,23 +246,26 @@ find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f |
237246 grep -v -e '/bin/idle%{binsuffix }$' >> mainpkg.files
238247
239248rm -f tools.files
240- find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers }/Tools -type f |
241- sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
249+ find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers }/idlelib \
250+ "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers }/Tools -type f |
251+ sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
242252echo "%{__prefix}"/bin/idle%{binsuffix } >> tools.files
243253
244254######
245255# Docs
256+ %if %{include_docs }
246257mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python
247258(
248259 cd "$RPM_BUILD_ROOT"/var/www/html/python
249260 bunzip2 < %{SOURCE1 } | tar x
250261)
262+ %endif
251263
252264########
253265# CLEAN
254266########
255267%clean
256- rm -fr $RPM_BUILD_ROOT
268+ [ -n " $RPM_BUILD_ROOT " -a " $RPM_BUILD_ROOT " != / ] && rm -rf $RPM_BUILD_ROOT
257269rm -f mainpkg.files tools.files
258270
259271########
@@ -274,7 +286,6 @@ rm -f mainpkg.files tools.files
274286%{__prefix}/lib/python%{libvers }/curses
275287%{__prefix}/lib/python%{libvers }/distutils
276288%{__prefix}/lib/python%{libvers }/encodings
277- %dir %{__prefix}/lib/python%{libvers }/lib-old
278289%{__prefix}/lib/python%{libvers }/plat-linux2
279290%{__prefix}/lib/python%{libvers }/site-packages
280291%{__prefix}/lib/python%{libvers }/test
@@ -301,6 +312,8 @@ rm -f mainpkg.files tools.files
301312%{__prefix}/lib/python%{libvers }/lib-dynload/_tkinter.so*
302313%endif
303314
315+ %if %{include_docs }
304316%files docs
305317%defattr(-,root,root)
306318/var/www/html/python/*
319+ %endif
0 commit comments