ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] AM_PYTHON_PATH und mailutils
@ 2010-02-15 10:43 Евгений Ростовцев
  2010-02-16  0:36 ` Dmitry V. Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Евгений Ростовцев @ 2010-02-15 10:43 UTC (permalink / raw)
  To: ldv; +Cc: real, asy, devel

Привет!

Для ldv@:

Для AM_PATH_PYTHON предлагаю такое:
http://git.altlinux.org/people/real/packages/automake_1.11.git?p=automake_1.11.git;a=commitdiff;h=3e686343c9a004a2812073dceec247a239abb0f3

Он ничего не затронет, если специально не использовать эту фичу. Так
что, надеюсь, и апстрим пропустит.

Fix m4/python.m4 for archdep/noarch using
---

diff --git a/m4/python.m4 b/m4/python.m4
index 1dc3985..95a0989 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -34,6 +34,8 @@
 # numbers and dots only.
 AC_DEFUN([AM_PATH_PYTHON],
  [
+AC_ARG_VAR([python_noarch],
+[python_noarch  set python archdep/(=0)noarch(=1 or ="", default is 1])
   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
   dnl supported. (2.0 was released on October 16, 2000).
   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
@@ -121,82 +123,124 @@ python2.1 python2.0])
      else
        am_py_prefix=$prefix
      fi
-     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils
import sysconfig;
sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))"
2>/dev/null ||
-     echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
-     case $am_cv_python_pythondir in
-     $am_py_prefix*)
-       am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
-       am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed
"s,^$am__strip_prefix,$PYTHON_PREFIX,"`
-       ;;
-     *)
-       case $am_py_prefix in
-         /usr|/System*) ;;
-         *)
-	  am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
-	  ;;
-       esac
-       ;;
-     esac
-    ])
-  AC_SUBST([pythondir], [$am_cv_python_pythondir])
-
-  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
-  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
-  dnl   more consistent with the rest of automake.
-
-  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
-
-  dnl pyexecdir -- directory for installing python extension modules
-  dnl   (shared libraries)
-  dnl Query distutils for this directory.  distutils does not exist in
-  dnl Python 1.5, so we fall back to the hardcoded directory if it
-  dnl doesn't work.
-  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
-    [am_cv_python_pyexecdir],
-    [if test "x$exec_prefix" = xNONE
-     then
-       am_py_exec_prefix=$am_py_prefix
-     else
-       am_py_exec_prefix=$exec_prefix
-     fi
-     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils
import sysconfig;
sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))"
2>/dev/null ||
-     echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
-     case $am_cv_python_pyexecdir in
-     $am_py_exec_prefix*)
-       am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
-       am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed
"s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
-       ;;
-     *)
-       case $am_py_exec_prefix in
-         /usr|/System*) ;;
-         *)
-	   am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
-	   ;;
-       esac
-       ;;
-     esac
-    ])
-  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
-
-  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
-
-  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
-
-  dnl Run any user-specified action.
-  $2
-  fi
-
-])
-
-
-# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-# ---------------------------------------------------------------------------
-# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
-# Run ACTION-IF-FALSE otherwise.
-# This test uses sys.hexversion instead of the string equivalent (first
-# word of sys.version), in order to cope with versions such as 2.2c1.
-# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
-AC_DEFUN([AM_PYTHON_CHECK_VERSION],
+		 if test "$python_noarch" = "0"  && test "`uname -m`" = "x86_64" ; then
+			 libsuff='64'
+			 am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils
import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1))"
2>/dev/null ||
+			 echo "$PYTHON_PREFIX/lib$libsuff/python$PYTHON_VERSION/site-packages"`
+			 case $am_cv_python_pythondir in
+				 $am_py_prefix*)
+					 am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+					 #am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed
"s,^$am__strip_prefix,$PYTHON_PREFIX,"`
+					 ;;
+				 *)
+					 case $am_py_prefix in
+						 /usr|/System*) ;;
+						 *)
+							 am_cv_python_pythondir=$PYTHON_PREFIX/lib$libsuff/python$PYTHON_VERSION/site-packages
+						 ;;
+					 esac
+				 ;;
+			 esac
+		 else
+				 libsuff=
+				 am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils
import sysconfig;
sys.stdout.write(sysconfig.get_python_lib(0,0,'$PYTHON_PREFIX'))"
2>/dev/null ||
+				 echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+				 case $am_cv_python_pythondir in
+					 $am_py_prefix*)
+						 am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+						 #am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed
"s,^$am__strip_prefix,$PYTHON_PREFIX,"`
+						 ;;
+					 *)
+						 case $am_py_prefix in
+							 /usr|/System*) ;;
+							 *)
+								am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
+						 	;;
+						esac
+					 ;;
+				 esac
+			 fi
+			])
+		AC_SUBST([pythondir], [$am_cv_python_pythondir])
+
+		dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
+		dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
+		dnl   more consistent with the rest of automake.
+
+		AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
+
+		dnl pyexecdir -- directory for installing python extension modules
+		dnl   (shared libraries)
+		dnl Query distutils for this directory.  distutils does not exist in
+		dnl Python 1.5, so we fall back to the hardcoded directory if it
+		dnl doesn't work.
+		AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
+			[am_cv_python_pyexecdir],
+			[if test "x$exec_prefix" = xNONE
+			 then
+				 am_py_exec_prefix=$am_py_prefix
+			 else
+				 am_py_exec_prefix=$exec_prefix
+			 fi
+			 if test "$python_noarch" = "0" && test "`uname -m`" = "x86_64" ; then
+				 libsuff='64'
+				 am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils
import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1))"
2>/dev/null ||
+				 echo "$PYTHON_EXEC_PREFIX/lib$libsuff/python$PYTHON_VERSION/site-packages"`
+				 case $am_cv_python_pyexecdir in
+					 $am_py_exec_prefix*)
+						 am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+						 #am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed
"s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
+						 ;;
+					 *)
+						 case $am_py_exec_prefix in
+							 /usr|/System*) ;;
+							 *)
+					 am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib$libfuff/python$PYTHON_VERSION/site-packages
+					 ;;
+						 esac
+						 ;;
+				 esac
+			 else
+				 libsuff=
+				 am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils
import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0))"
2>/dev/null ||
+				 echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"`
+				 case $am_cv_python_pyexecdir in
+				 $am_py_exec_prefix*)
+					 am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+					 #am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed
"s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
+					 ;;
+				 *)
+					 case $am_py_exec_prefix in
+						 /usr|/System*) ;;
+						 *)
+				 am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
+				 ;;
+					 esac
+					 ;;
+				 esac
+			 fi
+			])
+		AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
+
+		dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
+
+		AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
+
+		dnl Run any user-specified action.
+		$2
+		fi
+
+	])
+
+
+	# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+	# ---------------------------------------------------------------------------
+	# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
+	# Run ACTION-IF-FALSE otherwise.
+	# This test uses sys.hexversion instead of the string equivalent (first
+	# word of sys.version), in order to cope with versions such as 2.2c1.
+	# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
+	AC_DEFUN([AM_PYTHON_CHECK_VERSION],
  [prog="import sys
 # split strings by '.' and convert to numeric.  Append some zeros
 # because we need at least 4 digits for the hex conversion.

А это для asy@ (mailutils):

1. Оставляем Ваш mailutils/configure.ac, впрочем, он и в моём
репозитории восстановлен.

2. http://git.altlinux.org/people/real/packages/mailutils.git?p=mailutils.git;a=commitdiff;h=5d1c4941972466829996be6bb04d16275f9ce96d

Я там немного подрихтовал спек, но сильно не увлекался. Для Вас
главное - параметр python_noarch=0 (единица или вообще пропущен
параметр - и всё будет собираться как сейчас, всё пихая в
%_libexecdir/python2.6) и замена %make_build на %make (сломалась
параллельная сборка).

- Fixed install of python
---

diff --git a/mailutils.spec b/mailutils.spec
index b0268cf..4f088b6 100644
--- a/mailutils.spec
+++ b/mailutils.spec
@@ -209,22 +209,23 @@ Python bindings for GNU Mailutils.
 %setup -q
 %endif

-%patch1 -p0
-sed -i "s|@TOP@|$PWD|" configure.ac
+#patch1 -p0

 gzip ChangeLog

 %build

+rm -f aclocal.m4
 %autoreconf
-sed -i 's|get_python_lib[^)]*|get_python_lib(1|' aclocal.m4

 %set_verify_elf_method unresolved=relaxed

 CFLAGS="-ltinfo"
-%configure --enable-mh-utils --with-mh-bindir=%_libexecdir/mu-mh
+%configure --enable-mh-utils --with-mh-bindir=%_libexecdir/mu-mh \
+	python_noarch=0

-%make_build
+# parallel build is broken
+%make

 %check

@@ -358,9 +359,8 @@ rm -f $RPM_BUILD_ROOT%python_sitelibdir/mailutils/c_api.la
 %python_sitelibdir/mailutils/*.py*

 %changelog
-* Sun Feb 07 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org>
2.1-alt0.20091105.4
-- Fixed get_python_lib using
-- configure: .la war
+* Mon Feb 15 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org>
2.1-alt0.20091105.4
+- Fixed install of python

 * Sun Jan 31 2010 Sergey Y. Afonin <asy@altlinux.ru> 2.1-alt0.20091105.3
 - created symlinks (for better exchangeability with the mailx package):


-- 
REAL aka Евгений Ростовцев, программист ЦНИТ КемГУ


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-10  3:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-15 10:43 [devel] AM_PYTHON_PATH und mailutils Евгений Ростовцев
2010-02-16  0:36 ` Dmitry V. Levin
2010-02-16  8:45   ` Евгений Ростовцев
2010-02-16 15:04     ` Dmitry V. Levin
2012-01-07 16:18       ` Dubrovskiy Viacheslav
2012-01-10  3:34         ` REAL

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git