ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.91
Committed: Mon Aug 20 13:30:52 2012 UTC (12 years, 8 months ago) by dsr
Branch: MAIN
CVS Tags: bld_1366393047_das_slc5_amd64_gcc461, bld_1366387004_das_slc5_amd64_gcc461, bld_1366383107_das_slc5_amd64_gcc461, bld_1366320846_das_slc5_amd64_gcc461, bld_1366318481_das_slc5_amd64_gcc461, bld_1366310647_das_slc5_amd64_gcc461, bld_1366297091_das_slc5_amd64_gcc461, bld_1366294257_wmagent-dev_slc5_amd64_gcc461, bld_1366231053_das_slc5_amd64_gcc461, bld_1366227545_das_slc5_amd64_gcc461, bld_1366220453_wmagent-dev_slc5_amd64_gcc461, bld_1366217887_das_slc5_amd64_gcc461, bld_1366212554_das_slc5_amd64_gcc461, bld_1366142291_das_slc5_amd64_gcc461, bld_1366137469_das_slc5_amd64_gcc461, bld_1366136287_das_slc5_amd64_gcc461, bld_1366133845_das_slc5_amd64_gcc461, bld_1366130037_das_slc5_amd64_gcc461, bld_1365873495_das_slc5_amd64_gcc461, bld_1365864253_das_slc5_amd64_gcc461, bld_1365813474_das_slc5_amd64_gcc461, bld_1365801108_wmagent-dev_slc5_amd64_gcc461, bld_1365798254_das_slc5_amd64_gcc461, bld_1365756543_cmsweb_slc5_amd64_gcc461, bld_1365755645_cmsweb_slc5_amd64_gcc461, bld_1365754910_das_slc5_amd64_gcc461, HG1304e, bld_1365639925_das_slc5_amd64_gcc461, bld_1365189699_wmagent-dev_slc5_amd64_gcc461, bld_1365145423_cmsweb_slc5_amd64_gcc461, bld_1365144485_cmsweb_slc5_amd64_gcc461, HG1304d, bld_1365103387_wmagent-dev_osx106_amd64_gcc461, bld_1365103080_wmagent-dev_slc5_amd64_gcc461, bld_1365093891_cmsweb_slc5_amd64_gcc461, bld_1365092930_cmsweb_slc5_amd64_gcc461, HG1304c, bld_1365018384_wmagent-dev_slc5_amd64_gcc461, bld_1365016270_reqmon_slc5_amd64_gcc461, bld_1364985624_wmagent-dev_slc5_amd64_gcc461, bld_1364978618_wmagent-dev_slc5_amd64_gcc461, bld_1364915341_reqmgr_slc5_amd64_gcc461, bld_1364898638_wmagent-dev_slc5_amd64_gcc461, bld_1364871746_workqueue_slc5_amd64_gcc461, bld_1364871746_reqmon_slc5_amd64_gcc461, bld_1364855420_wmagent-dev_slc5_amd64_gcc461, bld_1364477498_cmsweb_slc6_amd64_gcc461, bld_1364476037_cmsweb_slc5_amd64_gcc461, HG1304b, bld_1363878515_cmsfomon_slc5_amd64_gcc461, bld_1363813148_das_slc5_amd64_gcc461, bld_1363704737_wmagent-dev_slc5_amd64_gcc461, bld_1363641809_das_slc5_amd64_gcc461, bld_1363625610_cmsweb_slc6_amd64_gcc461, bld_1363624908_wmagent-dev_osx106_amd64_gcc461, bld_1363624533_cmsweb_slc5_amd64_gcc461, HG1304a, bld_1363270485_cmsweb_slc5_amd64_gcc461, bld_1363269753_cmsweb_slc6_amd64_gcc461, bld_1363269703_cmsweb_slc5_amd64_gcc461, HG1303g, bld_1363186195_das_slc5_amd64_gcc461, HG1304a-rc2, HG1304a-rc, bld_1363027772_wmagent-dev_slc5_amd64_gcc461, bld_1362998090_cmsweb_slc5_amd64_gcc461, bld_1362996978_cmsweb_slc5_amd64_gcc461, bld_1362996936_cmsweb_slc6_amd64_gcc461, HG1303f, bld_1362587917_t0_slc5_amd64_gcc461, bld_1362587831_cmsweb_slc5_amd64_gcc461, bld_1362587049_cmsweb_slc6_amd64_gcc461, bld_1362586958_cmsweb_slc5_amd64_gcc461, HG1303e, bld_1362581633_cmsfomon_slc5_amd64_gcc461, bld_1362435765_wmagent-dev_slc5_amd64_gcc461, bld_1362396410_cmsfomon_slc5_amd64_gcc461, bld_1362396027_cmsweb_slc5_amd64_gcc461, bld_1362395773_cmsweb_slc6_amd64_gcc461, bld_1362395102_cmsweb_slc5_amd64_gcc461, bld_1362394999_cmsweb_slc6_amd64_gcc461, HG1303d, bld_1362152615_cmsweb_slc6_amd64_gcc461, bld_1362145756_cmsweb_slc5_amd64_gcc461, bld_1362144996_cmsweb_slc6_amd64_gcc461, bld_1362144848_cmsweb_slc5_amd64_gcc461, HG1303c, bld_1362086646_wmagent-dev_slc5_amd64_gcc461, bld_1362086247_reqmgr_slc5_amd64_gcc461, bld_1362086050_reqmon_slc5_amd64_gcc461, bld_1362084017_reqmgr_slc5_amd64_gcc461, bld_1362083830_reqmon_slc5_amd64_gcc461, bld_1362083383_wmagent-dev_slc5_amd64_gcc461, bld_1362024059_reqmon_slc5_amd64_gcc461, bld_1362024059_reqmgr_slc5_amd64_gcc461, bld_1362004165_wmagent-dev_slc5_amd64_gcc461, TW20130226a, bld_1361806174_wmagent-dev_slc5_amd64_gcc461, bld_1361804419_das_slc5_amd64_gcc461, bld_1361717845_cmsweb_slc6_amd64_gcc461, bld_1361549332_cmsweb_slc5_amd64_gcc461, bld_1361547565_cmsweb_slc6_amd64_gcc461, bld_1361547434_cmsweb_slc5_amd64_gcc461, HG1303b, bld_1361397493_wmagent-dev_slc5_amd64_gcc461, bld_1361396969_reqmon_slc5_amd64_gcc461, bld_1361371766_wmagent-dev_slc5_amd64_gcc461, bld_1361357725_dbs3-combined_slc5_amd64_gcc461, bld_1361302144_wmagent-dev_slc5_amd64_gcc461, bld_1361299482_das_slc5_amd64_gcc461, TW20130219c, bld_1361287535_das_slc5_amd64_gcc461, TW20130219a, bld_1361214804_filemover_slc5_amd64_gcc461, bld_1361213027_filemover_slc5_amd64_gcc461, bld_1361206184_das_slc5_amd64_gcc461, bld_1361127238_das_slc5_amd64_gcc461, bld_1361126134_cmsweb_slc6_amd64_gcc461, bld_1361059173_das_slc5_amd64_gcc461, bld_1360871999_das_slc5_amd64_gcc461, TW20130214a, TW20120214a, TW20130213a, bld_1360761050_cmsweb_slc6_amd64_gcc461, bld_1360754590_cmsweb_slc5_amd64_gcc461, HG1303a, bld_1360703803_das_slc5_amd64_gcc461, bld_1360687341_das_slc5_amd64_gcc461, bld_1360615563_reqmon_slc5_amd64_gcc461, bld_1360609706_das_slc5_amd64_gcc461, bld_1360363549_das_slc5_amd64_gcc461, bld_1360363450_couchskel_slc5_amd64_gcc461, bld_1360360484_das_slc5_amd64_gcc461, bld_1360063178_wmagent-dev_slc5_amd64_gcc461, bld_1359544500_cmsweb_slc5_amd64_gcc461, bld_1359543827_cmsweb_slc5_amd64_gcc461, HG1302c, bld_1359499778_reqmgr_slc5_amd64_gcc461, bld_1359499619_t0_reqmon_slc5_amd64_gcc461, bld_1359499209_wmagent-dev_slc5_amd64_gcc461, bld_1359365022_wmagent-dev_osx106_amd64_gcc461, bld_1359155636_workqueue_slc5_amd64_gcc461, bld_1359155118_workqueue_slc5_amd64_gcc461, bld_1359153985_reqmgr_slc5_amd64_gcc461, bld_1359151331_reqmon_slc5_amd64_gcc461, bld_1359151331_workqueue_slc5_amd64_gcc461, bld_1359151315_t0_reqmon_slc5_amd64_gcc461, bld_1359150370_wmagent-dev_slc5_amd64_gcc461, bld_1359148765_wmagent-dev_slc5_amd64_gcc461, bld_1359023285_cmsweb_slc5_amd64_gcc461, bld_1359021253_cmsweb_slc5_amd64_gcc461, HG1302b, bld_1358971407_t0_reqmon_slc5_amd64_gcc461, bld_1358958881_das_slc5_amd64_gcc461, bld_1358954381_wmagent-dev_slc5_amd64_gcc461, bld_1358742470_t0wmstats_slc5_amd64_gcc461, bld_1355848536_PHEDEX-combined-agents_slc5_amd64_gcc461, bld_1355846563_PHEDEX-combined-agents_slc5_amd64_gcc461, HG1302a, HG1212d, HG1212c, HG1212b, TW20121226a, HG1212a, bld_1352811218_cmsfomon_slc5_amd64_gcc461, HG1211g, bld_1351773793_cmsweb_osx106_amd64_gcc461, bld_1351772993_cmsweb_osx106_amd64_gcc461, HG1211f, HG1211e, TW20121024a, HG1211d, HG1211c, TW20121015a, bld_1350043664_T0DataSvc_slc5_amd64_gcc461, HG1211b, HG1211a, HG1210f, HG1210e, HG1210d, HG1211diego, HG1210c, HG1210b, TW20120914a, TW20120913b, TW20120913a, TW20120829b, TW20120829a, HG1210a
Changes since 1.90: +14 -50 lines
Log Message:
add SSL donotfragment patch for python 2.6.8 (for DMWM)

