Solve python-rpm build. 74/21374/1
authorRonan Le Martret <ronan@fridu.net>
Mon, 19 May 2014 11:27:27 +0000 (13:27 +0200)
committerRonan Le Martret <ronan@fridu.net>
Mon, 19 May 2014 11:27:27 +0000 (13:27 +0200)
Change-Id: Ia2a6823544e96afb9b959a919ef1bd80fff84c45

recipes-tizen/rpm/files/fix-python-rpm-conf.patch [new file with mode: 0644]
recipes-tizen/rpm/files/python-rpm.Makefile.am.patch [new file with mode: 0644]
recipes-tizen/rpm/files/pythondeps.sh [new file with mode: 0755]
recipes-tizen/rpm/rpm-extraconf.inc

diff --git a/recipes-tizen/rpm/files/fix-python-rpm-conf.patch b/recipes-tizen/rpm/files/fix-python-rpm-conf.patch
new file mode 100644 (file)
index 0000000..7e3f313
--- /dev/null
@@ -0,0 +1,17 @@
+diff --git a/configure.ac b/configure.ac
+index e97f727..8179f44 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -540,10 +540,10 @@ esac],
+ AS_IF([test "$enable_python" = yes],[
+   AM_PATH_PYTHON([2.6],[
+-    WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'`
++    WITH_PYTHON_INCLUDE=$(${PKG_CONFIG} --cflags-only-I  python)
+     WITH_PYTHON_SUBPACKAGE=1
+     save_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
++    CPPFLAGS="$CPPFLAGS $WITH_PYTHON_INCLUDE"
+     AC_CHECK_HEADER([Python.h],[],
+       [AC_MSG_ERROR([missing Python.h])
+       ])
diff --git a/recipes-tizen/rpm/files/python-rpm.Makefile.am.patch b/recipes-tizen/rpm/files/python-rpm.Makefile.am.patch
new file mode 100644 (file)
index 0000000..04d3da1
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/python/Makefile.am b/python/Makefile.am
+index fff51ae..f37cb9d 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -4,7 +4,7 @@ EXTRA_DIST = rpm/__init__.py rpm/transaction.py
+ AM_CPPFLAGS = -I$(top_builddir)/include/
+ AM_CPPFLAGS += -I$(top_srcdir)/python
+-AM_CPPFLAGS += -I@WITH_PYTHON_INCLUDE@
++AM_CPPFLAGS += @WITH_PYTHON_INCLUDE@
+ pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la
+ pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py
diff --git a/recipes-tizen/rpm/files/pythondeps.sh b/recipes-tizen/rpm/files/pythondeps.sh
new file mode 100755 (executable)
index 0000000..083b174
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ $# -ge 1 ] || {
+    cat > /dev/null
+    exit 0
+}
+
+case $1 in
+-R|--requires)
+    shift
+    grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
+    exit 0
+    ;;
+esac
+
+exit 0
index da11819..76c55b9 100644 (file)
@@ -2,14 +2,18 @@ SRC_URI += "file://disable_debuginfo.patch \
             file://disable_shortcircuited.patch \
             file://fix_libdir.patch \
             file://rpm-scriptetexechelp.patch \
-            file://rpmmodule.c.patch "
+            file://fix-python-rpm-conf.patch \
+            file://rpmmodule.c.patch \
+            file://python-rpm.Makefile.am.patch \
+            file://pythondeps.sh \
+           "
 
 DEPENDS += "popt-native"
 DEPENDS += "uthash-native"
 DEPENDS += "smack-native"
 DEPENDS += "acl-native"
 DEPENDS += "lua-native"
-DEPENDS += "python"
+DEPENDS += "python-native"
 
 CFLAGS_append = " -DRPM_VENDOR_OE "
 
@@ -22,7 +26,7 @@ do_compile_prepend() {
  unset DISPLAY
  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ;
  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ;
- FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ;
+ FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir }" ; export FFLAGS ;
  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
 
  ### BUILD BEGIN ###
@@ -51,7 +55,7 @@ do_compile() {
  unset DISPLAY
  CFLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" ; export CFLAGS ;
  CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ;
- FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ;
+ FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir }" ; export FFLAGS ;
  LD_AS_NEEDED=1; export LD_AS_NEEDED ;
 
  CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
@@ -63,8 +67,8 @@ do_compile() {
 
 
    CFLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CFLAGS ;
-   CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables}" ; export CXXFLAGS ;
-   FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir}" ; export FFLAGS ;
+   CXXFLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} " ; export CXXFLAGS ;
+   FFLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -I%_fmoddir } " ; export FFLAGS ;
    autoreconf -i -f
    ./configure   --host=${HOST_SYS} \
          --target=x86_64-tizen-linux \
@@ -87,6 +91,7 @@ do_compile() {
      --with-acl \
      --with-cap \
      --enable-shared \
+     --enable-python \
      --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
      --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
      --with-msm \
@@ -195,7 +200,9 @@ do_install_append() {
 
 FILES_${PN}-dbg += "\
     ${libdir}/rpm-plugins/.debug/* \
+    ${libdir}/python2.7/site-packages/rpm/.debug/* \
     "
+
 PROVIDES += " python-rpm "
 
 DEPENDS_native += "popt-native"