python/python.spec

changeset 467
e2558d4b246c
parent 369
3429ba7ff8dc
child 524
241043c7d657
equal deleted inserted replaced
0:478e232b5ad7 1:34d5b76e6a15
1 ## 1 ##
2 ## python.spec -- OpenPKG RPM Package Specification 2 ## python.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/> 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ## 4 ##
5 ## Permission to use, copy, modify, and distribute this software for 5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that 6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all 7 ## the above copyright notice and this permission notice appear in all
8 ## copies. 8 ## copies.
29 Packager: OpenPKG Foundation e.V. 29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community 30 Distribution: OpenPKG Community
31 Class: BASE 31 Class: BASE
32 Group: Language 32 Group: Language
33 License: GPL 33 License: GPL
34 Version: 2.7.1 34 Version: 2.7.2
35 Release: 20110212 35 Release: 20110914
36 36
37 # package options 37 # package options
38 %option with_readline no 38 %option with_readline no
39 %option with_db no 39 %option with_db no
40 %option with_dbm no 40 %option with_dbm no
48 # list of sources 48 # list of sources
49 Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 49 Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
50 Patch0: python.patch 50 Patch0: python.patch
51 51
52 # build information 52 # build information
53 BuildPreReq: OpenPKG, openpkg >= 20100101, gcc 53 Prefix: %{l_prefix}
54 PreReq: OpenPKG, openpkg >= 20100101, gcc 54 BuildRoot: %{l_buildroot}
55 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc
56 PreReq: OpenPKG, openpkg >= 20060823, gcc
55 BuildPreReq: zlib 57 BuildPreReq: zlib
56 PreReq: zlib 58 PreReq: zlib
57 %if "%{with_readline}" == "yes" 59 %if "%{with_readline}" == "yes"
58 BuildPreReq: readline 60 BuildPreReq: readline
59 PreReq: readline 61 PreReq: readline
88 %endif 90 %endif
89 %if "%{with_ssl}" == "yes" 91 %if "%{with_ssl}" == "yes"
90 BuildPreReq: openssl 92 BuildPreReq: openssl
91 PreReq: openssl 93 PreReq: openssl
92 %endif 94 %endif
95 AutoReq: no
96 AutoReqProv: no
93 97
94 %description 98 %description
95 Python is an interpreted, interactive, object-oriented programming 99 Python is an interpreted, interactive, object-oriented programming
96 language. Python combines remarkable power with very clear syntax. 100 language. Python combines remarkable power with very clear syntax.
97 It has modules, classes, exceptions, very high level dynamic data 101 It has modules, classes, exceptions, very high level dynamic data
109 } 113 }
110 114
111 %prep 115 %prep
112 %setup -q -n Python-%{version} 116 %setup -q -n Python-%{version}
113 %patch -p0 117 %patch -p0
114 118 %{l_shtool} subst \
115 %build 119 -e 's;\(LDSHARED=.*\)\$(CC);\1\\$(CC);g' \
116 %{l_shtool} subst %{l_value -s -a} \ 120 -e 's;\(LDCXXSHARED=.*\)\$(CXX);\1\\$(CXX);g' \
117 setup.py 121 configure
118 %{l_shtool} subst \ 122 %{l_shtool} subst \
119 -e 's;altinstall bininstall maninstall;altinstall maninstall;' \ 123 -e 's;altinstall bininstall maninstall;altinstall maninstall;' \
120 -e 's;python$(VERSION);python;g' \ 124 -e 's;python$(VERSION);python;g' \
121 Makefile.pre.in 125 Makefile.pre.in
122 %{l_shtool} subst \ 126 %{l_shtool} subst \
130 -e 's;python\$py_version_short;python;g' \ 134 -e 's;python\$py_version_short;python;g' \
131 Lib/distutils/command/install.py 135 Lib/distutils/command/install.py
132 %{l_shtool} subst \ 136 %{l_shtool} subst \
133 -e 's;python{py_version_short};python;g' \ 137 -e 's;python{py_version_short};python;g' \
134 Lib/sysconfig.py 138 Lib/sysconfig.py
139
140 %build
141 echo "" >config.cache
135 %if "%{with_readline}" == "yes" 142 %if "%{with_readline}" == "yes"
136 ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap" 143 ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap"
137 ) >>Modules/Setup.local 144 ) >>Modules/Setup.local
138 %endif 145 %endif
139 %if "%{with_db}" == "yes" 146 %if "%{with_db}" == "yes"
170 ( echo "_socket socketmodule.c" 177 ( echo "_socket socketmodule.c"
171 echo "SSL=%{l_prefix}" 178 echo "SSL=%{l_prefix}"
172 echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" 179 echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto"
173 ) >>Modules/Setup.local 180 ) >>Modules/Setup.local
174 %endif 181 %endif
182
183 # getaddrinfo bug
184 disableipv6=""
185 case "%{l_platform -t}" in
186 *-aix* ) disableipv6="--disable-ipv6" ;;
187 esac
175 188
176 CC="%{l_prefix}/bin/gcc" \ 189 CC="%{l_prefix}/bin/gcc" \
177 CXX="%{l_cxx}" \ 190 CXX="%{l_cxx}" \
178 CFLAGS="%{l_cflags -O}" \ 191 CFLAGS="%{l_cflags -O}" \
179 OPT="%{l_cflags -O}" \ 192 OPT="%{l_cflags -O}" \
180 CXXFLAGS="%{l_cxxflags -O}" \ 193 CXXFLAGS="%{l_cxxflags -O}" \
181 LDFLAGS="%{l_ldflags}" \ 194 LDFLAGS="%{l_ldflags}" \
182 ./configure \ 195 ./configure \
196 --cache-file=./config.cache \
197 --with-gcc \
198 $disableipv6 \
183 --prefix=%{l_prefix} \ 199 --prefix=%{l_prefix} \
184 --mandir=%{l_prefix}/man \ 200 --mandir=%{l_prefix}/man \
185 --with-dbmliborder=ndbm \ 201 --with-dbmliborder=ndbm \
186 --with-gcc 202 --with-gcc
187 %{l_make} %{l_mflags} 203 %{l_make} %{l_mflags -O}
188 204
189 %install 205 %install
206 rm -rf $RPM_BUILD_ROOT
190 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 207 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
191 ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \ 208 ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \
192 $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a 209 $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a
193 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py 210 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py
194 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle 211 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle
197 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 214 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
198 215
199 %files -f files 216 %files -f files
200 217
201 %clean 218 %clean
202 219 rm -rf $RPM_BUILD_ROOT
220

mercurial