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

Revision 7297, 9.6 KB checked in by iwaim, 11 years ago (diff)

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