source: projects/specs/trunk/p/python3/python3-vl.spec @ 9502

Revision 9502, 10.6 KB checked in by Takemikaduchi, 9 years ago (diff)

new upstream release

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