1 ##########################
2 # User-modifiable configs
3 ##########################
5 # Is the resulting package and the installed binary named "python" or
7 #WARNING: Commenting out doesn't work. Last line is what's used.
8 %define config_binsuffix none
9 %define config_binsuffix
2.6
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
17 # Use pymalloc? The last line (commented or not) determines wether
19 #WARNING: Commenting out doesn't work. Last line is what's used.
20 %define config_pymalloc no
21 %define config_pymalloc yes
24 #WARNING: Commenting out doesn't work. Last line is what's used.
25 %define config_ipv6 yes
26 %define config_ipv6 no
28 # Location of the HTML directory.
29 %define config_htmldir
/var
/www
/html
/python
31 #################################
32 # End of user-modifiable configs
33 #################################
40 %define release
1pydotorg
43 # kludge to get around rpm <percent>define weirdness
44 %define ipv6 %
(if [ "
%{config_ipv6}"
= yes
]; then echo --enable-ipv6
; else echo --disable
-ipv6
; fi)
45 %define pymalloc %
(if [ "
%{config_pymalloc}"
= yes
]; then echo --with
-pymalloc
; else echo --without
-pymalloc
; fi)
46 %define binsuffix %
(if [ "
%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"
; fi)
47 %define include_tkinter %
(if [ \\
( "
%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}"
= yes
]; then echo 1; else echo 0; fi)
48 %define libdirname %
(( uname
-m | egrep
-q '_64$'
&& [ -d
/usr
/lib64
] && echo lib64
) ||
echo lib
)
50 # detect if documentation is available
51 %define include_docs %
(if [ -f "
%{_sourcedir}/html-%{version}.tar.bz2"
]; then echo 1; else echo 0; fi)
53 Summary: An interpreted
, interactive
, object
-oriented programming language.
54 Name: %{name}%{binsuffix}
57 Copyright: Modified CNRI Open
Source License
58 Group: Development
/Languages
59 Source: Python
-%{version}.tar.bz2
61 Source1: html
-%{version}.tar.bz2
63 BuildRoot: %{_tmppath}/%{name}-%{version}-root
64 BuildPrereq
: expat
-devel
65 BuildPrereq
: db4
-devel
66 BuildPrereq
: gdbm
-devel
67 BuildPrereq
: sqlite
-devel
69 Packager: Sean Reifschneider
<jafo
-rpms@tummy.com
>
72 Python is an interpreted
, interactive
, object
-oriented programming
73 language. It incorporates modules
, exceptions
, dynamic typing
, very high
74 level dynamic data types
, and classes. Python combines remarkable power
75 with very clear syntax. It has interfaces to many system calls and
76 libraries
, as well as to various window systems
, and is extensible
in C or
77 C
++. It is also usable as an extension language
for applications that need
78 a programmable interface. Finally
, Python is portable
: it runs on many
79 brands of UNIX
, on PCs under Windows
, MS
-DOS
, and OS
/2, and on the
83 Summary: The libraries and header files needed
for Python extension development.
84 Prereq
: python
%{binsuffix} = %{PACKAGE_VERSION}
85 Group: Development
/Libraries
88 The Python programming language's interpreter can be extended with
89 dynamically loaded extensions and can be embedded
in other programs.
90 This package contains the header files and libraries needed to
do
93 Install python
-devel
if you want to develop Python extensions. The
94 python package will also need to be installed. You'll probably also
95 want to
install the python
-docs package
, which contains Python
98 %if %{include_tkinter}
100 Summary: A graphical user interface
for the Python scripting language.
101 Group: Development
/Languages
102 Prereq
: python
%{binsuffix} = %{PACKAGE_VERSION}-%{release}
105 The Tkinter
(Tk interface
) program is an graphical user interface
for
106 the Python scripting language.
108 You should
install the tkinter package
if you'd like to use a graphical
109 user interface
for Python programming.
113 Summary: A collection of development tools included with Python.
114 Group: Development
/Tools
115 Prereq
: python
%{binsuffix} = %{PACKAGE_VERSION}-%{release}
118 The Python package includes several development tools that are used
119 to build python programs. This package contains a selection of those
120 tools
, including the IDLE Python IDE.
122 Install python
-tools
if you want to use these tools to develop
123 Python programs. You will also need to
install the python and
128 Summary: Python
-related documentation.
129 Group: Development
/Documentation
132 Documentation relating to the Python programming language
in HTML and info
137 * Mon Dec
20 2004 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.4-2pydotorg
]
138 - Changing the idle wrapper so that it passes arguments to idle.
140 * Tue Oct
19 2004 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.4b1
-1pydotorg
]
143 * Thu Jul
22 2004 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3.4-3pydotorg
]
144 - Paul Tiemann fixes
for %{prefix}.
145 - Adding permission changes
for directory as suggested by reimeika.ca
146 - Adding code to detect when it should be using lib64.
147 - Adding a define
for the location of
/var
/www
/html
for docs.
149 * Thu May
27 2004 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3.4-2pydotorg
]
150 - Including changes from Ian Holsman to build under Red Hat
7.3.
151 - Fixing some problems with the
/usr
/local path change.
153 * Sat Mar
27 2004 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3.2-3pydotorg
]
154 - Being more agressive about finding the paths to fix
for
155 #!/usr/local/bin/python.
157 * Sat Feb
07 2004 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3.3-2pydotorg
]
158 - Adding code to remove "
#!/usr/local/bin/python" from particular files and
159 causing the RPM build to terminate
if there are any unexpected files
160 which have that line
in them.
162 * Mon Oct
13 2003 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3.2-1pydotorg
]
163 - Adding code to detect wether documentation is available to build.
165 * Fri Sep
19 2003 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3.1-1pydotorg
]
166 - Updating to the
2.3.1 release.
168 * Mon Feb
24 2003 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3b1
-1pydotorg
]
169 - Updating to
2.3b1 release.
171 * Mon Feb
17 2003 Sean Reifschneider
<jafo
-rpms@tummy.com
> [2.3a1
-1]
172 - Updating to
2.3 release.
174 * Sun Dec
23 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
176 - Added
-docs package.
177 - Added "auto" config_tkinter setting which only enables tk
if
178 /usr
/bin
/wish exists.
180 * Sat Dec
22 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
183 - Changed the extension to "
2" from "
2.2".
185 * Tue Nov
18 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
189 * Thu Nov
1 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
191 - Changed the way the sed
for fixing the
#! in pydoc works.
193 * Wed Oct
24 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
195 - Fixed missing "email" package
, thanks to anonymous report on sourceforge.
196 - Fixed missing "compiler" package.
198 * Mon Oct
22 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
202 * Mon Oct
9 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
204 - otto@balinor.mat.unimi.it mentioned that the license file is missing.
206 * Sun Sep
30 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
208 - Ignacio Vazquez
-Abrams pointed out that I had a spruious double
-quote
in
209 the spec files. Thanks.
211 * Wed Jul
25 2001 Sean Reifschneider
<jafo
-rpms@tummy.com
>
213 - Updated to
2.2a1 release.
214 - Changed idle and pydoc to use binsuffix macro
220 %setup -n Python
-%{version}
226 .
/configure
--enable-unicode
=ucs4
%{ipv6} %{pymalloc} --prefix=%{__prefix}
233 # set the install path
234 echo '
[install_scripts
]'
>setup.cfg
235 echo 'install_dir
='"$
{RPM_BUILD_ROOT
}%{__prefix}/bin"
>>setup.cfg
237 [ -d "$RPM_BUILD_ROOT"
-a "$RPM_BUILD_ROOT"
!= "
/"
] && rm -rf $RPM_BUILD_ROOT
238 mkdir -p $RPM_BUILD_ROOT
%{__prefix}/%{libdirname}/python%{libvers}/lib
-dynload
239 make prefix
=$RPM_BUILD_ROOT
%{__prefix} install
241 # REPLACE PATH IN PYDOC
242 if [ ! -z "
%{binsuffix}"
]
245 cd $RPM_BUILD_ROOT
%{__prefix}/bin
247 sed 's|
#!.*|#!%{__prefix}/bin/env python'%{binsuffix}'|' \
255 if [ ! -z "
%{binsuffix}"
]
257 ( cd $RPM_BUILD_ROOT
%{__prefix}/bin
; rm -f python
[0-9a
-zA
-Z
]*;
258 mv
-f python python"
%{binsuffix}"
)
259 ( cd $RPM_BUILD_ROOT
%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 )
260 ( cd $RPM_BUILD_ROOT
%{__prefix}/bin; mv -f pydoc pydoc"%{binsuffix}"
)
261 ( cd $RPM_BUILD_ROOT
%{__prefix}/bin; mv -f idle idle"%{binsuffix}"
)
266 echo '
#!%{__prefix}/bin/env python%{binsuffix}' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
267 echo 'import os
, sys'
>>$
{RPM_BUILD_ROOT
}%{__prefix}/bin/idle%{binsuffix}
268 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}
269 echo 'print "Failed to
exec Idle"'
>>$
{RPM_BUILD_ROOT
}%{__prefix}/bin/idle%{binsuffix}
270 echo 'sys.
exit(1)'
>>$
{RPM_BUILD_ROOT
}%{__prefix}/bin/idle%{binsuffix}
271 chmod
755 $RPM_BUILD_ROOT
%{__prefix}/bin/idle%{binsuffix}
272 cp
-a Tools $RPM_BUILD_ROOT
%{__prefix}/%{libdirname}/python%{libvers}
276 find "$RPM_BUILD_ROOT""
%{__prefix}"/%{libdirname}/python%{libvers}/lib
-dynload
-type f |
277 sed "s|^$
{RPM_BUILD_ROOT
}|
/|" |
278 grep
-v
-e '_tkinter.so$'
>mainpkg.files
279 find "$RPM_BUILD_ROOT""
%{__prefix}"
/bin
-type f |
280 sed "s|^$
{RPM_BUILD_ROOT
}|
/|" |
281 grep
-v
-e '
/bin
/idle
%{binsuffix}$'
>>mainpkg.files
284 find "$RPM_BUILD_ROOT""
%{__prefix}"/%{libdirname}/python%{libvers}/idlelib \
285 "$RPM_BUILD_ROOT""
%{__prefix}"/%{libdirname}/python%{libvers}/Tools
-type f |
286 sed "s|^$
{RPM_BUILD_ROOT
}|
/|"
>tools.files
287 echo "
%{__prefix}"/bin/idle%{binsuffix} >>tools.files
292 mkdir -p "$RPM_BUILD_ROOT"
%{config_htmldir}
294 cd "$RPM_BUILD_ROOT"
%{config_htmldir}
295 bunzip2
< %{SOURCE1} | tar x
299 # fix the #! line in installed files
300 find "$RPM_BUILD_ROOT"
-type f
-print0 |
301 xargs
-0 grep
-l
/usr
/local/bin
/python |
while read file
304 sed 's|^
#!.*python|#!%{__prefix}/bin/env python'"%{binsuffix}"'|' \
305 "$FIXFILE"
>/tmp
/fix
-python
-path.$$
306 cat
/tmp
/fix
-python
-path.$$
>"$FIXFILE"
307 rm -f
/tmp
/fix
-python
-path.$$
310 # check to see if there are any straggling #! lines
311 find "$RPM_BUILD_ROOT"
-type f | xargs egrep
-n '^
#! */usr/local/bin/python' \
312 | grep '
:1:#!' >/tmp/python-rpm-files.$$ || true
313 if [ -s
/tmp
/python
-rpm
-files.$$
]
315 echo '
*****************************************************'
316 cat
/tmp
/python
-rpm
-files.$$
318 *****************************************************
319 There are still files referencing
/usr
/local/bin
/python
in the
320 install directory. They are listed above. Please fix the .spec
321 file and try again. If you are an end
-user
, you probably want
322 to report this to jafo
-rpms@tummy.com as well.
323 *****************************************************
325 rm -f
/tmp
/python
-rpm
-files.$$
328 rm -f
/tmp
/python
-rpm
-files.$$
334 [ -n "$RPM_BUILD_ROOT"
-a "$RPM_BUILD_ROOT"
!= / ] && rm -rf $RPM_BUILD_ROOT
335 rm -f mainpkg.files tools.files
340 %files -f mainpkg.files
341 %defattr(-,root
,root
)
342 %doc Misc
/README Misc
/cheatsheet Misc
/Porting
343 %doc LICENSE Misc
/ACKS Misc
/HISTORY Misc
/NEWS
344 %{__prefix}/man/man1/python%{binsuffix}.1*
346 %attr(755,root
,root
) %dir %{__prefix}/include/python%{libvers}
347 %attr(755,root
,root
) %dir %{__prefix}/%{libdirname}/python%{libvers}/
348 %{__prefix}/%{libdirname}/python%{libvers}/*.txt
349 %{__prefix}/%{libdirname}/python%{libvers}/*.py
*
350 %{__prefix}/%{libdirname}/python%{libvers}/pdb.doc
351 %{__prefix}/%{libdirname}/python%{libvers}/profile.doc
352 %{__prefix}/%{libdirname}/python%{libvers}/curses
353 %{__prefix}/%{libdirname}/python%{libvers}/distutils
354 %{__prefix}/%{libdirname}/python%{libvers}/encodings
355 %{__prefix}/%{libdirname}/python%{libvers}/plat
-linux2
356 %{__prefix}/%{libdirname}/python%{libvers}/site
-packages
357 %{__prefix}/%{libdirname}/python%{libvers}/test
358 %{__prefix}/%{libdirname}/python%{libvers}/xml
359 %{__prefix}/%{libdirname}/python%{libvers}/email
360 %{__prefix}/%{libdirname}/python%{libvers}/email
/mime
361 %{__prefix}/%{libdirname}/python%{libvers}/sqlite3
362 %{__prefix}/%{libdirname}/python%{libvers}/compiler
363 %{__prefix}/%{libdirname}/python%{libvers}/bsddb
364 %{__prefix}/%{libdirname}/python%{libvers}/hotshot
365 %{__prefix}/%{libdirname}/python%{libvers}/logging
366 %{__prefix}/%{libdirname}/python%{libvers}/lib
-old
369 %defattr(-,root
,root
)
370 %{__prefix}/include/python%{libvers}/*.h
371 %{__prefix}/%{libdirname}/python%{libvers}/config
373 %files -f tools.files tools
374 %defattr(-,root
,root
)
376 %if %{include_tkinter}
378 %defattr(-,root
,root
)
379 %{__prefix}/%{libdirname}/python%{libvers}/lib
-tk
380 %{__prefix}/%{libdirname}/python%{libvers}/lib
-dynload
/_tkinter.so
*
385 %defattr(-,root
,root
)