author | lp117937 |
Thu, 11 May 2006 04:56:15 +0000 | |
changeset 7242 | 19b994b053db |
parent 7124 | db1febd335b2 |
child 7244 | b65ebefa231b |
permissions | -rw-r--r-- |
2146 | 1 |
# |
2 |
# spec file for package SUNWPython |
|
3 |
# |
|
4 |
# includes module(s): Python |
|
5 |
# |
|
6214 | 6 |
# Copyright (c) 2004-2005 Sun Microsystems, Inc. |
2146 | 7 |
# This file and all modifications and additions to the pristine |
8 |
# package are under the same license as the package itself. |
|
9 |
# |
|
10 |
%include Solaris.inc |
|
5950 | 11 |
|
12 |
%define p23_version 2.3.3 |
|
13 |
%define p23_subdir sfw |
|
14 |
%define p23_prefix %{_basedir}/%{p23_subdir} |
|
15 |
%define p23_bindir %{p23_prefix}/bin |
|
16 |
%define p23_libdir %{p23_prefix}/lib |
|
17 |
%define p23_includedir %{p23_prefix}/include |
|
18 |
%define p23_sysconfdir /etc |
|
19 |
%define p23_datadir %{p23_prefix}/share |
|
20 |
%define p23_mandir %{p23_datadir}/man |
|
3984 | 21 |
|
2146 | 22 |
Name: SUNWPython |
23 |
Summary: The Python interpreter, libraries and utilities |
|
6214 | 24 |
Version: 2.4.2 |
2621 | 25 |
SUNW_BaseDir: %{_basedir} |
2146 | 26 |
BuildRoot: %{_tmppath}/%{name}-%{version}-build |
5604 | 27 |
Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 |
5950 | 28 |
Source1: http://www.python.org/ftp/python/%{p23_version}/Python-%{p23_version}.tar.bz2 |
6192 | 29 |
Patch1: Python-01-solaris-lib-dirs.diff |
6214 | 30 |
Patch2: Python-02-pycc.diff |
31 |
Patch31: Python233-01-solaris-lib-dirs.diff |
|
2146 | 32 |
|
33 |
%include default-depend.inc |
|
5518 | 34 |
BuildRequires: SUNWTk |
35 |
BuildRequires: SUNWTcl |
|
36 |
BuildRequires: SUNWlexpt |
|
37 |
BuildRequires: SUNWsfwhea |
|
38 |
Requires: SUNWopenssl-libraries |
|
39 |
Requires: SUNWTk |
|
40 |
Requires: SUNWTcl |
|
41 |
Requires: SUNWlexpt |
|
42 |
Requires: SUNWxwplt |
|
43 |
Requires: SUNWbzip |
|
6214 | 44 |
Requires: SUNWlibmsr |
45 |
Requires: SUNWlibms |
|
46 |
Requires: SUNWzlib |
|
2146 | 47 |
|
48 |
%package devel |
|
7242
19b994b053db
2006-05-10 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7124
diff
changeset
|
49 |
Summary: The Python interpreter, libraries and utilities - developer files |
2146 | 50 |
%include default-depend.inc |
51 |
Requires: SUNWPython |
|
6253 | 52 |
Requires: SUNWscpu |
2146 | 53 |
|
54 |
%prep |
|
5950 | 55 |
%setup -q -c -n %name-%version |
56 |
%setup -q -D -T -b 1 -c -n %name-%version |
|
6192 | 57 |
cd Python-%{version} |
58 |
%patch1 -p1 |
|
6214 | 59 |
%patch2 -p1 |
60 |
cd .. |
|
61 |
cd Python-%{p23_version} |
|
62 |
%patch31 -p1 |
|
2146 | 63 |
|
64 |
%build |
|
5950 | 65 |
cd Python-%{p23_version} |
3984 | 66 |
CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` |
3700 | 67 |
if test "x$CPUS" = "x" -o $CPUS = 0; then |
3984 | 68 |
CPUS=1 |
3700 | 69 |
fi |
2146 | 70 |
export CXXFLAGS="%cxx_optflags" |
5936 | 71 |
%if %cc_is_gcc |
72 |
export CFLAGS="%optflags" |
|
73 |
%else |
|
5948 | 74 |
# -xregs=no%%frameptr breaks the build of Python 2.4.1 |
75 |
export CFLAGS=`echo '%optflags' | sed -e 's/-xregs=no%%frameptr//'` |
|
5936 | 76 |
%endif |
6192 | 77 |
export OPT=$CFLAGS |
78 |
export BASECFLAGS= |
|
4576 | 79 |
export LD_RUN_PATH="/usr/sfw/lib" |
6102 | 80 |
export LDFLAGS="-z ignore" |
6192 | 81 |
export CPP="$CC -E" |
5950 | 82 |
./configure --prefix=%{p23_prefix} \ |
83 |
--libdir=%{p23_libdir} \ |
|
84 |
--mandir=%{p23_mandir} \ |
|
85 |
--datadir=%{p23_datadir} \ |
|
6214 | 86 |
--infodir=%{p23_datadir}/info \ |
87 |
--enable-shared \ |
|
88 |
--disable-static |
|
5950 | 89 |
|
90 |
make -j$CPUS |
|
6192 | 91 |
unset LD_RUN_PATH |
5950 | 92 |
|
93 |
cd ../Python-%{version} |
|
2146 | 94 |
./configure --prefix=%{_prefix} \ |
95 |
--libdir=%{_libdir} \ |
|
96 |
--mandir=%{_mandir} \ |
|
97 |
--datadir=%{_datadir} \ |
|
6214 | 98 |
--infodir=%{_datadir}/info \ |
99 |
--enable-shared \ |
|
100 |
--disable-static |
|
101 |
||
102 |
# These #define's break the build with gcc and cause problems when |
|
103 |
# building c99 compliant python modules |
|
7124
db1febd335b2
2006-04-24 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7021
diff
changeset
|
104 |
perl -pi -e 's/^(#define _POSIX_C_SOURCE.*)/\/* $1 *\//' pyconfig.h |
db1febd335b2
2006-04-24 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7021
diff
changeset
|
105 |
perl -pi -e 's/^(#define _XOPEN_SOURCE.*)/\/* $1 *\//' pyconfig.h |
db1febd335b2
2006-04-24 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7021
diff
changeset
|
106 |
perl -pi -e 's/^(#define _XOPEN_SOURCE_EXTENDED.*)/\/* $1 *\//' pyconfig.h |
5936 | 107 |
|
3700 | 108 |
make -j$CPUS |
2146 | 109 |
|
110 |
%install |
|
111 |
[ "$RPM_BUILD_ROOT" != "" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT |
|
5950 | 112 |
cd Python-%{p23_version} |
2146 | 113 |
make install DESTDIR=$RPM_BUILD_ROOT |
5950 | 114 |
|
6133 | 115 |
cd ../Python-%{version} |
116 |
make install DESTDIR=$RPM_BUILD_ROOT |
|
117 |
||
6214 | 118 |
# the pycc script is a C/C++ compiler wrapper to be used in |
119 |
# the distutils Makefile |
|
120 |
install -m 755 -D pycc $RPM_BUILD_ROOT%{_libdir}/python2.4/pycc |
|
121 |
(cd $RPM_BUILD_ROOT%{_libdir}/python2.4; ln -s pycc pyCC) |
|
122 |
perl -pi -e 's|^(CC=\s*)/.*$|$1%{_libdir}/python2.4/pycc|' \ |
|
123 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
124 |
perl -pi -e 's|^(CXX=\s*)/.*$|$1%{_libdir}/python2.4/pyCC|' \ |
|
125 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
6253 | 126 |
perl -pi -e 's|^(INSTALL=\s*)/.*$|$1install|' \ |
6214 | 127 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
128 |
perl -pi -e 's|^(OPT=\s*).*$|$1-DNDEBUG|' \ |
|
129 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
6295 | 130 |
perl -pi -e 's|^(RUNSHARED=\s*).*$|$1|' \ |
131 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
132 |
perl -pi -e "s|^(CONFIG_ARGS=\s*.*'CC=)[^']*('.*)\$|\$1%{_libdir}/python2.4/pycc\$2|" \ |
|
133 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
134 |
perl -pi -e "s|^(CONFIG_ARGS=\s*.*'CFLAGS=)[^']*('.*)\$|\$1\$2|" \ |
|
135 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
136 |
perl -pi -e "s|^(CONFIG_ARGS=\s*.*'CPP=)[^']*('.*)\$|\$1%{_libdir}/python2.4/pycc -E\$2|" \ |
|
137 |
$RPM_BUILD_ROOT%{_libdir}/python2.4/config/Makefile |
|
6214 | 138 |
|
6192 | 139 |
# search for vendor packages in /usr/lib/python<version>/vendor-packages |
140 |
echo "import site; site.addsitedir('%{_libdir}/python2.4/vendor-packages')" \ |
|
141 |
> $RPM_BUILD_ROOT%{_libdir}/python2.4/site-packages/vendor-packages.pth |
|
142 |
mkdir -p $RPM_BUILD_ROOT%{_libdir}/python2.4/vendor-packages |
|
143 |
||
5604 | 144 |
cd $RPM_BUILD_ROOT%{_bindir} && rm python && ln -s python2.4 python |
5950 | 145 |
cd $RPM_BUILD_ROOT%{p23_bindir} && rm python && ln -s ../../bin/python2.4 python |
6214 | 146 |
|
147 |
# don't ship python2.3 development bits: |
|
148 |
rm -rf $RPM_BUILD_ROOT%{p23_includedir} |
|
149 |
rm -rf $RPM_BUILD_ROOT%{p23_libdir}/python2.3/config |
|
150 |
rm -rf $RPM_BUILD_ROOT%{p23_libdir}/python2.3/distutils |
|
151 |
rm -rf $RPM_BUILD_ROOT%{p23_libdir}/python2.3/test |
|
152 |
||
153 |
# delete stuff that doesn't build on Solaris: |
|
154 |
rm -f $RPM_BUILD_ROOT%{_libdir}/python?.?/config/lib*.a |
|
155 |
rm -rf $RPM_BUILD_ROOT%{_libdir}/python?.?/curses |
|
156 |
rm -rf $RPM_BUILD_ROOT%{p23_libdir}/python2.3/curses |
|
157 |
rm -rf $RPM_BUILD_ROOT%{_libdir}/python?.?/bsddb |
|
5950 | 158 |
rm -rf $RPM_BUILD_ROOT%{p23_libdir}/python2.3/bsddb |
6214 | 159 |
rm -f $RPM_BUILD_ROOT%{_libdir}/python?.?/lib-dynload/_curses*failed.so |
160 |
rm -f $RPM_BUILD_ROOT%{p23_libdir}/python2.3/lib-dynload/_curses*failed.so |
|
5950 | 161 |
|
6214 | 162 |
echo deleting pyo files |
163 |
find $RPM_BUILD_ROOT -name '*.pyo' -exec rm {} \; |
|
164 |
||
165 |
echo fixing python binary name/path in python scripts: |
|
166 |
cat > %{_builddir}/%name-%version/is_python_script <<EOF |
|
167 |
#!/bin/sh |
|
168 |
||
169 |
head -1 \$1 | egrep -s '^#!.*python$' |
|
170 |
EOF |
|
171 |
chmod +x %{_builddir}/%name-%version/is_python_script |
|
172 |
||
173 |
cat > %{_builddir}/%name-%version/set_python_interpreter <<EOF |
|
6253 | 174 |
#!/bin/bash |
175 |
interp=\$1 |
|
176 |
fname=\$2 |
|
177 |
line1=\$(head -1 \$fname) |
|
6339 | 178 |
echo "Changing '\$line1' to '\$interp' (\$fname)"; |
179 |
chmod u+w \$fname |
|
6253 | 180 |
sed -e "1s,^#!.*,#! \$interp," \$fname > \$fname.update-interp && \ |
6339 | 181 |
cat \$fname.update-interp > \$fname && \ |
182 |
rm -f \$fname.update-interp || \ |
|
183 |
echo WARNING: set_python_interpreter failed for \$fname |
|
6214 | 184 |
EOF |
185 |
chmod +x %{_builddir}/%name-%version/set_python_interpreter |
|
186 |
||
187 |
find $RPM_BUILD_ROOT%{p23_libdir} -type f -exec %{_builddir}/%name-%version/is_python_script {} \; -exec %{_builddir}/%name-%version/set_python_interpreter %{p23_bindir}/python2.3 {} \; |
|
188 |
find $RPM_BUILD_ROOT%{_libdir} -type f -exec %{_builddir}/%name-%version/is_python_script {} \; -exec %{_builddir}/%name-%version/set_python_interpreter %{_bindir}/python2.4 {} \; |
|
2146 | 189 |
|
5859
da89f4e343b9
update package version numbers and change ELF comment from supported to
laca
parents:
5604
diff
changeset
|
190 |
%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT} |
4122 | 191 |
|
4123 | 192 |
%clean |
193 |
rm -rf $RPM_BUILD_ROOT |
|
194 |
||
2146 | 195 |
%files |
6192 | 196 |
%defattr (-, root, bin) |
5950 | 197 |
%dir %attr (0755, root, bin) %{p23_prefix} |
198 |
%dir %attr (0755, root, bin) %{p23_bindir} |
|
199 |
%{p23_bindir}/* |
|
2146 | 200 |
%dir %attr (0755, root, bin) %{_bindir} |
201 |
%{_bindir}/* |
|
202 |
%dir %attr (0755, root, bin) %{_libdir} |
|
6214 | 203 |
%{_libdir}/python?.?/LICENSE.txt |
204 |
%{_libdir}/python?.?/*.py* |
|
205 |
%{_libdir}/python?.?/*.doc |
|
206 |
%{_libdir}/python?.?/compiler |
|
207 |
%{_libdir}/python?.?/email |
|
208 |
%{_libdir}/python?.?/encodings |
|
209 |
%{_libdir}/python?.?/hotshot |
|
210 |
%{_libdir}/python?.?/idlelib |
|
211 |
%{_libdir}/python?.?/lib-dynload |
|
212 |
%{_libdir}/python?.?/lib-old |
|
213 |
%{_libdir}/python?.?/lib-tk |
|
214 |
%{_libdir}/python?.?/logging |
|
215 |
%{_libdir}/python?.?/plat-* |
|
216 |
%{_libdir}/python?.?/site-packages |
|
217 |
%{_libdir}/python?.?/vendor-packages |
|
218 |
%{_libdir}/python?.?/xml |
|
219 |
%{_libdir}/lib*.so* |
|
5950 | 220 |
%dir %attr (0755, root, bin) %{p23_libdir} |
221 |
%{p23_libdir}/* |
|
222 |
%dir %attr(0755, root, sys) %{_datadir} |
|
2146 | 223 |
%dir %attr(0755, root, bin) %{_mandir} |
224 |
%dir %attr(0755, root, bin) %{_mandir}/* |
|
225 |
%{_mandir}/*/* |
|
7242
19b994b053db
2006-05-10 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7124
diff
changeset
|
226 |
%dir %attr(0755, root, bin) %{p23_datadir} |
5950 | 227 |
%dir %attr(0755, root, bin) %{p23_mandir} |
228 |
%dir %attr(0755, root, bin) %{p23_mandir}/* |
|
229 |
%{p23_mandir}/*/* |
|
2146 | 230 |
|
231 |
%files devel |
|
6192 | 232 |
%defattr (-, root, bin) |
2146 | 233 |
%dir %attr (0755, root, bin) %{_includedir} |
234 |
%{_includedir}/* |
|
6214 | 235 |
%{_libdir}/python?.?/config |
236 |
%{_libdir}/python?.?/distutils |
|
237 |
%{_libdir}/python?.?/test |
|
238 |
%{_libdir}/python?.?/py[cC][cC] |
|
2146 | 239 |
|
240 |
%changelog |
|
7242
19b994b053db
2006-05-10 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7124
diff
changeset
|
241 |
* Tue May 09 2006 - [email protected] |
19b994b053db
2006-05-10 Laszlo (Laca) Peter <[email protected]>
lp117937
parents:
7124
diff
changeset
|
242 |
- merge -share pkg(s) into the base pkg(s) |
6214 | 243 |
* Sun Oct 30 2005 - [email protected] |
244 |
- change interpreter in python scripts to full path to the appropriate |
|
245 |
version (/usr/bin/python2.4 or /usr/sfw/bin/python2.3), fixes 6318475 |
|
246 |
- set the C/C++ compiler in the distutils Makefile to the pycc/pyCC |
|
247 |
wrapper scripts, fixes 6247860 |
|
248 |
* Fri Oct 28 2005 - [email protected] |
|
249 |
- update to 2.4.2 |
|
250 |
- build shared libpython and remove the static one, fixes 6199942 |
|
251 |
- remove XOPEN/POSIX defines from pyconfig.h: fixes 6240077 |
|
252 |
- add missing dependencies, fixes 6318436 |
|
6200 | 253 |
* Tue Sep 27 2005 - [email protected] |
254 |
- omit some unnecessary compiler flags |
|
255 |
- remove .pyo files |
|
256 |
- add a pth file to site-packages that tells python to search for modules |
|
257 |
in the vendor-packages directory too |
|
258 |
- change default permissions to root:bin. |
|
6129
743dfb7995be
* SUNWPython.spec: Add another missing runtime dependency, SUNWlibmsr,
dc144907
parents:
6102
diff
changeset
|
259 |
* Wed Oct 19 2005 - [email protected] |
743dfb7995be
* SUNWPython.spec: Add another missing runtime dependency, SUNWlibmsr,
dc144907
parents:
6102
diff
changeset
|
260 |
- Add another missing runtime dependency, SUNWlibmsr, fixes 6208617. |
6136
7409efbf1062
* SUNWPython.spec: Move Pyrex to SUNWPython-extra.spec.
dc144907
parents:
6133
diff
changeset
|
261 |
- Move Pyrex to SUNWPython-extra.spec file. |
5948 | 262 |
* Tue Sep 20 2005 - [email protected] |
5950 | 263 |
- move python 2.4.1 to /usr and keep python 2.3 in /usr/sfw for backcompat |
5948 | 264 |
- omit -xregs=no%frameptr as it breaks the build |
5604 | 265 |
* Fri Aug 26 2005 - [email protected] |
266 |
- update to 2.4.1 |
|
5518 | 267 |
* Tue Aug 02 2005 - [email protected] |
268 |
- added SUNWsfwhea build dependency needed for expat headers |
|
269 |
* Tue Aug 02 2005 - [email protected] |
|
270 |
- Add SUNWlexpt dependency as the Expat library is required for building. |
|
271 |
* Fri Jul 29 2005 - [email protected] |
|
272 |
- Add missing runtime dependencies, fixes 6208617. |
|
4568 | 273 |
* Sun Nov 14 2004 - [email protected] |
274 |
- add /usr/sfw/lib to RPATH |
|
4320 | 275 |
* Fri Oct 22 2004 - [email protected] |
276 |
- remove bsddb bits (won't work without bsd db itself), fixes 6176600 |
|
4122 | 277 |
* Sat Oct 02 2004 - [email protected] |
278 |
- added %pkgbuild_postprocess |
|
3984 | 279 |
* Sat Sep 18 2004 - [email protected] |
280 |
- move to /usr/sfw |
|
3221
a9dc1a9a5f37
Updated for changing Gnome install location to /usr/...,
woos
parents:
2621
diff
changeset
|
281 |
* Tue Jun 22 2004 - [email protected] |
a9dc1a9a5f37
Updated for changing Gnome install location to /usr/...,
woos
parents:
2621
diff
changeset
|
282 |
- changed install location to /usr/lib and /usr/bin |
2154 | 283 |
* Fri Mar 05 2005 - [email protected] |
284 |
- remove package root def'n |
|
2146 | 285 |
* Thu Mar 04 2004 - [email protected] |
286 |
- initial version added to CVS |