source: projects/specs/branches/6/p/python3/python3-vl.spec @ 3491

Revision 3491, 9.3 KB checked in by owa, 13 years ago (diff)

upload python3-3.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.2
4%define binsuffix 3.2
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.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.bz2
16Source1: http://docs.python.org/py3k/archives/python-%{version}-docs-html.tar.bz2
17Patch1: python-3.2b2-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
31Requires: bzip2
32Requires: gdbm
33Requires: ncurses
34Requires: openssl
35Requires: readline
36Requires: sqlite3
37Requires: zlib
38Packager: owa
39Vendor: Project Vine
40Distribution: Vine Linux
41
42%description
43Python is an interpreted, interactive, object-oriented programming
44language.  It incorporates modules, exceptions, dynamic typing, very high
45level dynamic data types, and classes. Python combines remarkable power
46with very clear syntax. It has interfaces to many system calls and
47libraries, as well as to various window systems, and is extensible in C or
48C++. It is also usable as an extension language for applications that need
49a programmable interface.  Finally, Python is portable: it runs on many
50brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the
51Mac.
52
53%package devel
54Summary: The libraries and header files needed for Python development.
55Group: Development/Libraries
56
57%description devel
58The Python programming language's interpreter can be extended with
59dynamically loaded extensions and can be embedded in other programs.
60This package contains the header files and libraries needed to do
61these types of tasks.
62
63Install python-devel if you want to develop Python extensions.  The
64python package will also need to be installed.  You'll probably also
65want to install the python-docs package, which contains Python
66documentation.
67
68%package tkinter
69Summary: A graphical user interface for the Python scripting language.
70Group: Development/Languages
71Requires: %{name} = %{version}
72Requires: tcl, tk, tix
73Requires: libX11, libxcb, libXau, libXdmcp
74BuildRequires: tcl, tk, tix
75BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel
76
77%description tkinter
78The Tkinter (Tk interface) program is an graphical user interface for
79the Python scripting language.
80
81You should install the tkinter package if you'd like to use a graphical
82user interface for Python programming.
83
84%package tools
85Summary: A collection of development tools included with Python.
86Group: Development/Tools
87Requires: %{name} = %{version}
88Requires: %{name}-tkinter = %{version}
89
90%description tools
91The Python package includes several development tools that are used
92to build python programs.
93
94%package docs
95Summary: Documentation for the Python programming language.
96Group: Documentation
97
98%description docs
99The python-docs package contains documentation on the Python
100programming language and interpreter.  The documentation is provided
101in ASCII text files and in LaTeX source files.
102
103Install the python-docs package if you'd like to use the documentation
104for 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
134make %{?_smp_mflags}
135
136%if %{run_test}
137make test
138%endif
139
140
141%install
142[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
143echo '[install_scripts]' >setup.cfg
144echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg
145
146mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload
147make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
148
149# if --with-wide-unicode at configure
150ln -s python%{libvers}u $RPM_BUILD_ROOT%{_includedir}/python%{libvers}
151
152# replace path in pydoc
153if [ ! -z "%{binsuffix}" ]
154then
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   )
163fi
164
165#  Tools
166echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
167echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
168echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
169echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
170echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
171chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
172cp -a Tools $RPM_BUILD_ROOT%{python_lib}
173
174# make file lists
175rm -f mainpkg.files
176find "$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
180rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
181find "$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
189rm -f tools.files
190find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
191      "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
192      sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
193echo %{_bindir}/2to3-%{binsuffix} >> tools.files
194echo %{_bindir}/pydoc%{binsuffix} >> tools.files
195##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
196echo %{_bindir}/idle%{binsuffix} >> tools.files
197
198# docs
199mkdir -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
206find "$RPM_BUILD_ROOT" -type f -print0 |
207      xargs -0 grep -l /usr/local/bin/python | while read file
208do
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.$$
214done
215
216#  check to see if there are any straggling #! lines
217find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
218      | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
219if [ -s /tmp/python-rpm-files.$$ ]
220then
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
233fi
234rm -f /tmp/python-rpm-files.$$
235
236
237%post -p /sbin/ldconfig
238%postun -p /sbin/ldconfig
239%clean
240rm -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
Note: See TracBrowser for help on using the repository browser.