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

Revision 9249, 10.2 KB checked in by Takemikaduchi, 9 years ago (diff)

python3-{pyatspi,pycairo,pygobject},gedit,accerciser,eog-plugins: rebuild with python3
others: 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.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: 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: db4-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, tk, 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.
99Group: Documentation
100
101%description docs
102The python-docs package contains documentation on the Python
103programming language and interpreter.  The documentation is provided
104in ASCII text files and in LaTeX source files.
105
106Install the python-docs package if you'd like to use the documentation
107for the Python language.
108
109
110%prep
111%setup -q -n Python-%{version}
112%if %{_lib} == lib64
113%patch1 -p1 -b .lib64
114%endif
115
116
117%build
118./configure \
119        --prefix=%{_prefix} \
120        --libdir=%{_libdir} \
121        --enable-shared \
122        --enable-ipv6 \
123        --with-fpectl \
124        --with-wide-unicode \
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 Jan 11 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2-1
276- new upstream release
277- update Patch1 (python-3.4.2-lib64.patch)
278
279* Sun Sep 07 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-3
280- remove configure option "--enable-profiling"
281
282* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-2
283- rebuild with libffi-3.0.13
284
285* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-1
286- new upstream release
287
288* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.2-1
289- updated python to 3.3.2
290
291* Sun Jan  6 2013 IWAI, Masaharu <iwai@alib.jp> 3.3.0-2
292- build with Tcl/Tk 8.5.7-1
293
294* Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
295- updated python to 3.3.0
296- update Patch1 (python-3.3.0-lib64.patch)
297- add BuildRequires: valgrind-devel
298
299* Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
300- updated python to 3.2
301- updated python-*-docs-html to 3.2
302- dropt all patchs
303- added python-3.2b2-lib64.patch
304- referred to the review Python-3.2/Misc/RPM/python-3.2.spec
305
306* Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
307- rebuilt with openssl-1.0.0c
308
309* Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
310- updated python to 3.1.3
311- added python-3.1.3-locale.patch
312- dropt python-3.1.2-lib64.patch
313- added python-3.1.3-lib64-*.patchs
314  python-3.1.3-lib64-Makefile.patch
315  python-3.1.3-lib64-setup.patch
316  python-3.1.3-lib64-site.patch
317  python-3.1.3-lib64-install.patch
318  python-3.1.3-lib64-sysconfig.patch
319  python-3.1.3-lib64-getpath.patch
320  python-3.1.3-lib64-test_install.patch
321- added run_test macro to run unit test
322- added BR: libffi
323
324* Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
325- rebuilt with rpm-4.8.1 for pkg-config
326
327* Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
328- spec in utf-8
329
330* Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
331- added missings in BuildRequires, Requires
332
333* Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
334- initial build for VineSeed
335
Note: See TracBrowser for help on using the repository browser.