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

Revision 10405, 11.0 KB checked in by Takemikaduchi, 8 years ago (diff)

gcc-5.4.0 & python3-3.5.2

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