| 1 ## |
1 ## |
| 2 ## python.spec -- OpenPKG RPM Package Specification |
2 ## python.spec -- OpenPKG RPM Package Specification |
| 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/> |
3 ## Copyright (c) 2000-2012 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. |
| 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 Prefix: %{l_prefix} |
53 BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make |
| 54 BuildRoot: %{l_buildroot} |
54 PreReq: OpenPKG, openpkg >= 20100101, gcc |
| 55 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc |
|
| 56 PreReq: OpenPKG, openpkg >= 20060823, gcc |
|
| 57 BuildPreReq: zlib |
55 BuildPreReq: zlib |
| 58 PreReq: zlib |
56 PreReq: zlib |
| 59 %if "%{with_readline}" == "yes" |
57 %if "%{with_readline}" == "yes" |
| 60 BuildPreReq: readline |
58 BuildPreReq: readline |
| 61 PreReq: readline |
59 PreReq: readline |
| 90 %endif |
88 %endif |
| 91 %if "%{with_ssl}" == "yes" |
89 %if "%{with_ssl}" == "yes" |
| 92 BuildPreReq: openssl |
90 BuildPreReq: openssl |
| 93 PreReq: openssl |
91 PreReq: openssl |
| 94 %endif |
92 %endif |
| 95 AutoReq: no |
|
| 96 AutoReqProv: no |
|
| 97 |
93 |
| 98 %description |
94 %description |
| 99 Python is an interpreted, interactive, object-oriented programming |
95 Python is an interpreted, interactive, object-oriented programming |
| 100 language. Python combines remarkable power with very clear syntax. |
96 language. Python combines remarkable power with very clear syntax. |
| 101 It has modules, classes, exceptions, very high level dynamic data |
97 It has modules, classes, exceptions, very high level dynamic data |
| 134 -e 's;python\$py_version_short;python;g' \ |
130 -e 's;python\$py_version_short;python;g' \ |
| 135 Lib/distutils/command/install.py |
131 Lib/distutils/command/install.py |
| 136 %{l_shtool} subst \ |
132 %{l_shtool} subst \ |
| 137 -e 's;python{py_version_short};python;g' \ |
133 -e 's;python{py_version_short};python;g' \ |
| 138 Lib/sysconfig.py |
134 Lib/sysconfig.py |
| 139 |
|
| 140 %build |
|
| 141 echo "" >config.cache |
|
| 142 %if "%{with_readline}" == "yes" |
135 %if "%{with_readline}" == "yes" |
| 143 ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap" |
136 ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap" |
| 144 ) >>Modules/Setup.local |
137 ) >>Modules/Setup.local |
| 145 %endif |
138 %endif |
| 146 %if "%{with_db}" == "yes" |
139 %if "%{with_db}" == "yes" |
| 177 ( echo "_socket socketmodule.c" |
170 ( echo "_socket socketmodule.c" |
| 178 echo "SSL=%{l_prefix}" |
171 echo "SSL=%{l_prefix}" |
| 179 echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" |
172 echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" |
| 180 ) >>Modules/Setup.local |
173 ) >>Modules/Setup.local |
| 181 %endif |
174 %endif |
| 182 |
|
| 183 # getaddrinfo bug |
|
| 184 disableipv6="" |
|
| 185 case "%{l_platform -t}" in |
|
| 186 *-aix* ) disableipv6="--disable-ipv6" ;; |
|
| 187 esac |
|
| 188 |
175 |
| 189 CC="%{l_prefix}/bin/gcc" \ |
176 CC="%{l_prefix}/bin/gcc" \ |
| 190 CXX="%{l_cxx}" \ |
177 CXX="%{l_cxx}" \ |
| 191 CFLAGS="%{l_cflags -O}" \ |
178 CFLAGS="%{l_cflags -O}" \ |
| 192 OPT="%{l_cflags -O}" \ |
179 OPT="%{l_cflags -O}" \ |
| 193 CXXFLAGS="%{l_cxxflags -O}" \ |
180 CXXFLAGS="%{l_cxxflags -O}" \ |
| 194 LDFLAGS="%{l_ldflags}" \ |
181 LDFLAGS="%{l_ldflags}" \ |
| 195 ./configure \ |
182 ./configure \ |
| 196 --cache-file=./config.cache \ |
|
| 197 --with-gcc \ |
|
| 198 $disableipv6 \ |
|
| 199 --prefix=%{l_prefix} \ |
183 --prefix=%{l_prefix} \ |
| 200 --mandir=%{l_prefix}/man \ |
184 --mandir=%{l_prefix}/man \ |
| 201 --with-dbmliborder=ndbm \ |
185 --with-dbmliborder=ndbm \ |
| 202 --with-gcc |
186 --with-gcc |
| 203 %{l_make} %{l_mflags -O} |
187 %{l_make} %{l_mflags -O} |
| 204 |
188 |
| 205 %install |
189 %install |
| 206 rm -rf $RPM_BUILD_ROOT |
|
| 207 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
190 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
| 208 ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \ |
191 ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \ |
| 209 $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a |
192 $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a |
| 210 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py |
193 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py |
| 211 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle |
194 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle |