1 |
argiro |
1.1 |
### RPM external python 2.4.2
|
2 |
|
|
# OS X patches and build fudging stolen from fink
|
3 |
|
|
Requires: zlib expat openssl
|
4 |
|
|
# FIXME: readline, ncurses, crypt, various [ng]dbm, db-*, db[1-3],
|
5 |
|
|
# FIXME: gmp, panel, tk/tcl, x11
|
6 |
|
|
|
7 |
|
|
Source0: http://www.python.org/ftp/%n/%v/Python-%v.tgz
|
8 |
|
|
Patch0: python-osx
|
9 |
|
|
|
10 |
|
|
%prep
|
11 |
|
|
%setup -n Python-%v
|
12 |
|
|
%ifos darwin
|
13 |
|
|
sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
|
14 |
|
|
%endif
|
15 |
|
|
|
16 |
|
|
%build
|
17 |
|
|
# Python is awkward about passing other include or library directories
|
18 |
|
|
# to it. Basically there is no way to pass anything from configure to
|
19 |
|
|
# make, or down to python itself. To get python detect the extensions
|
20 |
|
|
# we want to enable, we simply have to link the contents into python's
|
21 |
|
|
# own include/lib directories. Ugh.
|
22 |
|
|
#
|
23 |
|
|
# NB: It would sort-of make sense to link more stuff from /sw on OS X,
|
24 |
|
|
# but we simply cannot link the whole world. If you need something,
|
25 |
|
|
# see above for the commented-out list of packages that could be
|
26 |
|
|
# linked specifically, or could be built by ourselves, depending on
|
27 |
|
|
# whether we like to pick up system libraries or want total control.
|
28 |
|
|
mkdir -p %i/include %i/lib
|
29 |
|
|
dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT"
|
30 |
|
|
for d in $dirs; do
|
31 |
|
|
for f in $d/include/*; do
|
32 |
|
|
[ -f $f ] || continue
|
33 |
|
|
rm -f %i/include/$(basename $f)
|
34 |
|
|
ln -s $f %i/include
|
35 |
|
|
done
|
36 |
|
|
for f in $d/lib/*; do
|
37 |
|
|
[ -f $f ] || continue
|
38 |
|
|
rm -f %i/lib/$(basename $f)
|
39 |
|
|
ln -s $f %i/lib
|
40 |
|
|
done
|
41 |
|
|
done
|
42 |
|
|
|
43 |
|
|
./configure --prefix=%i
|
44 |
|
|
make
|
45 |
|
|
|
46 |
|
|
%install
|
47 |
|
|
make install
|
48 |
|
|
if [ $(uname) = Darwin ]; then
|
49 |
|
|
# make install prefix=%i
|
50 |
|
|
# (cd Misc; /bin/rm -rf RPM)
|
51 |
|
|
# mkdir -p %i/share/doc/%n
|
52 |
|
|
# cp -R Demo Doc %i/share/doc/%n
|
53 |
|
|
# cp -R Misc Tools %i/lib/python2.3
|
54 |
|
|
cc -dynamiclib -all_load -single_module \
|
55 |
|
|
-framework System -framework CoreServices -framework Foundation \
|
56 |
|
|
%i/lib/python2.3/config/libpython2.3.a \
|
57 |
|
|
-o %i/lib/python2.3/config/libpython2.3.dylib \
|
58 |
|
|
-install_name %i/lib/python2.3/config/libpython2.3.dylib \
|
59 |
|
|
-current_version 2.3 -compatibility_version 2.3 -ldl
|
60 |
|
|
ln -s libpython2.3.dylib %i/lib/python2.3/config/libpython23.dylib # for boost
|
61 |
|
|
# (cd %i/lib/python2.3/config; mv Makefile Makefile.orig;
|
62 |
|
|
# sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
|
63 |
|
|
fi
|