Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 1 | ########################## |
| 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 Rossum | 0f69833 | 2003-02-24 17:55:37 +0000 | [diff] [blame] | 33 | %define version 2.3b1 |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 34 | %define libvers 2.3 |
Guido van Rossum | 0f69833 | 2003-02-24 17:55:37 +0000 | [diff] [blame] | 35 | %define release 1pydotorg |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 36 | %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 | |
| 44 | Summary: An interpreted, interactive, object-oriented programming language. |
| 45 | Name: %{name}%{binsuffix} |
| 46 | Version: %{version} |
| 47 | Release: %{release} |
| 48 | Copyright: Modified CNRI Open Source License |
| 49 | Group: Development/Languages |
| 50 | Source: Python-%{version}.tgz |
| 51 | 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 |
| 55 | BuildPrereq: expat-devel |
| 56 | BuildPrereq: db4-devel |
| 57 | BuildPrereq: gdbm-devel |
| 58 | Prefix: %{__prefix} |
| 59 | Packager: Sean Reifschneider <jafo-rpms@tummy.com> |
| 60 | |
| 61 | %description |
| 62 | Python is an interpreted, interactive, object-oriented programming |
| 63 | language. It incorporates modules, exceptions, dynamic typing, very high |
| 64 | level dynamic data types, and classes. Python combines remarkable power |
| 65 | with very clear syntax. It has interfaces to many system calls and |
| 66 | libraries, as well as to various window systems, and is extensible in C or |
| 67 | C++. It is also usable as an extension language for applications that need |
| 68 | a programmable interface. Finally, Python is portable: it runs on many |
| 69 | brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the |
| 70 | Mac. |
| 71 | |
| 72 | %package devel |
| 73 | Summary: The libraries and header files needed for Python extension development. |
| 74 | Prereq: python%{binsuffix} = %{PACKAGE_VERSION} |
| 75 | Group: Development/Libraries |
| 76 | |
| 77 | %description devel |
| 78 | The Python programming language's interpreter can be extended with |
| 79 | dynamically loaded extensions and can be embedded in other programs. |
| 80 | This package contains the header files and libraries needed to do |
| 81 | these types of tasks. |
| 82 | |
| 83 | Install python-devel if you want to develop Python extensions. The |
| 84 | python package will also need to be installed. You'll probably also |
| 85 | want to install the python-docs package, which contains Python |
| 86 | documentation. |
| 87 | |
| 88 | %if %{include_tkinter} |
| 89 | %package tkinter |
| 90 | Summary: A graphical user interface for the Python scripting language. |
| 91 | Group: Development/Languages |
| 92 | Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} |
| 93 | |
| 94 | %description tkinter |
| 95 | The Tkinter (Tk interface) program is an graphical user interface for |
| 96 | the Python scripting language. |
| 97 | |
| 98 | You should install the tkinter package if you'd like to use a graphical |
| 99 | user interface for Python programming. |
| 100 | %endif |
| 101 | |
| 102 | %package tools |
| 103 | Summary: A collection of development tools included with Python. |
| 104 | Group: Development/Tools |
| 105 | Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} |
| 106 | |
| 107 | %description tools |
| 108 | The Python package includes several development tools that are used |
| 109 | to build python programs. This package contains a selection of those |
| 110 | tools, including the IDLE Python IDE. |
| 111 | |
| 112 | Install python-tools if you want to use these tools to develop |
| 113 | Python programs. You will also need to install the python and |
| 114 | tkinter packages. |
| 115 | |
| 116 | %package docs |
| 117 | Summary: Python-related documentation. |
| 118 | Group: Development/Documentation |
| 119 | |
| 120 | %description docs |
| 121 | Documentation relating to the Python programming language in HTML and info |
| 122 | formats. |
| 123 | |
| 124 | %changelog |
Guido van Rossum | 0f69833 | 2003-02-24 17:55:37 +0000 | [diff] [blame] | 125 | * Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg] |
| 126 | - Updating to 2.3b1 release. |
| 127 | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 128 | * 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} |
| 186 | make |
| 187 | |
| 188 | ########## |
| 189 | # INSTALL |
| 190 | ########## |
| 191 | %install |
| 192 | # set the install path |
| 193 | echo '[install_scripts]' >setup.cfg |
| 194 | echo 'install_dir='"${RPM_BUILD_ROOT}/usr/bin" >>setup.cfg |
| 195 | |
| 196 | [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT |
| 197 | mkdir -p $RPM_BUILD_ROOT%{__prefix}/lib/python%{libvers}/lib-dynload |
| 198 | make prefix=$RPM_BUILD_ROOT%{__prefix} install |
| 199 | |
| 200 | # REPLACE PATH IN PYDOC |
| 201 | if [ ! -z "%{binsuffix}" ] |
| 202 | then |
| 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 | ) |
| 211 | fi |
| 212 | |
| 213 | # add the binsuffix |
| 214 | if [ ! -z "%{binsuffix}" ] |
| 215 | then |
| 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}" ) |
| 221 | fi |
| 222 | |
| 223 | ######## |
| 224 | # Tools |
| 225 | 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} |
| 227 | chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} |
| 228 | cp -a Tools $RPM_BUILD_ROOT%{_prefix}/lib/python%{libvers} |
| 229 | |
| 230 | # MAKE FILE LISTS |
| 231 | rm -f mainpkg.files |
| 232 | find "$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 |
| 235 | find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f | |
| 236 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
| 237 | grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files |
| 238 | |
| 239 | rm -f tools.files |
| 240 | find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/Tools -type f | |
| 241 | sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files |
| 242 | echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files |
| 243 | |
| 244 | ###### |
| 245 | # Docs |
| 246 | mkdir -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 |
| 256 | rm -fr $RPM_BUILD_ROOT |
| 257 | rm -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/* |