python27/python27.spec

512 lines
18 KiB
RPMSpec
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# majversion define needed when upgrading from 2.x to 2.(x+1) releases
%define majversion %(echo %version | cut -d. -f 1-2)
%define libname libpython27
%define _Rpatchdir /usr/src/RPM/SPECS
# FIXME: x86_64: install also platform dependent stuff in /usr/lib or it does not work
#% define __libdir %{_prefix}/lib
%define __libdir %{_libdir}
Name: python27
Version: 2.7.18
Release: 2mamba
Summary: An interpreted, interactive, object-oriented programming language
Group: Applications/Development
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.python.org
Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
Source1: python-2.7-macros.python
Source2: python-macros.python
Patch1: %{name}-2.7.3-cgi.patch
Patch2: %{name}-2.7.3-platform_add_openmamba_distro.patch
# Cross-compile patches available from:
# http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
Patch5: Python-2.6.5-xcompile.patch
Patch6: python-2.6.7-pkgconfig.patch
Patch7: python27-2.7.3-gcc-4.8.patch
Patch8: python-2.7.3-use_system_Sphinx.patch
Patch9: python-2.7.15-lib64.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libbzip2-devel
BuildRequires: libdb53-devel
BuildRequires: libgdbm-devel
BuildRequires: libncurses-devel
BuildRequires: libopenssl-devel
BuildRequires: libreadline-devel
BuildRequires: libsqlite-devel
BuildRequires: libtcl-devel
%if "%{stage1}" != "1"
BuildRequires: libtk-devel
BuildRequires: libX11-devel
%endif
BuildRequires: libz-devel
## AUTOBUILDREQ-END
#%if "%{stage1}" != "1"
BuildRequires: latex2html >= 2002
BuildRequires: tetex >= 3.0
BuildRequires: libtk >= 8.4.11
BuildRequires: libbluez-devel >= 2.21
#BuildRequires: python-Sphinx
#BuildRequires: python-Jinja2
#%endif
Requires: %{libname} = %{?epoch:epoch:}%{version}-%{release}
Provides: python-abi = %{majversion}
Provides: python(abi) = %{majversion}
Provides: /usr/bin/python
Provides: python = %{?epoch:epoch:}%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Python is an interpreted, interactive, object-oriented programming language.
It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax.
It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC).
New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
%package -n %{libname}
Group: System/Libraries/Python
Summary: Libraries for Python
Provides: libpython
Obsoletes: libpython
%description -n %{libname}
Python is an interpreted, interactive, object-oriented programming language.
It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax.
It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC).
New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the libraries for Python.
%package -n %{libname}-devel
Group: Development/Libraries/Python
Summary: Devel package for Python
Requires: %{libname} = %{?epoch:epoch:}%{version}-%{release}
Provides: %{name}-devel = %{version}
Obsoletes: %{name}-devel
Provides: libpython-devel
Obsoletes: libpython-devel
Provides: python-devel
Obsoletes: python-devel
%description -n %{libname}-devel
Python is an interpreted, interactive, object-oriented programming language.
It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax.
It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC).
New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the development files for Python.
%package doc
Group: Documentation
Summary: Documentation package for Python
Requires: %{name} = %{?epoch:epoch:}%{version}-%{release}
Provides: python-doc
Obsoletes: python-doc
%description doc
Python is an interpreted, interactive, object-oriented programming language.
It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax.
It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC).
New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the documentation files for Python in HTML format.
%package tk
Group: System/Libraries/Python
Summary: Tk library for Python
Requires: %{name} = %{?epoch:epoch:}%{version}-%{release}
Provides: python-tk
Obsoletes: python-tk
%description tk
Python is an interpreted, interactive, object-oriented programming language.
It is often compared to Tcl, Perl, Scheme or Java.
Python combines remarkable power with very clear syntax.
It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.
There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC).
New built-in modules are easily written in C or C++.
Python is also usable as an extension language for applications that need a programmable interface.
The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga...
This package contains the tk library for Python.
%debug_package
%prep
%setup -q -n Python-%{version}
#-D -T
#:<< _EOF
%patch1 -p1
%patch2 -p1
%if "%{_host}" != "%{_build}"
%patch5 -p1
%endif
#%patch7 -p1
#%patch8 -p1
%ifarch x86_64 aarch64
%patch9 -p1
%endif
TMPFILE=`mktemp --tmpdir=/dev/shm`
[ -e $TMPFILE ] || {
echo "ERROR: sanity check for /dev/shm failed; aborting."
exit 1
}
rm -f $TMPFILE
autoreconf
%build
#:<< _EOF
#%if "%{_host}" != "%{_build}"
#
#%configure --disable-shared
#make CC=%{_build}-gcc python Parser/pgen
#mv python hostpython
#mv Parser/pgen Parser/hostpgen
#make distclean
#%configure \
# --enable-shared
#%make \
# HOSTPYTHON=./hostpython \
# HOSTPGEN=./Parser/hostpgen \
# BLDSHARED="%{_host}-gcc -shared" \
# CROSS_COMPILE="%{_host}-" \
# CROSS_COMPILE_TARGET=yes
#
#%else
%configure \
--libdir=%{__libdir} \
--enable-shared \
%if "%{_host}" == "%{_build}"
--enable-ipv6 \
%else
--disable-ipv6 \
CROSS_COMPILE="%{_host}-" \
CROSS_COMPILE_TARGET=yes
%endif
%make
#%endif
# create DLFCN.py
cd Tools/scripts
python2 ./h2py.py %{_includedir}/dlfcn.h
cd ../..
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%if "%{_host}" != "%{_build}"
%makeinstall \
HOSTPYTHON=./hostpython \
BLDSHARED="%{_host}-gcc -shared" \
CROSS_COMPILE="%{_host}-" \
CROSS_COMPILE_TARGET=yes
%else
%makeinstall
%endif
#install -d %{buildroot}%{__libdir}/python/site-packages
#ln -s python%{majversion} %{buildroot}%{__libdir}/python
ln -s python%{majversion} %{buildroot}%{_includedir}/python
# fix library permission
chmod 755 %{buildroot}%{__libdir}/libpython%{majversion}.so.*
%if "%{stage1}" != "1"
# build the HTML documentation
cd Doc
###sed -i s@/usr/bin/env@/bin/env@ tools/mkhowto
PATH=$PATH:%{_builddir}/Python-%{version}/Doc/tools
make html
install -d %{buildroot}%{_defaultdocdir}/%{name}-%{version}
cp -R build/html build/doctrees %{buildroot}%{_defaultdocdir}/%{name}-%{version}
rm -f 'find %{buildroot}%{_defaultdocdir}/%{name}-%{version}/html/.cvsignore'
cd ..
#make PAPER=a4 pdf
%endif
install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.python%{majversion}
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/rpm/macros.python
# install i18n tools for development
install -D -m0755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{majversion}.py
install -D -m0755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/pygettext%{majversion}.py
# install DLFCN.py
install -D -m0755 Tools/scripts/DLFCN.py %{buildroot}%{__libdir}/python%{majversion}/DLFCN.py
rm -f %{buildroot}%{_bindir}/python
#rm -f %{buildroot}%{__libdir}/pkgconfig/python.pc
#rm -f %{buildroot}%{_bindir}/2to3
#rm -f %{buildroot}%{_bindir}/python-config
#rm -f %{buildroot}%{_includedir}/python
#
ln -s idle %{buildroot}%{_bindir}/idle%{majversion}
ln -s pydoc %{buildroot}%{_bindir}/pydoc%{majversion}
ln -s smtpd.py %{buildroot}%{_bindir}/smtpd%{majversion}.py
%ifarch x86_64 aarch64
# FIXME: workaround
install -d -m0755 %{buildroot}%{_prefix}/lib/python%{majversion}
ln -sf ../../lib64/python%{majversion}/config %{buildroot}%{_prefix}/lib/python%{majversion}/config
%endif
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
/usr/sbin/update-alternatives --install %{_bindir}/python python %{_bindir}/python%{majversion} 75
/usr/sbin/update-alternatives --auto python
exit 0
%preun
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove python %{_bindir}/python%{majversion}
fi
exit 0
%posttrans
[ -e %{_bindir}/python ] || \
/usr/sbin/update-alternatives --install %{_bindir}/python python %{_bindir}/python%{majversion} 75
exit 0
%ifarch x86_64 aarch64
%pre -n %{libname}
[ -d %{_prefix}/lib/python%{majversion}/config ] &&
mv %{_prefix}/lib/python%{majversion}/config %{_prefix}/lib/python%{majversion}/config.old.`date +%s`
:
%endif
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/2to3
%{_bindir}/idle
%{_bindir}/idle%{majversion}
%{_bindir}/pydoc
%{_bindir}/pydoc%{majversion}
%{_bindir}/python2
%{_bindir}/python%{majversion}
%{_bindir}/smtpd.py
%{_bindir}/smtpd%{majversion}.py
%dir %{_includedir}/python%{majversion}
%{_includedir}/python%{majversion}/pyconfig.h
%ifarch x86_64 aarch64
%{_prefix}/lib/python%{majversion}/config
%endif
%dir %{__libdir}/python%{majversion}/config
%{__libdir}/python%{majversion}/config/*
%{_mandir}/man1/*
%files -n %{libname}
%defattr(-,root,root)
%dir %{__libdir}/python%{majversion}
%exclude %{__libdir}/python%{majversion}/config
%{__libdir}/python%{majversion}/*
%{_libdir}/libpython%{majversion}.so.*
%{_libdir}/libpython%{majversion}.so
%if "%{stage1}" != "1"
%exclude %{__libdir}/python%{majversion}/lib-tk
%exclude %{__libdir}/python%{majversion}/lib-dynload/_tkinter.so
%endif
%files -n %{libname}-devel
%defattr(-,root,root)
%{_sysconfdir}/rpm/macros.python%{majversion}
%{_sysconfdir}/rpm/macros.python
%{_bindir}/msgfmt%{majversion}.py
%{_bindir}/pygettext%{majversion}.py
%{_bindir}/python*-config
%{_includedir}/python
%dir %{_includedir}/python%{majversion}
%{_includedir}/python%{majversion}/*.h
%exclude %{_includedir}/python%{majversion}/pyconfig.h
%{_libdir}/pkgconfig/python-%{majversion}.pc
%{_libdir}/pkgconfig/python2.pc
%{_libdir}/pkgconfig/python.pc
%if "%{stage1}" != "1"
%files tk
%defattr(-,root,root)
%{__libdir}/python%{majversion}/lib-tk
%{__libdir}/python%{majversion}/lib-dynload/_tkinter.so
%files doc
%defattr(-,root,root)
%dir %{_defaultdocdir}/%{name}-%{version}/html/
%{_defaultdocdir}/%{name}-%{version}/html/*
%{_defaultdocdir}/%{name}-%{version}/html/.buildinfo
%dir %{_defaultdocdir}/%{name}-%{version}/doctrees
%{_defaultdocdir}/%{name}-%{version}/doctrees/*
%endif
%changelog
* Fri Jan 01 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.18-2mamba
- updated rpm macros files
* Fri Nov 27 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.18-1mamba
- update to 2.7.18
* Tue Jul 16 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.16-1mamba
- update to 2.7.16
- add missing python_inc in macros.python
* Thu Sep 06 2018 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.15-1mamba
- update to 2.7.15
* Sat May 16 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.9-1mamba
- update to 2.7.9
- macros.python: added pyver_package macro
* Sun Nov 23 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.8-1mamba
- update to 2.7.8
* Sat Feb 15 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-9mamba
- move pyconfig.h and %{__libdir}/python/config from libpython27 to python27
* Mon Jan 20 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-8mamba
- x86_64: build with lib64 patch to install under /usr/lib64
* Thu Dec 05 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-7mamba
- rebuilt with /dev/shm working in x86_64 chroot environment to enable semaphores support
- patch to use system Sphinx
* Mon May 27 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-6mamba
- added upstream patch to fix error: PyArg_ParseTuple is an unrecognized format function type
(see http://bugs.python.org/issue17547)
* Thu May 23 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-5mamba
- libpython-devel: also provide/obsolete python-devel
* Wed May 15 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-4mamba
- make it the default python version
* Tue Mar 26 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-3mamba
- don't remove %{_bindir}/python2.7-config
* Wed Mar 06 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-2mamba
- %{_includedir}/python2.7/pyconfig.h is needed by python runtime, moved
- fixed an error in %py27_version in rmp macros file
* Sat Dec 22 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.7.3-1mamba
- update to 2.7.3
* Fri May 04 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.8-1mamba
- update to 2.6.8
- create and install DLFCN.py (see http://forums.bodhilinux.com/index.php?/topic/4228-python-qt4-designer-pyuic4-no-module-named-dlfcn-solution-found/)
* Tue Apr 10 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.7-1mamba
- update to 2.6.7
- added pkgconfig support files
* Tue Apr 26 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.6-2mamba
- libpython-devel: install pygettext.py and msgfmt.py files for i18n development
* Thu Nov 11 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.6-1mamba
- update to 2.6.6
* Mon Apr 12 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.5-1mamba
- update to 2.6.5
* Fri Jan 08 2010 Davide Madrisan <davide.madrisan@gmail.com> 2.6.4-3mamba
- Lib/platform.py: include openmamba in the list of supported Linux distributions
* Sat Jan 02 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.4-2mamba
- moved libpython2.6.so to main package to fix problem with system-config-printer-kde.py (see http://www.kdedevelopers.org/node/3841)
- added requirement for python-Sphinx and python-Jinja2
* Thu Dec 03 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6.4-1mamba
- update to 2.6.4
* Sun Jan 25 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6-4mamba
- raise alternative priority to overcome python 2.4 and make the default
* Thu Oct 23 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6-3mamba
- python-devel: install rpm's macros.python file
* Thu Oct 16 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 2.6-2mamba
- removed /usr/lib/site-packages directory
- fixed maintainer email
* Thu Oct 02 2008 gil <puntogil@libero.it> 2.6-1mamba
- update to 2.6
* Sat Jun 28 2008 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 2.5.2-1mamba
- update to 2.5.2.
* Wed Jun 25 2008 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 2.4.4-1mamba
- renamed to legacy python24 - changed doc to pdf due to a problem with latex2html
* Fri Mar 30 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.4-1mamba
- update to version 2.4.4 by autospec
* Fri Mar 31 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.4.3-1qilnx
- update to version 2.4.3 by autospec
* Mon Feb 27 2006 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 2.4.2-3qilnx
- added cgi script patch
* Mon Jan 09 2006 Davide Madrisan <davide.madrisan@qilinux.it> 2.4.2-2qilnx
- provides python-abi, python(abi)
* Fri Sep 30 2005 Davide Madrisan <davide.madrisan@qilinux.it> 2.4.2-1qilnx
- update to version 2.4.2 by autospec
- also fix the security issues CAN-2005-1849 and CAN-2005-2096
- patch to build python documentation with TeX3 updated
* Tue Aug 09 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.1-2qilnx
- remove %%pre script
* Thu Jul 21 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4.1-1qilnx
- new version build
* Thu Apr 07 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.5-2qilnx
- remove Xorg-libs dependency by adding subpackage python-tk
* Thu Feb 10 2005 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.5-1qilnx
- update to version 2.3.5 by autospec
- also fix the security issue QSA-2005-013 (CAN-2005-0089)
* Wed Feb 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.5-1qilnx
- rebuilt with shared libraries
* Thu May 27 2004 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.4-1qilnx
- new version rebuild (bugfix release)
- added the doc package with the Python documentation in HTML format
* Wed Dec 24 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 2.3.3-2qilnx
- renamed lib and includes destdir to /usr/include/python
* Tue Dec 23 2003 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.3-1qilnx
- rebuild with Python 2.3.3
* Mon Oct 27 2003 Davide Madrisan <davide.madrisan@qilinux.it> 2.3.2-1qilnx
- rebuild with Python 2.3.2
* Tue Jul 01 2003 Silvan Calarco <silvan.calarco@qinet.it> 2.2.3-1qilnx
- first build