File Contents

# User Rev Content
1 dsr 1.91 ### RPM external python 2.6.8
2 eulisse 1.3 ## INITENV +PATH PATH %i/bin
3     ## INITENV +PATH LD_LIBRARY_PATH %i/lib
4 lat 1.73 ## INITENV SETV PYTHON_LIB_SITE_PACKAGES lib/python%{python_major_version}/site-packages
5 diego 1.85 ## INITENV SETV PYTHONHASHSEED random
6 argiro 1.1 # OS X patches and build fudging stolen from fink
7 lat 1.73 %{expand:%%define python_major_version %(echo %realversion | cut -d. -f1,2)}
8     %define online %(case %cmsplatf in (*onl_*_*) echo true;; (*) echo false;; esac)
9 dsr 1.62
10 ratnik 1.34 Requires: expat bz2lib db4 gdbm
11    
12 elmer 1.55 %if "%online" != "true"
13 dsr 1.62 Requires: zlib openssl sqlite
14 ratnik 1.34 %endif
15    
16 eulisse 1.8 # FIXME: readline, crypt
17 argiro 1.1 # FIXME: gmp, panel, tk/tcl, x11
18    
19 dsr 1.62 Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
20 dsr 1.91 Patch0: python-dont-detect-dbm
21 diego 1.85 Patch1: python-fix-macosx-relocation
22 dsr 1.91 Patch2: python-2.6.8-ssl-fragment
23 steen 1.19
24 argiro 1.1 %prep
25 dsr 1.62 %setup -n Python-%realversion
26 lat 1.74 find . -type f | while read f; do
27     if head -n1 $f | grep -q /usr/local; then
28     perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" $f
29     else :; fi
30     done
31 dsr 1.91 %patch0 -p0
32 diego 1.85 %patch1 -p0
33 davidlt 1.88 %patch2 -p1
34    
35 argiro 1.1 %build
36 dsr 1.91
37 argiro 1.1 # Python is awkward about passing other include or library directories
38     # to it. Basically there is no way to pass anything from configure to
39     # make, or down to python itself. To get python detect the extensions
40     # we want to enable, we simply have to link the contents into python's
41     # own include/lib directories. Ugh.
42     #
43     # NB: It would sort-of make sense to link more stuff from /sw on OS X,
44     # but we simply cannot link the whole world. If you need something,
45     # see above for the commented-out list of packages that could be
46     # linked specifically, or could be built by ourselves, depending on
47     # whether we like to pick up system libraries or want total control.
48 dsr 1.62 #mkdir -p %i/include %i/lib
49     mkdir -p %i/include %i/lib %i/bin
50 ratnik 1.34
51 elmer 1.55 %if "%online" != "true"
52 dsr 1.62 %define extradirs $ZLIB_ROOT $OPENSSL_ROOT $SQLITE_ROOT
53 ratnik 1.34 %else
54     %define extradirs %{nil}
55     %endif
56    
57     dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}"
58    
59 eulisse 1.70 # We need to export it because setup.py now uses it to determine the actual
60     # location of DB4, this was needed to avoid having it picked up from the system.
61     export DB4_ROOT
62    
63 davidlt 1.83 # Python's configure parses LDFLAGS and CPPFLAGS to look for aditional library and include directories
64 eulisse 1.16 echo $dirs
65 davidlt 1.83 LDFLAGS=""
66     CPPFLAGS=""
67 argiro 1.1 for d in $dirs; do
68 davidlt 1.83 LDFLAGS="$LDFLAGS -L $d/lib"
69     CPPFLAGS="$CPPFLAGS -I $d/include"
70 argiro 1.1 done
71 davidlt 1.83 export LDFLAGS
72     export CPPFLAGS
73 argiro 1.1
74 eulisse 1.39 additionalConfigureOptions=""
75     case %cmsplatf in
76     osx105* )
77     additionalConfigureOptions="--disable-readline"
78     ;;
79     esac
80    
81 dsr 1.91 ./configure --prefix=%i $additionalConfigureOptions --enable-shared \
82     --without-tkinter --disable-tkinter
83 davidlt 1.86
84 ratnik 1.38 make %makeprocesses
85 ratnik 1.37
86 argiro 1.1 %install
87 eulisse 1.71 # We need to export it because setup.py now uses it to determine the actual
88     # location of DB4, this was needed to avoid having it picked up from the system.
89     export DB4_ROOT
90 fwyzard 1.81 make install
91 dsr 1.62 %define pythonv %(echo %realversion | cut -d. -f 1,2)
92 eulisse 1.8
93 dsr 1.62 case %cmsplatf in
94     osx*)
95     make install prefix=%i
96     (cd Misc; /bin/rm -rf RPM)
97     mkdir -p %i/share/doc/%n
98     cp -R Demo Doc %i/share/doc/%n
99     cp -R Misc Tools %i/lib/python%{pythonv}
100     gcc -dynamiclib -all_load -single_module \
101     -framework System -framework CoreServices -framework Foundation \
102     %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
103     -undefined dynamic_lookup \
104     -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
105     -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
106     -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
107     (cd %i/lib/python%{pythonv}/config
108     perl -p -i -e 's|-fno-common||g' Makefile)
109    
110     find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv -f {} %i/lib \;
111     ;;
112     esac
113 eulisse 1.9
114 diego 1.85 perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
115     %{i}/bin/pydoc \
116     %{i}/bin/python-config \
117     %{i}/bin/2to3 \
118 dsr 1.91 %{i}/bin/python2.6-config \
119     %{i}/bin/smtpd.py \
120     %{i}/lib/python2.6/bsddb/dbshelve.py \
121     %{i}/lib/python2.6/test/test_bz2.py \
122     %{i}/lib/python2.6/test/test_largefile.py \
123     %{i}/lib/python2.6/test/test_optparse.py
124 eulisse 1.67
125     find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*' -exec rm {} \;
126     find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*' -exec rm {} \;
127 muzaffar 1.28
128 lat 1.74 # remove executable permission anything which is *.py script,
129     # is executable, but does not start with she-bang so not valid
130     # executable; this avoids problems with rpm 4.8+ find-requires
131     find %i -name '*.py' -perm +0111 | while read f; do
132     if head -n1 $f | grep -q '"'; then chmod -x $f; else :; fi
133     done
134    
135 valya 1.48 # remove tkinter that brings dependency on libtk:
136 elmer 1.58 find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \;
137 valya 1.48
138 eulisse 1.77 # Remove documentation, examples and test files.
139 diego 1.85 %define drop_files { %i/share %{i}/lib/python%{pythonv}/test \
140     %{i}/lib/python%{pythonv}/distutils/tests \
141     %{i}/lib/python%{pythonv}/json/tests \
142     %{i}/lib/python%{pythonv}/ctypes/test \
143     %{i}/lib/python%{pythonv}/sqlite3/test \
144     %{i}/lib/python%{pythonv}/bsddb/test \
145     %{i}/lib/python%{pythonv}/email/test \
146     %{i}/lib/python%{pythonv}/lib2to3/tests }
147 diego 1.75
148     # Remove .pyo files
149     find %i -name '*.pyo' -exec rm {} \;
150    
151 lat 1.68 # Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment.
152 diego 1.63 mkdir -p %i/etc/profile.d
153 lat 1.68 : > %i/etc/profile.d/dependencies-setup.sh
154     : > %i/etc/profile.d/dependencies-setup.csh
155     for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do
156     root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root
157     if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then
158     echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
159     echo "test X\$$root != X || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
160     fi
161 diego 1.63 done
162    
163 eulisse 1.16 %post
164 dsr 1.91 %{relocateConfig}lib/python2.6/config/Makefile
165 lat 1.68 %{relocateConfig}etc/profile.d/dependencies-setup.*sh