python/python.spec

changeset 524
241043c7d657
parent 370
6475ac4895a9
child 654
9da33cc654ba
equal deleted inserted replaced
1:34d5b76e6a15 2:b907d65e53d3
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.
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.2 34 Version: 2.7.3
35 Release: 20110914 35 Release: 20120800
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 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
113 } 109 }
114 110
115 %prep 111 %prep
116 %setup -q -n Python-%{version} 112 %setup -q -n Python-%{version}
117 %patch -p0 113 %patch -p0
118 %{l_shtool} subst \ 114
119 -e 's;\(LDSHARED=.*\)\$(CC);\1\\$(CC);g' \ 115 %build
120 -e 's;\(LDCXXSHARED=.*\)\$(CXX);\1\\$(CXX);g' \ 116 %{l_shtool} subst %{l_value -s -a} \
121 configure 117 setup.py
122 %{l_shtool} subst \ 118 %{l_shtool} subst \
123 -e 's;altinstall bininstall maninstall;altinstall maninstall;' \ 119 -e 's;altinstall bininstall maninstall;altinstall maninstall;' \
124 -e 's;python$(VERSION);python;g' \ 120 -e 's;python$(VERSION);python;g' \
125 Makefile.pre.in 121 Makefile.pre.in
126 %{l_shtool} subst \ 122 %{l_shtool} subst \
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
214 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 197 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
215 198
216 %files -f files 199 %files -f files
217 200
218 %clean 201 %clean
219 rm -rf $RPM_BUILD_ROOT 202
220

mercurial