]> git.pld-linux.org Git - packages/python.git/commitdiff
Platform independent pyconfig.h
authorJacek Konieczny <jajcus@jajcus.net>
Wed, 2 Dec 2015 19:14:09 +0000 (20:14 +0100)
committerJacek Konieczny <jajcus@jajcus.net>
Wed, 2 Dec 2015 19:14:09 +0000 (20:14 +0100)
/usr/include/python2.X/pyconfig.h will include
%{_libdir}/python2.X/config/pyconfig.h

Should allow multilib python-libs installation.

pyconfig.h.in [new file with mode: 0644]
python-multilib.patch
python.spec

diff --git a/pyconfig.h.in b/pyconfig.h.in
new file mode 100644 (file)
index 0000000..d422b4d
--- /dev/null
@@ -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@PY_VER@/config/pyconfig.h"
+#else
+#include "@PREFIX@/lib64/python@PY_VER@/config/pyconfig.h"
+#endif
+#else
+#include "@PREFIX@/lib/python@PY_VER@/config/pyconfig.h"
+#endif
+#endif
index 4b9f6251a5e0606eac6beda1a1913fe185e0d8f3..1bbc0e1989ea44b5aed40501b41b91edd860f7a6 100644 (file)
@@ -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
index 1e84a5200028bff01e49667d8a69db5392f0f28a..a13f8c3cfbd696f6adf36eca3b67ba55adf370b2 100644 (file)
@@ -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
This page took 0.192402 seconds and 4 git commands to generate.