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

Revision 12507, 16.5 KB checked in by tomop, 3 years ago (diff)

updated 4 packages

curl-7.73.0-1

php74-7.4.12-1

python3-3.8.6-2

samba-4.13.1-1

Line 
1%bcond_with run_test
2
3%define libvers 3.8
4%define binsuffix 3.8
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.8.6
11Release: 2%{?_dist_release}
12Group: programming
13Vendor: Project Vine
14Distribution: Vine Linux
15
16License: Python
17URL: http://www.python.org/download/releases/%{version}
18Source0: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
19Source1: https://docs.python.org/ftp/python/doc/%{version}/python-%{version}-docs-html.tar.bz2
20# (Patches taken from github.com/fedora-python/cpython)
21
22# 00001 # d06a8853cf4bae9e115f45e1d531d2dc152c5cc8
23# Fixup distutils/unixccompiler.py to remove standard library path from rpath
24# Was Patch0 in ivazquez' python3000 specfile
25Patch1: 00001-rpath.patch
26
27# 00102 # ec4353c0f646eb567cc0d63e1e41eb5e29cc3e81
28# Change the various install paths to use /usr/lib64/ instead or /usr/lib/
29#
30# Only used when "%%{_lib}" == "lib64".
31Patch102: 00102-lib64.patch
32
33# 00111 # 03918d404a40a50c9f5f93dc748b52e613d70d31
34# Don't try to build a libpythonMAJOR.MINOR.a
35#
36# Downstream only: not appropriate for upstream.
37#
38# See https://bugzilla.redhat.com/show_bug.cgi?id=556092
39Patch111: 00111-no-static-lib.patch
40
41# 00189 # adf51ed04ac74fd6fc39c642af35b87680c71dab
42# Instead of bundled wheels, use our RPM packaged wheels
43#
44# We keep them in /usr/share/python-wheels
45#
46# Downstream only: upstream bundles
47# We might eventually pursuit upstream support, but it's low prio
48Patch189: 00189-use-rpm-wheels.patch
49# The following versions of setuptools/pip are bundled when this patch is not applied.
50# The versions are written in Lib/ensurepip/__init__.py, this patch removes them.
51# When the bundled setuptools/pip wheel is updated, the patch no longer applies cleanly.
52# In such cases, the patch needs to be amended and the versions updated here:
53%global pip_version 20.1.1
54%global setuptools_version 47.1.0
55
56# 00251 # 2eabd04356402d488060bc8fe316ad13fc8a3356
57# Change user install location
58#
59# Set values of prefix and exec_prefix in distutils install command
60# to /usr/local if executable is /usr/bin/python* and RPM build
61# is not detected to make pip and distutils install into separate location.
62#
63# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
64# Downstream only: Awaiting resources to work on upstream PEP
65Patch251: 00251-change-user-install-location.patch
66
67# 00274 # 1e9258f6e8f70e86d5130113d3eed22993cf3da9
68# Upstream uses Debian-style architecture naming, change to match Fedora
69Patch274: 00274-fix-arch-names.patch
70
71# 00328 # 367fdcb5a075f083aea83ac174999272a8faf75c
72# Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild
73#
74# Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest
75# %%changelog date. This makes Python default to the CHECKED_HASH pyc
76# invalidation mode, bringing more reproducible builds traded for an import
77# performance decrease. To avoid that, we don't default to CHECKED_HASH
78# when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages).
79#
80# See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426
81# Downstream only: only used when building RPM packages
82# Ideally, we should talk to upstream and explain why we don't want this
83Patch328: 00328-pyc-timestamp-invalidation-mode.patch
84
85# security
86Patch1000: CVE-2020-27619.patch
87
88BuildRoot: %{_tmppath}/%{name}-%{version}-root
89BuildRequires: autoconf
90BuildRequires: bzip2-devel
91BuildRequires: expat-devel
92BuildRequires: findutils
93BuildRequires: gcc-c++
94BuildRequires: gdbm-devel
95BuildRequires: glibc-devel
96BuildRequires: libdb-devel
97BuildRequires: libffi-devel
98BuildRequires: libnsl2-devel
99BuildRequires: libtirpc-devel
100BuildRequires: libxcrypt-devel
101BuildRequires: ncurses-devel
102BuildRequires: openssl-devel
103BuildRequires: pkgconfig
104BuildRequires: readline-devel
105BuildRequires: sqlite3-devel
106BuildRequires: tar
107BuildRequires: valgrind-devel
108BuildRequires: xz-devel
109BuildRequires: zlib-devel
110
111%description
112Python is an interpreted, interactive, object-oriented programming
113language.  It incorporates modules, exceptions, dynamic typing, very high
114level dynamic data types, and classes. Python combines remarkable power
115with very clear syntax. It has interfaces to many system calls and
116libraries, as well as to various window systems, and is extensible in C or
117C++. It is also usable as an extension language for applications that need
118a programmable interface.  Finally, Python is portable: it runs on many
119brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the
120Mac.
121
122
123%package devel
124Summary: The libraries and header files needed for Python development.
125Group: programming
126Requires: %{name} = %{version}-%{release}
127Requires: libtirpc-devel
128
129%description devel
130The Python programming language's interpreter can be extended with
131dynamically loaded extensions and can be embedded in other programs.
132This package contains the header files and libraries needed to do
133these types of tasks.
134
135Install python-devel if you want to develop Python extensions.  The
136python package will also need to be installed.  You'll probably also
137want to install the python-docs package, which contains Python
138documentation.
139
140%package tkinter
141Summary: A graphical user interface for the Python scripting language.
142Group: programming
143Requires: %{name} = %{version}-%{release}
144Requires: tcl, tk, tix
145Requires: libX11, libxcb, libXau, libXdmcp
146BuildRequires: tcl-devel, tk-devel, tix
147BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel
148
149%description tkinter
150The Tkinter (Tk interface) program is an graphical user interface for
151the Python scripting language.
152
153You should install the tkinter package if you'd like to use a graphical
154user interface for Python programming.
155
156
157%package tools
158Summary: A collection of development tools included with Python.
159Group: programming
160Requires: %{name} = %{version}-%{release}
161Requires: %{name}-tkinter = %{version}
162
163%description tools
164The Python package includes several development tools that are used
165to build python programs.
166
167
168%package docs
169Summary: Documentation for the Python programming language.
170Summary(ja): Python プログラミング言語のドキュメント
171Group: documentation
172
173%description docs
174The python-docs package contains documentation on the Python
175programming language and interpreter.  The documentation is provided
176in ASCII text files and in LaTeX source files.
177
178Install the python-docs package if you'd like to use the documentation
179for the Python language.
180
181
182%debug_package
183
184
185%prep
186%setup -q -n Python-%{version}
187# Remove all exe files to ensure we are not shipping prebuilt binaries
188# note that those are only used to create Microsoft Windows installers
189# and that functionality is broken on Linux anyway
190find -name '*.exe' -print -delete
191
192# Remove bundled libraries to ensure that we're using the system copy.
193rm -r Modules/expat
194
195#
196# Apply patches:
197#
198%patch1 -p1
199
200%if "%{_lib}" == "lib64"
201%patch102 -p1
202%endif
203%patch111 -p1
204
205%if %{with rpmwheels}
206%patch189 -p1
207rm Lib/ensurepip/_bundled/*.whl
208%endif
209
210%patch251 -p1
211%patch274 -p1
212%patch328 -p1
213
214# security
215%patch1000 -p1
216
217# Remove files that should be generated by the build
218# (This is after patching, so that we can use patches directly from upstream)
219rm configure pyconfig.h.in
220
221# Regenerate the configure script and pyconfig.h.in
222autoconf
223autoheader
224
225
226%build
227export CFLAGS="%{?extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
228export CFLAGS_NODIST="%{?build_cflags} -D_GNU_SOURCE -fPIC -fwrapv%{?with_no_semantic_interposition: -fno-semantic-interposition}"
229export CXXFLAGS="%{?extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
230export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
231export OPT="%{?extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
232export LINKCC="gcc"
233export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
234export LDFLAGS="%{?extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
235export LDFLAGS_NODIST="%{?build_ldflags}%{?with_no_semantic_interposition: -fno-semantic-interposition} -g $(pkg-config --libs-only-L openssl)"
236
237./configure \
238        --prefix=%{_prefix} \
239        --libdir=%{_libdir} \
240        --enable-ipv6 \
241        --enable-shared \
242        --with-computed-gotos=yes \
243        --with-dbmliborder=gdbm:ndbm:bdb \
244        --with-system-expat \
245        --with-system-ffi \
246        --enable-loadable-sqlite-extensions \
247        --with-lto \
248        --with-ssl-default-suites=openssl \
249        --with-valgrind \
250        --without-ensurepip \
251        --enable-optimizations \
252        %{nil}
253
254make %{?_smp_mflags} CFLAGS_NODIST="$CFLAGS_NODIST" \
255        regen-all PYTHON_FOR_REGEN="python%{binsuffix}"
256
257make %{?_smp_mflags} CFLAGS_NODIST="$CFLAGS_NODIST"
258
259
260%install
261[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
262make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
263
264# replace path in pydoc
265if [ ! -z "%{binsuffix}" ]
266then
267   (
268      cd $RPM_BUILD_ROOT%{_bindir}
269      mv pydoc%{libvers} pydoc.old
270      sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \
271            pydoc.old > pydoc%{libvers}
272      chmod 755 pydoc%{libvers}
273      rm -f pydoc.old
274   )
275fi
276
277#  Tools
278echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
279echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
280echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
281echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
282echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
283chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
284cp -a Tools $RPM_BUILD_ROOT%{python_lib}
285
286# make file lists
287rm -f mainpkg.files
288find "$RPM_BUILD_ROOT"%{python_lib} -type f |
289        sed "s|^${RPM_BUILD_ROOT}|/|" |
290        grep -v \
291                -e '/python%{libvers}/config$' \
292                -e '_tkinter.so$' \
293                -e '_tkinter.cpython-' \
294                >> mainpkg.files
295
296rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
297find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
298        sed "s|^${RPM_BUILD_ROOT}|/|" |
299        grep -v -e '/bin/2to3%{binsuffix}$' |
300        grep -v -e '/bin/pydoc%{binsuffix}$' |
301        grep -v -e '/bin/smtpd.py%{binsuffix}$' |
302        grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
303
304
305rm -f tools.files
306find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
307      "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
308      sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
309echo %{_bindir}/2to3-%{binsuffix} >> tools.files
310echo %{_bindir}/pydoc%{binsuffix} >> tools.files
311##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
312echo %{_bindir}/idle%{binsuffix} >> tools.files
313
314# docs
315mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
316(
317   cd "$RPM_BUILD_ROOT"%{config_htmldir}
318   bunzip2 < %{SOURCE1} | tar x
319)
320
321#  fix the #! line in installed files
322find "$RPM_BUILD_ROOT" -type f -print0 |
323      xargs -0 grep -l /usr/local/bin/python | while read file
324do
325   FIXFILE="$file"
326   sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
327         "$FIXFILE" >/tmp/fix-python-path.$$
328   cat /tmp/fix-python-path.$$ > "$FIXFILE"
329   rm -f /tmp/fix-python-path.$$
330done
331
332#  check to see if there are any straggling #! lines
333find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
334      | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
335if [ -s /tmp/python-rpm-files.$$ ]
336then
337   echo '*****************************************************'
338   cat /tmp/python-rpm-files.$$
339   cat <<@EOF
340   *****************************************************
341     There are still files referencing /usr/local/bin/python in the
342     install directory.  They are listed above.  Please fix the .spec
343     file and try again.  If you are an end-user, you probably want
344     to report this to jafo-rpms@tummy.com as well.
345   *****************************************************
346@EOF
347   rm -f /tmp/python-rpm-files.$$
348   exit 1
349fi
350rm -f /tmp/python-rpm-files.$$
351
352
353%if %{with run_test}
354%check
355make test
356%endif
357
358
359%clean
360rm -fr $RPM_BUILD_ROOT
361
362
363%post -p /sbin/ldconfig
364%postun -p /sbin/ldconfig
365
366
367%files -f mainpkg.files
368%defattr(-, root, root)
369%license LICENSE
370%doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README
371%attr(755,root,root) %dir %{python_lib}/
372%{_libdir}/libpython*
373%{_mandir}/man1/python%{libvers}.1*
374%{_mandir}/man1/%{name}.1*
375
376%files devel
377%defattr(-,root,root)
378%dir %{_includedir}/python%{libvers}
379%dir %{_includedir}/python%{libvers}/cpython
380%dir %{_includedir}/python%{libvers}/internal
381%{_includedir}/python%{libvers}/*.h
382%{_includedir}/python%{libvers}/cpython/*.h
383%{_includedir}/python%{libvers}/internal/*.h
384%{_libdir}/pkgconfig/*.pc
385
386%files -f tools.files tools
387%defattr(-,root,root)
388
389%files tkinter
390%defattr(-,root,root)
391%{python_lib}/tkinter
392%{python_lib}/lib-dynload/_tkinter.*.so*
393
394%files docs
395%defattr(-,root,root)
396%{config_htmldir}/*
397
398
399%changelog
400* Tue Nov 03 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.6-2
401- added Patch1000 to fix CVE-2020-27619.
402
403* Fri Oct 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.6-1
404- new upstream release.
405
406* Sat Aug 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.5-1
407- new upstream release.
408
409* Wed Apr 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.9-1
410- new upstream release.
411
412* Sat Oct 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-5
413- fixed %%files.
414
415* Tue Oct 15 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-4
416- rebuilt with tix-8.4.3-5.
417
418* Fri Oct 04 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-3
419- rebuilt with tcl/tk-8.6.9.
420
421* Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> 3.5.7-2
422- rebuild with readline-8.0 and ncurses-6.1
423
424* Sun May 12 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.7-1
425- new upstream release.
426- rebuilt with gdbm-1.18.1.
427- added R:libtirpc-devel to python3-devel.
428
429* Thu Feb 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.6-3
430- added BR:libxcrypt-devel.
431- added BR:libtirpc-devel.
432- added BR:libnsl2-devel.
433
434* Sat Jan 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.6-2
435- rebuilt with new toolchain.
436
437* Mon Nov 19 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.6-1
438- new upstream release.
439- really rebuilt with openssl-1.1.1.
440
441* Fri Nov 02 2018 Toshiaki Ara <ara_t@384.jp> 3.5.2-2
442- rebuild with openssl-1.1.1
443
444* Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.2-1
445- new upstream release
446- update Patch1 (python-3.5.2-lib64.patch)
447
448* Sun Mar 27 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.4-2
449- rebuild with openssl-1.0.2g
450
451* Sat Feb 13 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.4-1
452- new upstream release
453- add Patch2 (python3-3.4.4-revert-makefile.patch)
454
455* Sun Apr 12 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.3-1
456- new upstream release
457
458* Sun Mar 22 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.4.2-2
459- rebuilt with readline 6.3
460- changed BuildRequires: tcl-devel, tk-devel instead of tcl, tk respectively
461- changed BuildRequires: libdb-devel instead of db4-devel
462
463* Sun Jan 11 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.2-1
464- new upstream release
465- update Patch1 (python-3.4.2-lib64.patch)
466
467* Sun Sep 07 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-3
468- remove configure option "--enable-profiling"
469
470* Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-2
471- rebuild with libffi-3.0.13
472
473* Sun Nov 24 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.3-1
474- new upstream release
475
476* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.2-1
477- updated python to 3.3.2
478
479* Sun Jan  6 2013 IWAI, Masaharu <iwai@alib.jp> 3.3.0-2
480- build with Tcl/Tk 8.5.7-1
481
482* Wed Oct 24 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3.0-1
483- updated python to 3.3.0
484- update Patch1 (python-3.3.0-lib64.patch)
485- add BuildRequires: valgrind-devel
486
487* Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
488- updated python to 3.2
489- updated python-*-docs-html to 3.2
490- dropt all patchs
491- added python-3.2b2-lib64.patch
492- referred to the review Python-3.2/Misc/RPM/python-3.2.spec
493
494* Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
495- rebuilt with openssl-1.0.0c
496
497* Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1
498- updated python to 3.1.3
499- added python-3.1.3-locale.patch
500- dropt python-3.1.2-lib64.patch
501- added python-3.1.3-lib64-*.patchs
502  python-3.1.3-lib64-Makefile.patch
503  python-3.1.3-lib64-setup.patch
504  python-3.1.3-lib64-site.patch
505  python-3.1.3-lib64-install.patch
506  python-3.1.3-lib64-sysconfig.patch
507  python-3.1.3-lib64-getpath.patch
508  python-3.1.3-lib64-test_install.patch
509- added run_test macro to run unit test
510- added BR: libffi
511
512* Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4
513- rebuilt with rpm-4.8.1 for pkg-config
514
515* Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3
516- spec in utf-8
517
518* Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2
519- added missings in BuildRequires, Requires
520
521* Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1
522- initial build for VineSeed
523
Note: See TracBrowser for help on using the repository browser.