|
1 ## |
|
2 ## python.spec -- OpenPKG RPM Package Specification |
|
3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/> |
|
4 ## |
|
5 ## Permission to use, copy, modify, and distribute this software for |
|
6 ## any purpose with or without fee is hereby granted, provided that |
|
7 ## the above copyright notice and this permission notice appear in all |
|
8 ## copies. |
|
9 ## |
|
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
21 ## SUCH DAMAGE. |
|
22 ## |
|
23 |
|
24 # package information |
|
25 Name: python |
|
26 Summary: The Python Programming Language |
|
27 URL: http://www.python.org/ |
|
28 Vendor: Guido van Rossum |
|
29 Packager: OpenPKG Foundation e.V. |
|
30 Distribution: OpenPKG Community |
|
31 Class: BASE |
|
32 Group: Language |
|
33 License: GPL |
|
34 Version: 2.7.1 |
|
35 Release: 20110212 |
|
36 |
|
37 # package options |
|
38 %option with_readline no |
|
39 %option with_db no |
|
40 %option with_dbm no |
|
41 %option with_curses no |
|
42 %option with_zlib no |
|
43 %option with_bzip2 no |
|
44 %option with_xml no |
|
45 %option with_locale no |
|
46 %option with_ssl no |
|
47 |
|
48 # list of sources |
|
49 Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 |
|
50 Patch0: python.patch |
|
51 |
|
52 # build information |
|
53 BuildPreReq: OpenPKG, openpkg >= 20100101, gcc |
|
54 PreReq: OpenPKG, openpkg >= 20100101, gcc |
|
55 BuildPreReq: zlib |
|
56 PreReq: zlib |
|
57 %if "%{with_readline}" == "yes" |
|
58 BuildPreReq: readline |
|
59 PreReq: readline |
|
60 %endif |
|
61 %if "%{with_db}" == "yes" |
|
62 BuildPreReq: db |
|
63 PreReq: db |
|
64 %endif |
|
65 %if "%{with_dbm}" == "yes" |
|
66 BuildPreReq: gdbm::with_ndbm = yes |
|
67 PreReq: gdbm::with_ndbm = yes |
|
68 %endif |
|
69 %if "%{with_curses}" == "yes" |
|
70 BuildPreReq: ncurses |
|
71 PreReq: ncurses |
|
72 %endif |
|
73 %if "%{with_zlib}" == "yes" |
|
74 BuildPreReq: zlib |
|
75 PreReq: zlib |
|
76 %endif |
|
77 %if "%{with_bzip2}" == "yes" |
|
78 BuildPreReq: bzip2 |
|
79 PreReq: bzip2 |
|
80 %endif |
|
81 %if "%{with_xml}" == "yes" |
|
82 BuildPreReq: expat |
|
83 PreReq: expat |
|
84 %endif |
|
85 %if "%{with_locale}" == "yes" |
|
86 BuildPreReq: gettext, libiconv |
|
87 PreReq: gettext, libiconv |
|
88 %endif |
|
89 %if "%{with_ssl}" == "yes" |
|
90 BuildPreReq: openssl |
|
91 PreReq: openssl |
|
92 %endif |
|
93 |
|
94 %description |
|
95 Python is an interpreted, interactive, object-oriented programming |
|
96 language. Python combines remarkable power with very clear syntax. |
|
97 It has modules, classes, exceptions, very high level dynamic data |
|
98 types, and dynamic typing. There are interfaces to many system calls |
|
99 and libraries, as well as to various windowing systems (X11, Motif, |
|
100 Tk, Mac, MFC). New built-in modules are easily written in C or C++. |
|
101 Python is also usable as an extension language for applications that |
|
102 need a programmable interface. |
|
103 |
|
104 %track |
|
105 prog python = { |
|
106 version = %{version} |
|
107 url = http://www.python.org/download/ |
|
108 regex = Python-(2(\.\d+)+)\.tar\.bz2 |
|
109 } |
|
110 |
|
111 %prep |
|
112 %setup -q -n Python-%{version} |
|
113 %patch -p0 |
|
114 |
|
115 %build |
|
116 %{l_shtool} subst %{l_value -s -a} \ |
|
117 setup.py |
|
118 %{l_shtool} subst \ |
|
119 -e 's;altinstall bininstall maninstall;altinstall maninstall;' \ |
|
120 -e 's;python$(VERSION);python;g' \ |
|
121 Makefile.pre.in |
|
122 %{l_shtool} subst \ |
|
123 -e 's;\(lib/python"\) *VERSION;\1;g' \ |
|
124 Modules/getpath.c |
|
125 find Lib -name "*.py" -print |\ |
|
126 xargs %{l_shtool} subst -q \ |
|
127 -e 's;\+ *sys\.version\[:3\];;g' \ |
|
128 -e 's;\+ *get_python_version();;g' |
|
129 %{l_shtool} subst \ |
|
130 -e 's;python\$py_version_short;python;g' \ |
|
131 Lib/distutils/command/install.py |
|
132 %{l_shtool} subst \ |
|
133 -e 's;python{py_version_short};python;g' \ |
|
134 Lib/sysconfig.py |
|
135 %if "%{with_readline}" == "yes" |
|
136 ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap" |
|
137 ) >>Modules/Setup.local |
|
138 %endif |
|
139 %if "%{with_db}" == "yes" |
|
140 ( echo "_bsddb _bsddb.c %{l_cppflags} %{l_ldflags} -ldb" |
|
141 ) >>Modules/Setup.local |
|
142 %endif |
|
143 %if "%{with_dbm}" == "yes" |
|
144 ( echo "dbm dbmmodule.c -DHAVE_NDBM_H %{l_cppflags} %{l_ldflags} -lndbm -lgdbm" |
|
145 echo "gdbm gdbmmodule.c -DHAVE_GDBM_H %{l_cppflags} %{l_ldflags} -lgdbm" |
|
146 ) >>Modules/Setup.local |
|
147 %endif |
|
148 %if "%{with_curses}" == "yes" |
|
149 ( echo "_curses_panel _curses_panel.c %{l_cppflags} %{l_ldflags} -lpanel -lncurses" |
|
150 ) >>Modules/Setup.local |
|
151 %endif |
|
152 %if "%{with_zlib}" == "yes" |
|
153 ( echo "zlib zlibmodule.c %{l_cppflags} %{l_ldflags} -lz" |
|
154 ) >>Modules/Setup.local |
|
155 %endif |
|
156 %if "%{with_bzip2}" == "yes" |
|
157 ( echo "bz2 bz2module.c %{l_cppflags} %{l_ldflags} -lbz2" |
|
158 ) >>Modules/Setup.local |
|
159 %endif |
|
160 %if "%{with_xml}" == "yes" |
|
161 ( echo "EXPAT_DIR=%{l_prefix}" |
|
162 echo "pyexpat pyexpat.c -DHAVE_EXPAT_H %{l_cppflags} %{l_ldflags} -lexpat" |
|
163 ) >>Modules/Setup.local |
|
164 %endif |
|
165 %if "%{with_locale}" == "yes" |
|
166 ( echo "_locale _localemodule.c %{l_cppflags} %{l_ldflags} -lintl -liconv" |
|
167 ) >>Modules/Setup.local |
|
168 %endif |
|
169 %if "%{with_ssl}" == "yes" |
|
170 ( echo "_socket socketmodule.c" |
|
171 echo "SSL=%{l_prefix}" |
|
172 echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" |
|
173 ) >>Modules/Setup.local |
|
174 %endif |
|
175 |
|
176 CC="%{l_prefix}/bin/gcc" \ |
|
177 CXX="%{l_cxx}" \ |
|
178 CFLAGS="%{l_cflags -O}" \ |
|
179 OPT="%{l_cflags -O}" \ |
|
180 CXXFLAGS="%{l_cxxflags -O}" \ |
|
181 LDFLAGS="%{l_ldflags}" \ |
|
182 ./configure \ |
|
183 --prefix=%{l_prefix} \ |
|
184 --mandir=%{l_prefix}/man \ |
|
185 --with-dbmliborder=ndbm \ |
|
186 --with-gcc |
|
187 %{l_make} %{l_mflags} |
|
188 |
|
189 %install |
|
190 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
|
191 ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \ |
|
192 $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a |
|
193 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py |
|
194 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle |
|
195 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python/test |
|
196 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
197 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
|
198 |
|
199 %files -f files |
|
200 |
|
201 %clean |
|
202 |