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

Revision 8940, 10.1 KB checked in by Takemikaduchi, 10 years ago (diff)

fix configure option

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.3
11Release: 3%{?_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.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
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%ifarch x86_64
132        --with-universal-archs=64-bit \
133%endif
134        CXX=g++;
135
136make %{?_smp_mflags}
137
138%if %{run_test}
139make test
140%endif
141
142
143%install
144[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
145echo '[install_scripts]' >setup.cfg
146echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg
147
148mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload
149make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
150
151# if --with-wide-unicode at configure
152ln -s python%{libvers}u $RPM_BUILD_ROOT%{_includedir}/python%{libvers}
153
154# replace path in pydoc
155if [ ! -z "%{binsuffix}" ]
156then
157   (
158      cd $RPM_BUILD_ROOT%{_bindir}
159      mv pydoc%{libvers} pydoc.old
160      sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \
161            pydoc.old > pydoc%{libvers}
162      chmod 755 pydoc%{libvers}
163      rm -f pydoc.old
164   )
165fi
166
167#  Tools
168echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
169echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
170echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
171echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
172echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
173chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
174cp -a Tools $RPM_BUILD_ROOT%{python_lib}
175
176# make file lists
177rm -f mainpkg.files
178find "$RPM_BUILD_ROOT"%{python_lib} -type f |
179        sed "s|^${RPM_BUILD_ROOT}|/|" |
180        grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >> mainpkg.files
181
182rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
183find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
184        sed "s|^${RPM_BUILD_ROOT}|/|" |
185        grep -v -e '/bin/2to3%{binsuffix}$' |
186        grep -v -e '/bin/pydoc%{binsuffix}$' |
187        grep -v -e '/bin/smtpd.py%{binsuffix}$' |
188        grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
189
190
191rm -f tools.files
192find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
193      "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
194      sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
195echo %{_bindir}/2to3-%{binsuffix} >> tools.files
196echo %{_bindir}/pydoc%{binsuffix} >> tools.files
197##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
198echo %{_bindir}/idle%{binsuffix} >> tools.files
199
200# docs
201mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
202(
203   cd "$RPM_BUILD_ROOT"%{config_htmldir}
204   bunzip2 < %{SOURCE1} | tar x
205)
206
207#  fix the #! line in installed files
208find "$RPM_BUILD_ROOT" -type f -print0 |
209      xargs -0 grep -l /usr/local/bin/python | while read file
210do
211   FIXFILE="$file"
212   sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
213         "$FIXFILE" >/tmp/fix-python-path.$$
214   cat /tmp/fix-python-path.$$ > "$FIXFILE"
215   rm -f /tmp/fix-python-path.$$
216done
217
218#  check to see if there are any straggling #! lines
219find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
220      | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
221if [ -s /tmp/python-rpm-files.$$ ]
222then
223   echo '*****************************************************'
224   cat /tmp/python-rpm-files.$$
225   cat <<@EOF
226   *****************************************************
227     There are still files referencing /usr/local/bin/python in the
228     install directory.  They are listed above.  Please fix the .spec
229     file and try again.  If you are an end-user, you probably want
230     to report this to jafo-rpms@tummy.com as well.
231   *****************************************************
232@EOF
233   rm -f /tmp/python-rpm-files.$$
234   exit 1
235fi
236rm -f /tmp/python-rpm-files.$$
237
238
239%post -p /sbin/ldconfig
240%postun -p /sbin/ldconfig
241%clean
242rm -fr $RPM_BUILD_ROOT
243
244%files -f mainpkg.files
245%defattr(-, root, root)
246%doc LICENSE
247%doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README
248%attr(755,root,root) %dir %{python_lib}/
249%{_libdir}/libpython*
250%{_mandir}/man1/python%{libvers}.1*
251%{_mandir}/man1/%{name}.1*
252
253%files devel
254%defattr(-,root,root)
255%dir %{_includedir}/python%{libvers}m
256%{_includedir}/python%{libvers}m/*.h
257%{_includedir}/python%{libvers}
258%{_libdir}/pkgconfig/*.pc
259
260%files -f tools.files tools
261%defattr(-,root,root)
262
263%files tkinter
264%defattr(-,root,root)
265%{python_lib}/tkinter
266%{python_lib}/lib-dynload/_tkinter.*.so*
267
268%files docs
269%defattr(-,root,root)
270%{config_htmldir}/*
271
272
273%changelog
274* Sun Sep 07 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-3
275- remove configure option "--enable-profiling"
276
277* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-2
278- rebuild with libffi-3.0.13
279
280* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-1
281- new upstream release
282
283* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.2-1
284- updated python to 3.3.2
285
286* Sun Jan  6 2013 IWAI, Masaharu <iwai@alib.jp> 3.3.0-2
287- build with Tcl/Tk 8.5.7-1
288
289* Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
290- updated python to 3.3.0
291- update Patch1 (python-3.3.0-lib64.patch)
292- add BuildRequires: valgrind-devel
293
294* Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
295- updated python to 3.2
296- updated python-*-docs-html to 3.2
297- dropt all patchs
298- added python-3.2b2-lib64.patch
299- referred to the review Python-3.2/Misc/RPM/python-3.2.spec
300
301* Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
302- rebuilt with openssl-1.0.0c
303
304* Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
305- updated python to 3.1.3
306- added python-3.1.3-locale.patch
307- dropt python-3.1.2-lib64.patch
308- added python-3.1.3-lib64-*.patchs
309  python-3.1.3-lib64-Makefile.patch
310  python-3.1.3-lib64-setup.patch
311  python-3.1.3-lib64-site.patch
312  python-3.1.3-lib64-install.patch
313  python-3.1.3-lib64-sysconfig.patch
314  python-3.1.3-lib64-getpath.patch
315  python-3.1.3-lib64-test_install.patch
316- added run_test macro to run unit test
317- added BR: libffi
318
319* Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
320- rebuilt with rpm-4.8.1 for pkg-config
321
322* Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
323- spec in utf-8
324
325* Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
326- added missings in BuildRequires, Requires
327
328* Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
329- initial build for VineSeed
330
Note: See TracBrowser for help on using the repository browser.