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

Revision 12056, 12.0 KB checked in by tomop, 5 years ago (diff)

Merge branch 'tomop'

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