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 |
Thomas Wouters | 00ee7ba | 2006-08-21 19:07:27 +0000 | [diff] [blame] | 9 | %define config_binsuffix 2.6 |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 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 | |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 28 | # Build shared libraries or .a library? |
| 29 | #WARNING: Commenting out doesn't work. Last line is what's used. |
| 30 | %define config_sharedlib no |
| 31 | %define config_sharedlib yes |
| 32 | |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 33 | # Location of the HTML directory. |
| 34 | %define config_htmldir /var/www/html/python |
| 35 | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 36 | ################################# |
| 37 | # End of user-modifiable configs |
| 38 | ################################# |
| 39 | |
| 40 | %define name python |
Barry Warsaw | bb5cd08 | 2008-04-02 23:33:27 +0000 | [diff] [blame] | 41 | #--start constants-- |
Georg Brandl | c7dcd50 | 2012-09-29 09:04:54 +0200 | [diff] [blame] | 42 | %define version 3.3.0 |
Georg Brandl | 3ebb6b3 | 2011-02-20 10:37:07 +0000 | [diff] [blame] | 43 | %define libvers 3.3 |
Barry Warsaw | bb5cd08 | 2008-04-02 23:33:27 +0000 | [diff] [blame] | 44 | #--end constants-- |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 45 | %define release 1pydotorg |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 46 | %define __prefix /usr |
| 47 | |
| 48 | # kludge to get around rpm <percent>define weirdness |
| 49 | %define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else echo --disable-ipv6; fi) |
| 50 | %define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi) |
| 51 | %define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi) |
| 52 | %define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi) |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 53 | %define libdirname %(( uname -m | egrep -q '_64$' && [ -d /usr/lib64 ] && echo lib64 ) || echo lib) |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 54 | %define sharedlib %(if [ "%{config_sharedlib}" = yes ]; then echo --enable-shared; else echo ; fi) |
| 55 | %define include_sharedlib %(if [ "%{config_sharedlib}" = yes ]; then echo 1; else echo 0; fi) |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 56 | |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 57 | # detect if documentation is available |
| 58 | %define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi) |
| 59 | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 60 | Summary: An interpreted, interactive, object-oriented programming language. |
| 61 | Name: %{name}%{binsuffix} |
| 62 | Version: %{version} |
| 63 | Release: %{release} |
Georg Brandl | f5b204a | 2010-08-01 18:38:26 +0000 | [diff] [blame] | 64 | License: PSF |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 65 | Group: Development/Languages |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 66 | Source: Python-%{version}.tar.bz2 |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 67 | %if %{include_docs} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 68 | Source1: html-%{version}.tar.bz2 |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 69 | %endif |
| 70 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 71 | BuildPrereq: expat-devel |
| 72 | BuildPrereq: db4-devel |
| 73 | BuildPrereq: gdbm-devel |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 74 | BuildPrereq: sqlite-devel |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 75 | Prefix: %{__prefix} |
| 76 | Packager: Sean Reifschneider <jafo-rpms@tummy.com> |
| 77 | |
| 78 | %description |
| 79 | Python is an interpreted, interactive, object-oriented programming |
| 80 | language. It incorporates modules, exceptions, dynamic typing, very high |
| 81 | level dynamic data types, and classes. Python combines remarkable power |
| 82 | with very clear syntax. It has interfaces to many system calls and |
| 83 | libraries, as well as to various window systems, and is extensible in C or |
| 84 | C++. It is also usable as an extension language for applications that need |
| 85 | a programmable interface. Finally, Python is portable: it runs on many |
| 86 | brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the |
| 87 | Mac. |
| 88 | |
| 89 | %package devel |
| 90 | Summary: The libraries and header files needed for Python extension development. |
| 91 | Prereq: python%{binsuffix} = %{PACKAGE_VERSION} |
| 92 | Group: Development/Libraries |
| 93 | |
| 94 | %description devel |
| 95 | The Python programming language's interpreter can be extended with |
| 96 | dynamically loaded extensions and can be embedded in other programs. |
| 97 | This package contains the header files and libraries needed to do |
| 98 | these types of tasks. |
| 99 | |
| 100 | Install python-devel if you want to develop Python extensions. The |
| 101 | python package will also need to be installed. You'll probably also |
| 102 | want to install the python-docs package, which contains Python |
| 103 | documentation. |
| 104 | |
| 105 | %if %{include_tkinter} |
| 106 | %package tkinter |
| 107 | Summary: A graphical user interface for the Python scripting language. |
| 108 | Group: Development/Languages |
| 109 | Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} |
| 110 | |
| 111 | %description tkinter |
| 112 | The Tkinter (Tk interface) program is an graphical user interface for |
| 113 | the Python scripting language. |
| 114 | |
| 115 | You should install the tkinter package if you'd like to use a graphical |
| 116 | user interface for Python programming. |
| 117 | %endif |
| 118 | |
| 119 | %package tools |
| 120 | Summary: A collection of development tools included with Python. |
| 121 | Group: Development/Tools |
| 122 | Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} |
| 123 | |
| 124 | %description tools |
| 125 | The Python package includes several development tools that are used |
| 126 | to build python programs. This package contains a selection of those |
| 127 | tools, including the IDLE Python IDE. |
| 128 | |
| 129 | Install python-tools if you want to use these tools to develop |
| 130 | Python programs. You will also need to install the python and |
| 131 | tkinter packages. |
| 132 | |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 133 | %if %{include_docs} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 134 | %package docs |
| 135 | Summary: Python-related documentation. |
| 136 | Group: Development/Documentation |
| 137 | |
| 138 | %description docs |
| 139 | Documentation relating to the Python programming language in HTML and info |
| 140 | formats. |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 141 | %endif |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 142 | |
| 143 | %changelog |
Sean Reifschneider | 7caafe7 | 2004-12-21 02:22:29 +0000 | [diff] [blame] | 144 | * Mon Dec 20 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.4-2pydotorg] |
| 145 | - Changing the idle wrapper so that it passes arguments to idle. |
| 146 | |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 147 | * Tue Oct 19 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.4b1-1pydotorg] |
| 148 | - Updating to 2.4. |
| 149 | |
| 150 | * Thu Jul 22 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.4-3pydotorg] |
| 151 | - Paul Tiemann fixes for %{prefix}. |
| 152 | - Adding permission changes for directory as suggested by reimeika.ca |
| 153 | - Adding code to detect when it should be using lib64. |
| 154 | - Adding a define for the location of /var/www/html for docs. |
| 155 | |
Martin v. Löwis | 173ecb6 | 2004-05-31 19:40:57 +0000 | [diff] [blame] | 156 | * Thu May 27 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.4-2pydotorg] |
| 157 | - Including changes from Ian Holsman to build under Red Hat 7.3. |
| 158 | - Fixing some problems with the /usr/local path change. |
| 159 | |
Skip Montanaro | beddfcb | 2004-05-17 13:17:38 +0000 | [diff] [blame] | 160 | * Sat Mar 27 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.2-3pydotorg] |
Martin v. Löwis | fb66cd2 | 2004-03-31 18:59:04 +0000 | [diff] [blame] | 161 | - Being more agressive about finding the paths to fix for |
| 162 | #!/usr/local/bin/python. |
| 163 | |
Martin v. Löwis | d3c810e | 2004-02-15 21:27:03 +0000 | [diff] [blame] | 164 | * Sat Feb 07 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.3-2pydotorg] |
| 165 | - Adding code to remove "#!/usr/local/bin/python" from particular files and |
| 166 | causing the RPM build to terminate if there are any unexpected files |
| 167 | which have that line in them. |
| 168 | |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 169 | * Mon Oct 13 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.2-1pydotorg] |
| 170 | - Adding code to detect wether documentation is available to build. |
| 171 | |
| 172 | * Fri Sep 19 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.1-1pydotorg] |
| 173 | - Updating to the 2.3.1 release. |
| 174 | |
Guido van Rossum | 0f69833 | 2003-02-24 17:55:37 +0000 | [diff] [blame] | 175 | * Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg] |
| 176 | - Updating to 2.3b1 release. |
| 177 | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 178 | * Mon Feb 17 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3a1-1] |
| 179 | - Updating to 2.3 release. |
| 180 | |
| 181 | * Sun Dec 23 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 182 | [Release 2.2-2] |
| 183 | - Added -docs package. |
| 184 | - Added "auto" config_tkinter setting which only enables tk if |
| 185 | /usr/bin/wish exists. |
| 186 | |
| 187 | * Sat Dec 22 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 188 | [Release 2.2-1] |
| 189 | - Updated to 2.2. |
| 190 | - Changed the extension to "2" from "2.2". |
| 191 | |
| 192 | * Tue Nov 18 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 193 | [Release 2.2c1-1] |
| 194 | - Updated to 2.2c1. |
| 195 | |
| 196 | * Thu Nov 1 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 197 | [Release 2.2b1-3] |
| 198 | - Changed the way the sed for fixing the #! in pydoc works. |
| 199 | |
| 200 | * Wed Oct 24 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 201 | [Release 2.2b1-2] |
| 202 | - Fixed missing "email" package, thanks to anonymous report on sourceforge. |
| 203 | - Fixed missing "compiler" package. |
| 204 | |
| 205 | * Mon Oct 22 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 206 | [Release 2.2b1-1] |
| 207 | - Updated to 2.2b1. |
| 208 | |
| 209 | * Mon Oct 9 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 210 | [Release 2.2a4-4] |
| 211 | - otto@balinor.mat.unimi.it mentioned that the license file is missing. |
| 212 | |
| 213 | * Sun Sep 30 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 214 | [Release 2.2a4-3] |
| 215 | - Ignacio Vazquez-Abrams pointed out that I had a spruious double-quote in |
| 216 | the spec files. Thanks. |
| 217 | |
| 218 | * Wed Jul 25 2001 Sean Reifschneider <jafo-rpms@tummy.com> |
| 219 | [Release 2.2a1-1] |
| 220 | - Updated to 2.2a1 release. |
| 221 | - Changed idle and pydoc to use binsuffix macro |
| 222 | |
| 223 | ####### |
| 224 | # PREP |
| 225 | ####### |
| 226 | %prep |
| 227 | %setup -n Python-%{version} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 228 | |
| 229 | ######## |
| 230 | # BUILD |
| 231 | ######## |
| 232 | %build |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 233 | echo "Setting for ipv6: %{ipv6}" |
| 234 | echo "Setting for pymalloc: %{pymalloc}" |
| 235 | echo "Setting for binsuffix: %{binsuffix}" |
| 236 | echo "Setting for include_tkinter: %{include_tkinter}" |
| 237 | echo "Setting for libdirname: %{libdirname}" |
| 238 | echo "Setting for sharedlib: %{sharedlib}" |
| 239 | echo "Setting for include_sharedlib: %{include_sharedlib}" |
| 240 | ./configure --enable-unicode=ucs4 %{sharedlib} %{ipv6} %{pymalloc} --prefix=%{__prefix} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 241 | make |
| 242 | |
| 243 | ########## |
| 244 | # INSTALL |
| 245 | ########## |
| 246 | %install |
| 247 | # set the install path |
| 248 | echo '[install_scripts]' >setup.cfg |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 249 | echo 'install_dir='"${RPM_BUILD_ROOT}%{__prefix}/bin" >>setup.cfg |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 250 | |
| 251 | [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 252 | mkdir -p $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 253 | make prefix=$RPM_BUILD_ROOT%{__prefix} install |
| 254 | |
| 255 | # REPLACE PATH IN PYDOC |
| 256 | if [ ! -z "%{binsuffix}" ] |
| 257 | then |
| 258 | ( |
| 259 | cd $RPM_BUILD_ROOT%{__prefix}/bin |
| 260 | mv pydoc pydoc.old |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 261 | sed 's|#!.*|#!%{__prefix}/bin/env python'%{binsuffix}'|' \ |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 262 | pydoc.old >pydoc |
| 263 | chmod 755 pydoc |
| 264 | rm -f pydoc.old |
| 265 | ) |
| 266 | fi |
| 267 | |
| 268 | # add the binsuffix |
| 269 | if [ ! -z "%{binsuffix}" ] |
| 270 | then |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 271 | rm -f $RPM_BUILD_ROOT%{__prefix}/bin/python[0-9a-zA-Z]* |
| 272 | ( cd $RPM_BUILD_ROOT%{__prefix}/bin; |
| 273 | for file in *; do mv "$file" "$file"%{binsuffix}; done ) |
| 274 | ( cd $RPM_BUILD_ROOT%{_mandir}/man1; mv python.1 python%{binsuffix}.1 ) |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 275 | fi |
| 276 | |
| 277 | ######## |
| 278 | # Tools |
Sean Reifschneider | 7caafe7 | 2004-12-21 02:22:29 +0000 | [diff] [blame] | 279 | echo '#!%{__prefix}/bin/env python%{binsuffix}' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} |
| 280 | echo 'import os, sys' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} |
| 281 | echo 'os.execvp("%{__prefix}/bin/python%{binsuffix}", ["%{__prefix}/bin/python%{binsuffix}", "%{__prefix}/lib/python%{libvers}/idlelib/idle.py"] + sys.argv[1:])' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} |
| 282 | echo 'print "Failed to exec Idle"' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} |
| 283 | echo 'sys.exit(1)' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 284 | chmod 755 $RPM_BUILD_ROOT%{__prefix}/bin/idle%{binsuffix} |
| 285 | cp -a Tools $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 286 | |
| 287 | # MAKE FILE LISTS |
| 288 | rm -f mainpkg.files |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 289 | find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers} -type f | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 290 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 291 | grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >mainpkg.files |
| 292 | find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f -o -type l | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 293 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 294 | grep -v -e '/bin/2to3%{binsuffix}$' | |
| 295 | grep -v -e '/bin/pydoc%{binsuffix}$' | |
| 296 | grep -v -e '/bin/smtpd.py%{binsuffix}$' | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 297 | grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files |
| 298 | |
| 299 | rm -f tools.files |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 300 | find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/idlelib \ |
| 301 | "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/Tools -type f | |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 302 | sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 303 | echo "%{__prefix}"/bin/2to3%{binsuffix} >>tools.files |
| 304 | echo "%{__prefix}"/bin/pydoc%{binsuffix} >>tools.files |
| 305 | echo "%{__prefix}"/bin/smtpd.py%{binsuffix} >>tools.files |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 306 | echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files |
| 307 | |
| 308 | ###### |
| 309 | # Docs |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 310 | %if %{include_docs} |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 311 | mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 312 | ( |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 313 | cd "$RPM_BUILD_ROOT"%{config_htmldir} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 314 | bunzip2 < %{SOURCE1} | tar x |
| 315 | ) |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 316 | %endif |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 317 | |
Martin v. Löwis | d3c810e | 2004-02-15 21:27:03 +0000 | [diff] [blame] | 318 | # fix the #! line in installed files |
Martin v. Löwis | 173ecb6 | 2004-05-31 19:40:57 +0000 | [diff] [blame] | 319 | find "$RPM_BUILD_ROOT" -type f -print0 | |
| 320 | xargs -0 grep -l /usr/local/bin/python | while read file |
Martin v. Löwis | d3c810e | 2004-02-15 21:27:03 +0000 | [diff] [blame] | 321 | do |
Martin v. Löwis | 173ecb6 | 2004-05-31 19:40:57 +0000 | [diff] [blame] | 322 | FIXFILE="$file" |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 323 | sed 's|^#!.*python|#!%{__prefix}/bin/env python'"%{binsuffix}"'|' \ |
Martin v. Löwis | 173ecb6 | 2004-05-31 19:40:57 +0000 | [diff] [blame] | 324 | "$FIXFILE" >/tmp/fix-python-path.$$ |
| 325 | cat /tmp/fix-python-path.$$ >"$FIXFILE" |
Martin v. Löwis | d3c810e | 2004-02-15 21:27:03 +0000 | [diff] [blame] | 326 | rm -f /tmp/fix-python-path.$$ |
| 327 | done |
| 328 | |
| 329 | # check to see if there are any straggling #! lines |
| 330 | find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \ |
| 331 | | grep ':1:#!' >/tmp/python-rpm-files.$$ || true |
| 332 | if [ -s /tmp/python-rpm-files.$$ ] |
| 333 | then |
| 334 | echo '*****************************************************' |
| 335 | cat /tmp/python-rpm-files.$$ |
| 336 | cat <<@EOF |
| 337 | ***************************************************** |
| 338 | There are still files referencing /usr/local/bin/python in the |
| 339 | install directory. They are listed above. Please fix the .spec |
| 340 | file and try again. If you are an end-user, you probably want |
| 341 | to report this to jafo-rpms@tummy.com as well. |
| 342 | ***************************************************** |
| 343 | @EOF |
| 344 | rm -f /tmp/python-rpm-files.$$ |
| 345 | exit 1 |
| 346 | fi |
| 347 | rm -f /tmp/python-rpm-files.$$ |
| 348 | |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 349 | ######## |
| 350 | # CLEAN |
| 351 | ######## |
| 352 | %clean |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 353 | [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 354 | rm -f mainpkg.files tools.files |
| 355 | |
| 356 | ######## |
| 357 | # FILES |
| 358 | ######## |
| 359 | %files -f mainpkg.files |
| 360 | %defattr(-,root,root) |
| 361 | %doc Misc/README Misc/cheatsheet Misc/Porting |
| 362 | %doc LICENSE Misc/ACKS Misc/HISTORY Misc/NEWS |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 363 | %{_mandir}/man1/python%{binsuffix}.1* |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 364 | |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 365 | %attr(755,root,root) %dir %{__prefix}/include/python%{libvers} |
| 366 | %attr(755,root,root) %dir %{__prefix}/%{libdirname}/python%{libvers}/ |
Sean Reifscheider | 3a078aa | 2010-01-16 04:35:26 +0000 | [diff] [blame] | 367 | %if %{include_sharedlib} |
| 368 | %{__prefix}/%{libdirname}/libpython* |
| 369 | %endif |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 370 | |
| 371 | %files devel |
| 372 | %defattr(-,root,root) |
| 373 | %{__prefix}/include/python%{libvers}/*.h |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 374 | %{__prefix}/%{libdirname}/python%{libvers}/config |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 375 | |
| 376 | %files -f tools.files tools |
| 377 | %defattr(-,root,root) |
| 378 | |
| 379 | %if %{include_tkinter} |
| 380 | %files tkinter |
| 381 | %defattr(-,root,root) |
Georg Brandl | 6e47a33 | 2008-05-17 19:15:58 +0000 | [diff] [blame] | 382 | %{__prefix}/%{libdirname}/python%{libvers}/tkinter |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 383 | %{__prefix}/%{libdirname}/python%{libvers}/lib-dynload/_tkinter.so* |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 384 | %endif |
| 385 | |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 386 | %if %{include_docs} |
Guido van Rossum | 2ef777f | 2003-02-24 01:09:53 +0000 | [diff] [blame] | 387 | %files docs |
| 388 | %defattr(-,root,root) |
Sean Reifschneider | 054541e | 2004-10-21 23:35:45 +0000 | [diff] [blame] | 389 | %{config_htmldir}/* |
Martin v. Löwis | 52da449 | 2003-10-19 18:34:52 +0000 | [diff] [blame] | 390 | %endif |