Commit 52da4496 authored by Martin v. Löwis's avatar Martin v. Löwis

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.
parent 01a74b2f
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
################################# #################################
%define name python %define name python
%define version 2.3b1 %define version 2.3.2
%define libvers 2.3 %define libvers 2.3
%define release 1pydotorg %define release 1pydotorg
%define __prefix /usr %define __prefix /usr
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
%define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi) %define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi)
%define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi) %define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi)
# detect if documentation is available
%define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi)
Summary: An interpreted, interactive, object-oriented programming language. Summary: An interpreted, interactive, object-oriented programming language.
Name: %{name}%{binsuffix} Name: %{name}%{binsuffix}
Version: %{version} Version: %{version}
...@@ -48,10 +51,10 @@ Release: %{release} ...@@ -48,10 +51,10 @@ Release: %{release}
Copyright: Modified CNRI Open Source License Copyright: Modified CNRI Open Source License
Group: Development/Languages Group: Development/Languages
Source: Python-%{version}.tgz Source: Python-%{version}.tgz
%if %{include_docs}
Source1: html-%{version}.tar.bz2 Source1: html-%{version}.tar.bz2
Patch0: Python-2.1-pythonpath.patch %endif
#Patch1: Python-2.1-expat.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRoot: /var/tmp/%{name}-%{version}-root
BuildPrereq: expat-devel BuildPrereq: expat-devel
BuildPrereq: db4-devel BuildPrereq: db4-devel
BuildPrereq: gdbm-devel BuildPrereq: gdbm-devel
...@@ -113,6 +116,7 @@ Install python-tools if you want to use these tools to develop ...@@ -113,6 +116,7 @@ Install python-tools if you want to use these tools to develop
Python programs. You will also need to install the python and Python programs. You will also need to install the python and
tkinter packages. tkinter packages.
%if %{include_docs}
%package docs %package docs
Summary: Python-related documentation. Summary: Python-related documentation.
Group: Development/Documentation Group: Development/Documentation
...@@ -120,8 +124,15 @@ Group: Development/Documentation ...@@ -120,8 +124,15 @@ Group: Development/Documentation
%description docs %description docs
Documentation relating to the Python programming language in HTML and info Documentation relating to the Python programming language in HTML and info
formats. formats.
%endif
%changelog %changelog
* Mon Oct 13 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.2-1pydotorg]
- Adding code to detect wether documentation is available to build.
* Fri Sep 19 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.1-1pydotorg]
- Updating to the 2.3.1 release.
* Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg] * Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg]
- Updating to 2.3b1 release. - Updating to 2.3b1 release.
...@@ -175,14 +186,12 @@ formats. ...@@ -175,14 +186,12 @@ formats.
####### #######
%prep %prep
%setup -n Python-%{version} %setup -n Python-%{version}
%patch0 -p1
#%patch1
######## ########
# BUILD # BUILD
######## ########
%build %build
./configure %{ipv6} %{pymalloc} --prefix=%{__prefix} ./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix}
make make
########## ##########
...@@ -223,7 +232,7 @@ fi ...@@ -223,7 +232,7 @@ fi
######## ########
# Tools # Tools
echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
echo 'exec %{_prefix}/bin/python%{binsuffix} /usr/lib/python%{libvers}/Tools/idle/idle.py' >>$RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} echo 'exec %{_prefix}/bin/python%{binsuffix} /usr/lib/python%{libvers}/idlelib/idle.py' >>$RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
cp -a Tools $RPM_BUILD_ROOT%{_prefix}/lib/python%{libvers} cp -a Tools $RPM_BUILD_ROOT%{_prefix}/lib/python%{libvers}
...@@ -237,23 +246,26 @@ find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f | ...@@ -237,23 +246,26 @@ find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f |
grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files
rm -f tools.files rm -f tools.files
find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/Tools -type f | find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/idlelib \
sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/Tools -type f |
sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files
echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files
###### ######
# Docs # Docs
%if %{include_docs}
mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python
( (
cd "$RPM_BUILD_ROOT"/var/www/html/python cd "$RPM_BUILD_ROOT"/var/www/html/python
bunzip2 < %{SOURCE1} | tar x bunzip2 < %{SOURCE1} | tar x
) )
%endif
######## ########
# CLEAN # CLEAN
######## ########
%clean %clean
rm -fr $RPM_BUILD_ROOT [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
rm -f mainpkg.files tools.files rm -f mainpkg.files tools.files
######## ########
...@@ -274,7 +286,6 @@ rm -f mainpkg.files tools.files ...@@ -274,7 +286,6 @@ rm -f mainpkg.files tools.files
%{__prefix}/lib/python%{libvers}/curses %{__prefix}/lib/python%{libvers}/curses
%{__prefix}/lib/python%{libvers}/distutils %{__prefix}/lib/python%{libvers}/distutils
%{__prefix}/lib/python%{libvers}/encodings %{__prefix}/lib/python%{libvers}/encodings
%dir %{__prefix}/lib/python%{libvers}/lib-old
%{__prefix}/lib/python%{libvers}/plat-linux2 %{__prefix}/lib/python%{libvers}/plat-linux2
%{__prefix}/lib/python%{libvers}/site-packages %{__prefix}/lib/python%{libvers}/site-packages
%{__prefix}/lib/python%{libvers}/test %{__prefix}/lib/python%{libvers}/test
...@@ -301,6 +312,8 @@ rm -f mainpkg.files tools.files ...@@ -301,6 +312,8 @@ rm -f mainpkg.files tools.files
%{__prefix}/lib/python%{libvers}/lib-dynload/_tkinter.so* %{__prefix}/lib/python%{libvers}/lib-dynload/_tkinter.so*
%endif %endif
%if %{include_docs}
%files docs %files docs
%defattr(-,root,root) %defattr(-,root,root)
/var/www/html/python/* /var/www/html/python/*
%endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment