[packages/python] Platform independent pyconfig.h
jajcus
jajcus at pld-linux.org
Wed Dec 2 20:15:34 CET 2015
commit 59012690058b4f81553a5dfefb3411e72f82d7a5
Author: Jacek Konieczny <jajcus at jajcus.net>
Date: Wed Dec 2 20:14:09 2015 +0100
Platform independent pyconfig.h
/usr/include/python2.X/pyconfig.h will include
%{_libdir}/python2.X/config/pyconfig.h
Should allow multilib python-libs installation.
pyconfig.h.in | 11 +++++++++++
python-multilib.patch | 41 +++++++++++++++++++++++++----------------
python.spec | 19 +++++++------------
3 files changed, 43 insertions(+), 28 deletions(-)
---
diff --git a/python.spec b/python.spec
index 1e84a52..a13f8c3 100644
--- a/python.spec
+++ b/python.spec
@@ -44,7 +44,7 @@ Summary(tr.UTF-8): X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
Summary(uk.UTF-8): Мова програмування дуже високого рівня з X-інтерфейсом
Name: python
Version: %{py_ver}.10
-Release: 6.1
+Release: 6.2
Epoch: 1
License: PSF
Group: Development/Languages/Python
@@ -52,6 +52,7 @@ Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}%{beta}.ta
# Source0-md5: c685ef0b8e9f27b5e3db5db12b268ac6
Source1: http://www.python.org/ftp/python/doc/%{dver}/%{name}-%{dver}-docs-html.tar.bz2
# Source1-md5: 545fef39b52b15641f6936c623150c63
+Source2: pyconfig.h.in
Patch0: %{name}-db.patch
Patch1: %{name}-pythonpath.patch
Patch2: %{name}-ac_fixes.patch
@@ -690,21 +691,16 @@ find $RPM_BUILD_ROOT%{py_libdir} -name \*.bat -exec rm {} \;
find $RPM_BUILD_ROOT%{py_libdir} -name \*.txt -exec rm {} \;
find $RPM_BUILD_ROOT%{py_libdir} -name README\* -exec rm {} \;
-mv $RPM_BUILD_ROOT%{py_incdir}/{pyconfig.h,pyconfig-%{_target_cpu}.h}
-ln -s pyconfig-%{_target_cpu}.h $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h
+mv $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h $RPM_BUILD_ROOT%{py_libdir}/config/pyconfig.h
+sed -e's#@PREFIX@#%{_prefix}#g;s#@PY_VER@#%{py_ver}#g' %{SOURCE2} > $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h
%clean
rm -rf $RPM_BUILD_ROOT
-%post libs
-/sbin/ldconfig || :
-[ -e %{py_incdir}/pyconfig.h ] || ln -s pyconfig-%{_target_cpu}.h %{py_incdir}/pyconfig.h || :
+%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
-%post devel
-ln -sf pyconfig-%{_target_cpu}.h %{py_incdir}/pyconfig.h || :
-
%post doc-info -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}
@@ -942,9 +938,9 @@ ln -sf pyconfig-%{_target_cpu}.h %{py_incdir}/pyconfig.h || :
# required by sysconfig.py
%dir %{py_libdir}/config
%{py_libdir}/config/Makefile
+%{py_libdir}/config/pyconfig.h
%dir %{py_incdir}
-%ghost %{py_incdir}/pyconfig.h
-%{py_incdir}/pyconfig-%{_target_cpu}.h
+%{py_incdir}/pyconfig.h
%files -n pydoc
%defattr(644,root,root,755)
@@ -971,7 +967,6 @@ ln -sf pyconfig-%{_target_cpu}.h %{py_incdir}/pyconfig.h || :
%attr(755,root,root) %{_libdir}/libpython.so
%{py_incdir}/*.h
%exclude %{py_incdir}/pyconfig.h
-%exclude %{py_incdir}/pyconfig-%{_target_cpu}.h
%{_pkgconfigdir}/python.pc
%{_pkgconfigdir}/python2.pc
%{_pkgconfigdir}/python-%{py_ver}.pc
diff --git a/pyconfig.h.in b/pyconfig.h.in
new file mode 100644
index 0000000..d422b4d
--- /dev/null
+++ b/pyconfig.h.in
@@ -0,0 +1,11 @@
+#ifndef Py_PYCONFIG_H
+#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
+#if defined(__ILP32__)
+#include "@PREFIX@/libx32/python at PY_VER@/config/pyconfig.h"
+#else
+#include "@PREFIX@/lib64/python at PY_VER@/config/pyconfig.h"
+#endif
+#else
+#include "@PREFIX@/lib/python at PY_VER@/config/pyconfig.h"
+#endif
+#endif
diff --git a/python-multilib.patch b/python-multilib.patch
index 4b9f625..1bbc0e1 100644
--- a/python-multilib.patch
+++ b/python-multilib.patch
@@ -1,6 +1,6 @@
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Include/pythonrun.h Python-2.7.10/Include/pythonrun.h
--- Python-2.7.10.orig/Include/pythonrun.h 2015-05-23 18:09:00.000000000 +0200
-+++ Python-2.7.10/Include/pythonrun.h 2015-12-02 17:54:33.560101256 +0100
++++ Python-2.7.10/Include/pythonrun.h 2015-12-02 19:31:20.058862685 +0100
@@ -108,6 +108,8 @@
/* In their own files */
PyAPI_FUNC(const char *) Py_GetVersion(void);
@@ -12,7 +12,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Include/pythonrun.h Python-2.7
PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/distutils/command/install.py Python-2.7.10/Lib/distutils/command/install.py
--- Python-2.7.10.orig/Lib/distutils/command/install.py 2015-05-23 18:09:01.000000000 +0200
-+++ Python-2.7.10/Lib/distutils/command/install.py 2015-12-02 17:54:33.560101256 +0100
++++ Python-2.7.10/Lib/distutils/command/install.py 2015-12-02 19:31:20.058862685 +0100
@@ -22,6 +22,8 @@
from site import USER_SITE
@@ -44,7 +44,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/distutils/command/install.
'data' : '$base',
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/distutils/sysconfig.py Python-2.7.10/Lib/distutils/sysconfig.py
--- Python-2.7.10.orig/Lib/distutils/sysconfig.py 2015-05-23 18:09:02.000000000 +0200
-+++ Python-2.7.10/Lib/distutils/sysconfig.py 2015-12-02 17:57:40.004593153 +0100
++++ Python-2.7.10/Lib/distutils/sysconfig.py 2015-12-02 19:31:20.058862685 +0100
@@ -119,8 +119,12 @@
prefix = plat_specific and EXEC_PREFIX or PREFIX
@@ -62,7 +62,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/distutils/sysconfig.py Pyt
else:
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/distutils/tests/test_install.py Python-2.7.10/Lib/distutils/tests/test_install.py
--- Python-2.7.10.orig/Lib/distutils/tests/test_install.py 2015-05-23 18:09:02.000000000 +0200
-+++ Python-2.7.10/Lib/distutils/tests/test_install.py 2015-12-02 17:54:33.560101256 +0100
++++ Python-2.7.10/Lib/distutils/tests/test_install.py 2015-12-02 19:31:20.058862685 +0100
@@ -56,7 +56,7 @@
expected = os.path.normpath(expected)
self.assertEqual(got, expected)
@@ -74,7 +74,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/distutils/tests/test_insta
check_path(cmd.install_purelib, libdir)
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/site.py Python-2.7.10/Lib/site.py
--- Python-2.7.10.orig/Lib/site.py 2015-05-23 18:09:06.000000000 +0200
-+++ Python-2.7.10/Lib/site.py 2015-12-02 17:59:13.041917804 +0100
++++ Python-2.7.10/Lib/site.py 2015-12-02 19:31:20.058862685 +0100
@@ -288,13 +288,17 @@
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
@@ -98,7 +98,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/site.py Python-2.7.10/Lib/
# locations.
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/sysconfig.py Python-2.7.10/Lib/sysconfig.py
--- Python-2.7.10.orig/Lib/sysconfig.py 2015-05-23 18:09:07.000000000 +0200
-+++ Python-2.7.10/Lib/sysconfig.py 2015-12-02 17:54:33.563434609 +0100
++++ Python-2.7.10/Lib/sysconfig.py 2015-12-02 19:33:48.483250053 +0100
@@ -5,22 +5,24 @@
import os
from os.path import pardir, realpath
@@ -147,9 +147,18 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/sysconfig.py Python-2.7.10
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data' : '{userbase}',
+@@ -409,7 +411,7 @@
+ else:
+ inc_dir = _PROJECT_BASE
+ else:
+- inc_dir = get_path('platinclude')
++ inc_dir = os.path.join(get_path('platstdlib'), "config")
+ return os.path.join(inc_dir, 'pyconfig.h')
+
+ def get_scheme_names():
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/test/test_site.py Python-2.7.10/Lib/test/test_site.py
--- Python-2.7.10.orig/Lib/test/test_site.py 2015-05-23 18:09:12.000000000 +0200
-+++ Python-2.7.10/Lib/test/test_site.py 2015-12-02 17:54:42.220155116 +0100
++++ Python-2.7.10/Lib/test/test_site.py 2015-12-02 19:31:20.058862685 +0100
@@ -226,7 +226,7 @@
if sys.platform in ('os2emx', 'riscos'):
@@ -182,8 +191,8 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Lib/test/test_site.py Python-2
class PthFile(object):
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Makefile.pre.in Python-2.7.10/Makefile.pre.in
---- Python-2.7.10.orig/Makefile.pre.in 2015-12-02 17:53:51.063166393 +0100
-+++ Python-2.7.10/Makefile.pre.in 2015-12-02 17:54:33.560101256 +0100
+--- Python-2.7.10.orig/Makefile.pre.in 2015-12-02 19:31:01.322061528 +0100
++++ Python-2.7.10/Makefile.pre.in 2015-12-02 19:31:20.058862685 +0100
@@ -87,6 +87,8 @@
# Machine-dependent subdirectories
@@ -213,7 +222,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Makefile.pre.in Python-2.7.10/
$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Modules/getpath.c Python-2.7.10/Modules/getpath.c
--- Python-2.7.10.orig/Modules/getpath.c 2015-05-23 18:09:20.000000000 +0200
-+++ Python-2.7.10/Modules/getpath.c 2015-12-02 17:54:33.563434609 +0100
++++ Python-2.7.10/Modules/getpath.c 2015-12-02 19:31:20.062196042 +0100
@@ -116,9 +116,21 @@
#define EXEC_PREFIX PREFIX
#endif
@@ -249,7 +258,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Modules/getpath.c Python-2.7.1
reduce(char *dir)
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Python/getplatform.c Python-2.7.10/Python/getplatform.c
--- Python-2.7.10.orig/Python/getplatform.c 2015-05-23 18:09:24.000000000 +0200
-+++ Python-2.7.10/Python/getplatform.c 2015-12-02 17:54:33.563434609 +0100
++++ Python-2.7.10/Python/getplatform.c 2015-12-02 19:31:20.062196042 +0100
@@ -10,3 +10,23 @@
{
return PLATFORM;
@@ -276,7 +285,7 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Python/getplatform.c Python-2.
+}
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Python/sysmodule.c Python-2.7.10/Python/sysmodule.c
--- Python-2.7.10.orig/Python/sysmodule.c 2015-05-23 18:09:24.000000000 +0200
-+++ Python-2.7.10/Python/sysmodule.c 2015-12-02 17:54:33.563434609 +0100
++++ Python-2.7.10/Python/sysmodule.c 2015-12-02 19:31:20.062196042 +0100
@@ -1437,6 +1437,10 @@
PyString_FromString(Py_GetCopyright()));
SET_SYS_FROM_STRING("platform",
@@ -289,8 +298,8 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/Python/sysmodule.c Python-2.7.
PyString_FromString(Py_GetProgramFullPath()));
SET_SYS_FROM_STRING("prefix",
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/configure.ac Python-2.7.10/configure.ac
---- Python-2.7.10.orig/configure.ac 2015-12-02 17:53:51.063166393 +0100
-+++ Python-2.7.10/configure.ac 2015-12-02 17:54:33.560101256 +0100
+--- Python-2.7.10.orig/configure.ac 2015-12-02 19:31:01.322061528 +0100
++++ Python-2.7.10/configure.ac 2015-12-02 19:31:20.062196042 +0100
@@ -739,6 +739,44 @@
;;
esac
@@ -337,8 +346,8 @@ diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/configure.ac Python-2.7.10/con
AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
diff -durN -x '*~' -x '*.orig' Python-2.7.10.orig/setup.py Python-2.7.10/setup.py
---- Python-2.7.10.orig/setup.py 2015-12-02 17:53:51.053166330 +0100
-+++ Python-2.7.10/setup.py 2015-12-02 17:54:33.563434609 +0100
+--- Python-2.7.10.orig/setup.py 2015-12-02 19:31:01.312061456 +0100
++++ Python-2.7.10/setup.py 2015-12-02 19:31:20.062196042 +0100
@@ -496,6 +496,7 @@
except NameError:
have_unicode = 0
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python.git/commitdiff/59012690058b4f81553a5dfefb3411e72f82d7a5
More information about the pld-cvs-commit
mailing list