Skip to content

Commit 52da449

Browse files
committed
Patch #823259: Update spec file:
- skip building HTML documentation if it is not available. - Removal of patches, which can't be referenced from a build directly from the tar-file. - Using the RPM tmp directory macro for the buildroot location. - Ensuring that the clean directive doesn't accidentally delete the users root directory or another directory. - --enable-unicode=ucs4 in configure line. Backported to 2.3.
1 parent 01a74b2 commit 52da449

1 file changed

Lines changed: 25 additions & 12 deletions

File tree

Misc/RPM/python-2.3.spec

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
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
@@ -41,17 +41,20 @@
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+
4447
Summary: An interpreted, interactive, object-oriented programming language.
4548
Name: %{name}%{binsuffix}
4649
Version: %{version}
4750
Release: %{release}
4851
Copyright: Modified CNRI Open Source License
4952
Group: Development/Languages
5053
Source: Python-%{version}.tgz
54+
%if %{include_docs}
5155
Source1: 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
5558
BuildPrereq: expat-devel
5659
BuildPrereq: db4-devel
5760
BuildPrereq: gdbm-devel
@@ -113,15 +116,23 @@ Install python-tools if you want to use these tools to develop
113116
Python programs. You will also need to install the python and
114117
tkinter packages.
115118

119+
%if %{include_docs}
116120
%package docs
117121
Summary: Python-related documentation.
118122
Group: Development/Documentation
119123

120124
%description docs
121125
Documentation relating to the Python programming language in HTML and info
122126
formats.
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}
186195
make
187196

188197
##########
@@ -223,7 +232,7 @@ fi
223232
########
224233
# Tools
225234
echo '#!/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}
227236
chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
228237
cp -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

239248
rm -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
242252
echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files
243253

244254
######
245255
# Docs
256+
%if %{include_docs}
246257
mkdir -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
257269
rm -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

Comments
 (0)