Subject: pkg/14520: Python-2.0.1 package is not embedding friendly
To: None <gnats-bugs@gnats.netbsd.org>
From: Jarkko Torppa <torppa@tuhnu.cutery.fi>
List: netbsd-bugs
Date: 11/10/2001 13:36:00
>Number:         14520
>Category:       pkg
>Synopsis:       python package is not embedding friendly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 10 03:37:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jarkko Torppa
>Release:        NetBSD 1.5.1
>Organization:
Cute Communications Oy
>Environment:
	
System: NetBSD tuhnu.cutery.fi 1.5.2 NetBSD 1.5.2 (TUHNU) #3: Wed Nov 7 20:31:29 EET 2001 root@:/foo/1.5.2/src/sys/arch/i386/compile/TUHNU i386


>Description:

python package builds timemodule,mathmodule and cmathmodule without
-lm these modules fail if they are loaded from embedded interpretter
from program that does not link with -lm

>How-To-Repeat:
try to build mod_python (python embedded into apache) and watch it fail to load without too much explanation as it's first python source imports time.

If mod_python is patched to do the right thing in failure log will say

make_obcallback(): could not import mod_python.apache.
Traceback (most recent call last):
  File "/usr/pkg/lib/python2.0/site-packages/mod_python/apache.py", line 49, in ?
    import time
ImportError: /usr/pkg/lib/python2.0/lib-dynload/timemodule.so: Undefined PLT symbol "fmod" (reloc typ
e = 7, symnum = 43)

>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/python/Makefile,v
retrieving revision 1.24
diff -u -r1.24 Makefile
--- Makefile	2001/10/19 14:24:51	1.24
+++ Makefile	2001/11/10 11:22:15
@@ -2,7 +2,7 @@
 #
 
 DISTNAME=	Python-2.0.1
-PKGNAME=	python-2.0.1
+PKGNAME=	python-2.0.1-nb1
 CATEGORIES=	lang
 MASTER_SITES=	ftp://ftp.python.org/pub/python/2.0.1/
 EXTRACT_SUFX=	.tgz
Index: extension.buildlink.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/python/extension.buildlink.mk,v
retrieving revision 1.3
diff -u -r1.3 extension.buildlink.mk
--- extension.buildlink.mk	2001/10/29 16:34:40	1.3
+++ extension.buildlink.mk	2001/11/10 11:22:15
@@ -58,8 +58,8 @@
 PYTHONBIN=	${LOCALBASE}/bin/python2.1
 PYPKGPREFIX=	py21
 .elif ${_PYTHON_VERSION} == "20"
-#DEPENDS+=	python20>=2.0:../../lang/python20
-DEPENDS+=	python-2.0.1:../../lang/python
+#DEPENDS+=	python20>=2.01:../../lang/python20
+DEPENDS+=	python-2.0.1-nb1:../../lang/python
 PYTHONBIN=	${LOCALBASE}/bin/python2.0
 PYPKGPREFIX=	py20
 .endif
Index: files/Setup.in
===================================================================
RCS file: /cvsroot/pkgsrc/lang/python/files/Setup.in,v
retrieving revision 1.1
diff -u -r1.1 Setup.in
--- Setup.in	2000/10/22 20:01:49	1.1
+++ Setup.in	2001/11/10 11:22:16
@@ -130,11 +130,11 @@
 # Modules that should always be present (non UNIX dependent):
 
 array arraymodule.c	# array objects
-cmath cmathmodule.c # -lm # complex math library functions
-math mathmodule.c # -lm # math library functions, e.g. sin()
+cmath cmathmodule.c -lm # complex math library functions
+math mathmodule.c -lm   # math library functions, e.g. sin()
 strop stropmodule.c	# fast string operations implemented in C
 struct structmodule.c	# binary structure packing/unpacking
-time timemodule.c # -lm # time operations and variables
+time timemodule.c -lm   # time operations and variables
 operator operator.c	# operator.add() and similar goodies
 _codecs _codecsmodule.c	# access to the builtin codecs and codec registry
 

>Release-Note:
>Audit-Trail:
>Unformatted: