1 | # if you wanna test, add " --define '_run_test 1' " option to rpmbuild command |
---|
2 | %define run_test %{?_run_test:1}%{!?_run_test:0} |
---|
3 | %define libvers 3.2 |
---|
4 | %define binsuffix 3.2 |
---|
5 | %define python_lib %{_libdir}/python%{libvers} |
---|
6 | %define config_htmldir /var/www/html/python |
---|
7 | Summary: An interpreted, interactive, object-oriented programming language. |
---|
8 | Summary(ja): オブジェクト指向 Python3 インタプリタ |
---|
9 | Name: python3 |
---|
10 | Version: 3.2 |
---|
11 | Release: 1%{?_dist_release} |
---|
12 | License: PSF |
---|
13 | Group: Development/Languages |
---|
14 | URL: http://www.python.org/download/releases/%{version} |
---|
15 | Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 |
---|
16 | Source1: http://docs.python.org/py3k/archives/python-%{version}-docs-html.tar.bz2 |
---|
17 | Patch1: python-3.2b2-lib64.patch |
---|
18 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
19 | BuildRequires: expat-devel |
---|
20 | BuildRequires: db4-devel |
---|
21 | BuildRequires: gdbm-devel |
---|
22 | BuildRequires: sqlite3-devel |
---|
23 | BuildRequires: gzip tar gcc-c++ pkgconfig sed findutils |
---|
24 | BuildRequires: bzip2-devel |
---|
25 | BuildRequires: glibc-devel |
---|
26 | BuildRequires: ncurses-devel |
---|
27 | BuildRequires: openssl-devel |
---|
28 | BuildRequires: readline-devel |
---|
29 | BuildRequires: zlib-devel |
---|
30 | BuildRequires: libffi-devel |
---|
31 | Requires: bzip2 |
---|
32 | Requires: gdbm |
---|
33 | Requires: ncurses |
---|
34 | Requires: openssl |
---|
35 | Requires: readline |
---|
36 | Requires: sqlite3 |
---|
37 | Requires: zlib |
---|
38 | Packager: owa |
---|
39 | Vendor: Project Vine |
---|
40 | Distribution: Vine Linux |
---|
41 | |
---|
42 | %description |
---|
43 | Python is an interpreted, interactive, object-oriented programming |
---|
44 | language. It incorporates modules, exceptions, dynamic typing, very high |
---|
45 | level dynamic data types, and classes. Python combines remarkable power |
---|
46 | with very clear syntax. It has interfaces to many system calls and |
---|
47 | libraries, as well as to various window systems, and is extensible in C or |
---|
48 | C++. It is also usable as an extension language for applications that need |
---|
49 | a programmable interface. Finally, Python is portable: it runs on many |
---|
50 | brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the |
---|
51 | Mac. |
---|
52 | |
---|
53 | %package devel |
---|
54 | Summary: The libraries and header files needed for Python development. |
---|
55 | Group: Development/Libraries |
---|
56 | |
---|
57 | %description devel |
---|
58 | The Python programming language's interpreter can be extended with |
---|
59 | dynamically loaded extensions and can be embedded in other programs. |
---|
60 | This package contains the header files and libraries needed to do |
---|
61 | these types of tasks. |
---|
62 | |
---|
63 | Install python-devel if you want to develop Python extensions. The |
---|
64 | python package will also need to be installed. You'll probably also |
---|
65 | want to install the python-docs package, which contains Python |
---|
66 | documentation. |
---|
67 | |
---|
68 | %package tkinter |
---|
69 | Summary: A graphical user interface for the Python scripting language. |
---|
70 | Group: Development/Languages |
---|
71 | Requires: %{name} = %{version} |
---|
72 | Requires: tcl, tk, tix |
---|
73 | Requires: libX11, libxcb, libXau, libXdmcp |
---|
74 | BuildRequires: tcl, tk, tix |
---|
75 | BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel |
---|
76 | |
---|
77 | %description tkinter |
---|
78 | The Tkinter (Tk interface) program is an graphical user interface for |
---|
79 | the Python scripting language. |
---|
80 | |
---|
81 | You should install the tkinter package if you'd like to use a graphical |
---|
82 | user interface for Python programming. |
---|
83 | |
---|
84 | %package tools |
---|
85 | Summary: A collection of development tools included with Python. |
---|
86 | Group: Development/Tools |
---|
87 | Requires: %{name} = %{version} |
---|
88 | Requires: %{name}-tkinter = %{version} |
---|
89 | |
---|
90 | %description tools |
---|
91 | The Python package includes several development tools that are used |
---|
92 | to build python programs. |
---|
93 | |
---|
94 | %package docs |
---|
95 | Summary: Documentation for the Python programming language. |
---|
96 | Group: Documentation |
---|
97 | |
---|
98 | %description docs |
---|
99 | The python-docs package contains documentation on the Python |
---|
100 | programming language and interpreter. The documentation is provided |
---|
101 | in ASCII text files and in LaTeX source files. |
---|
102 | |
---|
103 | Install the python-docs package if you'd like to use the documentation |
---|
104 | for the Python language. |
---|
105 | |
---|
106 | |
---|
107 | %prep |
---|
108 | %setup -q -n Python-%{version} |
---|
109 | %if %{_lib} == lib64 |
---|
110 | %patch1 -p1 -b .lib64 |
---|
111 | %endif |
---|
112 | |
---|
113 | |
---|
114 | %build |
---|
115 | ./configure \ |
---|
116 | --prefix=%{_prefix} \ |
---|
117 | --libdir=%{_libdir} \ |
---|
118 | --enable-shared \ |
---|
119 | --enable-profiling \ |
---|
120 | --enable-ipv6 \ |
---|
121 | --with-fpectl \ |
---|
122 | --with-wide-unicode \ |
---|
123 | --with-doc-strings \ |
---|
124 | --with-pymalloc \ |
---|
125 | --with-signal-module \ |
---|
126 | --with-system-ffi \ |
---|
127 | --with-threads \ |
---|
128 | --with-valgrind \ |
---|
129 | %ifarch x86_64 |
---|
130 | --with-universal-archs=64-bit \ |
---|
131 | %endif |
---|
132 | CXX=g++; |
---|
133 | |
---|
134 | make %{?_smp_mflags} |
---|
135 | |
---|
136 | %if %{run_test} |
---|
137 | make test |
---|
138 | %endif |
---|
139 | |
---|
140 | |
---|
141 | %install |
---|
142 | [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT |
---|
143 | echo '[install_scripts]' >setup.cfg |
---|
144 | echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg |
---|
145 | |
---|
146 | mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload |
---|
147 | make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install |
---|
148 | |
---|
149 | # if --with-wide-unicode at configure |
---|
150 | ln -s python%{libvers}u $RPM_BUILD_ROOT%{_includedir}/python%{libvers} |
---|
151 | |
---|
152 | # replace path in pydoc |
---|
153 | if [ ! -z "%{binsuffix}" ] |
---|
154 | then |
---|
155 | ( |
---|
156 | cd $RPM_BUILD_ROOT%{_bindir} |
---|
157 | mv pydoc%{libvers} pydoc.old |
---|
158 | sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \ |
---|
159 | pydoc.old > pydoc%{libvers} |
---|
160 | chmod 755 pydoc%{libvers} |
---|
161 | rm -f pydoc.old |
---|
162 | ) |
---|
163 | fi |
---|
164 | |
---|
165 | # Tools |
---|
166 | echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
167 | echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
168 | echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
169 | echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
170 | echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
171 | chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} |
---|
172 | cp -a Tools $RPM_BUILD_ROOT%{python_lib} |
---|
173 | |
---|
174 | # make file lists |
---|
175 | rm -f mainpkg.files |
---|
176 | find "$RPM_BUILD_ROOT"%{python_lib} -type f | |
---|
177 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
---|
178 | grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >> mainpkg.files |
---|
179 | |
---|
180 | rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3 |
---|
181 | find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l | |
---|
182 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
---|
183 | grep -v -e '/bin/2to3%{binsuffix}$' | |
---|
184 | grep -v -e '/bin/pydoc%{binsuffix}$' | |
---|
185 | grep -v -e '/bin/smtpd.py%{binsuffix}$' | |
---|
186 | grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files |
---|
187 | |
---|
188 | |
---|
189 | rm -f tools.files |
---|
190 | find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \ |
---|
191 | "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f | |
---|
192 | sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files |
---|
193 | echo %{_bindir}/2to3-%{binsuffix} >> tools.files |
---|
194 | echo %{_bindir}/pydoc%{binsuffix} >> tools.files |
---|
195 | ##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files |
---|
196 | echo %{_bindir}/idle%{binsuffix} >> tools.files |
---|
197 | |
---|
198 | # docs |
---|
199 | mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir} |
---|
200 | ( |
---|
201 | cd "$RPM_BUILD_ROOT"%{config_htmldir} |
---|
202 | bunzip2 < %{SOURCE1} | tar x |
---|
203 | ) |
---|
204 | |
---|
205 | # fix the #! line in installed files |
---|
206 | find "$RPM_BUILD_ROOT" -type f -print0 | |
---|
207 | xargs -0 grep -l /usr/local/bin/python | while read file |
---|
208 | do |
---|
209 | FIXFILE="$file" |
---|
210 | sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \ |
---|
211 | "$FIXFILE" >/tmp/fix-python-path.$$ |
---|
212 | cat /tmp/fix-python-path.$$ > "$FIXFILE" |
---|
213 | rm -f /tmp/fix-python-path.$$ |
---|
214 | done |
---|
215 | |
---|
216 | # check to see if there are any straggling #! lines |
---|
217 | find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \ |
---|
218 | | grep ':1:#!' >/tmp/python-rpm-files.$$ || true |
---|
219 | if [ -s /tmp/python-rpm-files.$$ ] |
---|
220 | then |
---|
221 | echo '*****************************************************' |
---|
222 | cat /tmp/python-rpm-files.$$ |
---|
223 | cat <<@EOF |
---|
224 | ***************************************************** |
---|
225 | There are still files referencing /usr/local/bin/python in the |
---|
226 | install directory. They are listed above. Please fix the .spec |
---|
227 | file and try again. If you are an end-user, you probably want |
---|
228 | to report this to jafo-rpms@tummy.com as well. |
---|
229 | ***************************************************** |
---|
230 | @EOF |
---|
231 | rm -f /tmp/python-rpm-files.$$ |
---|
232 | exit 1 |
---|
233 | fi |
---|
234 | rm -f /tmp/python-rpm-files.$$ |
---|
235 | |
---|
236 | |
---|
237 | %post -p /sbin/ldconfig |
---|
238 | %postun -p /sbin/ldconfig |
---|
239 | %clean |
---|
240 | rm -fr $RPM_BUILD_ROOT |
---|
241 | |
---|
242 | %files -f mainpkg.files |
---|
243 | %defattr(-, root, root) |
---|
244 | %doc LICENSE |
---|
245 | %doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README |
---|
246 | %attr(755,root,root) %dir %{python_lib}/ |
---|
247 | %{_libdir}/libpython* |
---|
248 | %{_mandir}/man1/python%{libvers}.1* |
---|
249 | |
---|
250 | %files devel |
---|
251 | %defattr(-,root,root) |
---|
252 | %dir %{_includedir}/python%{libvers}u |
---|
253 | %{_includedir}/python%{libvers}u/*.h |
---|
254 | %{_includedir}/python%{libvers} |
---|
255 | %{_libdir}/pkgconfig/*.pc |
---|
256 | |
---|
257 | %files -f tools.files tools |
---|
258 | %defattr(-,root,root) |
---|
259 | |
---|
260 | %files tkinter |
---|
261 | %defattr(-,root,root) |
---|
262 | %{python_lib}/tkinter |
---|
263 | %{python_lib}/lib-dynload/_tkinter.*.so* |
---|
264 | |
---|
265 | %files docs |
---|
266 | %defattr(-,root,root) |
---|
267 | %{config_htmldir}/* |
---|
268 | |
---|
269 | |
---|
270 | %changelog |
---|
271 | * Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1 |
---|
272 | - updated python to 3.2 |
---|
273 | - updated python-*-docs-html to 3.2 |
---|
274 | - dropt all patchs |
---|
275 | - added python-3.2b2-lib64.patch |
---|
276 | - referred to the review Python-3.2/Misc/RPM/python-3.2.spec |
---|
277 | |
---|
278 | * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2 |
---|
279 | - rebuilt with openssl-1.0.0c |
---|
280 | |
---|
281 | * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1 |
---|
282 | - updated python to 3.1.3 |
---|
283 | - added python-3.1.3-locale.patch |
---|
284 | - dropt python-3.1.2-lib64.patch |
---|
285 | - added python-3.1.3-lib64-*.patchs |
---|
286 | python-3.1.3-lib64-Makefile.patch |
---|
287 | python-3.1.3-lib64-setup.patch |
---|
288 | python-3.1.3-lib64-site.patch |
---|
289 | python-3.1.3-lib64-install.patch |
---|
290 | python-3.1.3-lib64-sysconfig.patch |
---|
291 | python-3.1.3-lib64-getpath.patch |
---|
292 | python-3.1.3-lib64-test_install.patch |
---|
293 | - added run_test macro to run unit test |
---|
294 | - added BR: libffi |
---|
295 | |
---|
296 | * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4 |
---|
297 | - rebuilt with rpm-4.8.1 for pkg-config |
---|
298 | |
---|
299 | * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3 |
---|
300 | - spec in utf-8 |
---|
301 | |
---|
302 | * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2 |
---|
303 | - added missings in BuildRequires, Requires |
---|
304 | |
---|
305 | * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1 |
---|
306 | - initial build for VineSeed |
---|
307 | |
---|