Wed Sep 9 05:37:52 2009 UTC ()
Fix a possibly long-standing issue, but also possibly fallout from the db4
changes.  The "dbm" module could fail to build correctly, erroring out with:

*** WARNING: renaming "dbm" since importing it failed: build/lib.linux-i686-2.5/dbm.so: undefined symbol: dbm_firstkey

In this case, the "dbm" module has accidentally linked with "databases/gdbm",
which happens to be installed, but was never buildlinked in.  It may be
relevant that /usr/include/gdbm/ndbm.h is installed on this system.

Remove the "gdbm" test from the "dbm" module configuration, leaving the "ndbm"
support, and the fall-back "bdb" support (which will likely fall back to db4).

Bump PKGREVISION - the package would still install, but with missing
functionality.


(dsainty)
diff -r1.18 -r1.19 pkgsrc/lang/python25/Makefile
diff -r1.9 -r1.10 pkgsrc/lang/python25/distinfo
diff -r1.3 -r1.4 pkgsrc/lang/python25/patches/patch-am

cvs diff -r1.18 -r1.19 pkgsrc/lang/python25/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python25/Attic/Makefile 2009/09/08 10:06:35 1.18
+++ pkgsrc/lang/python25/Attic/Makefile 2009/09/09 05:37:51 1.19
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1# $NetBSD: Makefile,v 1.18 2009/09/08 10:06:35 drochner Exp $ 1# $NetBSD: Makefile,v 1.19 2009/09/09 05:37:51 dsainty Exp $
2 2
3DISTNAME= Python-2.5.4 3DISTNAME= Python-2.5.4
4PKGNAME= python25-2.5.4 4PKGNAME= python25-2.5.4
5PKGREVISION= 2 5PKGREVISION= 3
6CATEGORIES= lang python 6CATEGORIES= lang python
7MASTER_SITES= http://www.python.org/ftp/python/2.5.4/ 7MASTER_SITES= http://www.python.org/ftp/python/2.5.4/
8EXTRACT_SUFX= .tar.bz2 8EXTRACT_SUFX= .tar.bz2
9 9
10MAINTAINER= recht@NetBSD.org 10MAINTAINER= recht@NetBSD.org
11HOMEPAGE= http://www.python.org/ 11HOMEPAGE= http://www.python.org/
12COMMENT= Interpreted, interactive, object-oriented programming language 12COMMENT= Interpreted, interactive, object-oriented programming language
13 13
14PKG_DESTDIR_SUPPORT= user-destdir 14PKG_DESTDIR_SUPPORT= user-destdir
15 15
16# Remember to update pkgsrc/lang/python/srcdist.mk when version changes 16# Remember to update pkgsrc/lang/python/srcdist.mk when version changes
17 17
18CONFLICTS+= python-[0-9]* 18CONFLICTS+= python-[0-9]*

cvs diff -r1.9 -r1.10 pkgsrc/lang/python25/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/python25/Attic/distinfo 2009/07/24 14:50:33 1.9
+++ pkgsrc/lang/python25/Attic/distinfo 2009/09/09 05:37:51 1.10
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1$NetBSD: distinfo,v 1.9 2009/07/24 14:50:33 schmonz Exp $ 1$NetBSD: distinfo,v 1.10 2009/09/09 05:37:51 dsainty Exp $
2 2
3SHA1 (Python-2.5.4.tar.bz2) = 0f2e819d6381f72f26c734e00a6780b3933ea404 3SHA1 (Python-2.5.4.tar.bz2) = 0f2e819d6381f72f26c734e00a6780b3933ea404
4RMD160 (Python-2.5.4.tar.bz2) = 3a76c83464c3b1c38a60351ab054e33ac7195663 4RMD160 (Python-2.5.4.tar.bz2) = 3a76c83464c3b1c38a60351ab054e33ac7195663
5Size (Python-2.5.4.tar.bz2) = 9821313 bytes 5Size (Python-2.5.4.tar.bz2) = 9821313 bytes
6SHA1 (patch-aa) = d44e67645dc86ff14f5daf5705de02c6f330cc48 6SHA1 (patch-aa) = d44e67645dc86ff14f5daf5705de02c6f330cc48
7SHA1 (patch-ab) = d35025df83e70d129f9fbcd277652b0eea83b026 7SHA1 (patch-ab) = d35025df83e70d129f9fbcd277652b0eea83b026
8SHA1 (patch-ac) = 4de5b8dc20b41dc3bb4acd38011ef59570318d3f 8SHA1 (patch-ac) = 4de5b8dc20b41dc3bb4acd38011ef59570318d3f
9SHA1 (patch-ad) = eb4948ee5aaae93f8a193defac7638a37f65caed 9SHA1 (patch-ad) = eb4948ee5aaae93f8a193defac7638a37f65caed
10SHA1 (patch-ae) = 5425515c6bf130eee204ca2749386f6447eaa35b 10SHA1 (patch-ae) = 5425515c6bf130eee204ca2749386f6447eaa35b
11SHA1 (patch-ag) = 95be54a4c8fe291cd7edd14a9180bbcb07bba2ce 11SHA1 (patch-ag) = 95be54a4c8fe291cd7edd14a9180bbcb07bba2ce
12SHA1 (patch-ah) = 98e9fa55c2af38d8032398cae693492c199dc5fa 12SHA1 (patch-ah) = 98e9fa55c2af38d8032398cae693492c199dc5fa
13SHA1 (patch-ai) = a89bee00860910f53a23b1c670d9c091846a03c1 13SHA1 (patch-ai) = a89bee00860910f53a23b1c670d9c091846a03c1
14SHA1 (patch-aj) = a75d680a6b8b1ad3c9222dcb841f4fb10db6d16d 14SHA1 (patch-aj) = a75d680a6b8b1ad3c9222dcb841f4fb10db6d16d
15SHA1 (patch-ak) = 948362c15ad59abeef46971f9b870b70655a62c7 15SHA1 (patch-ak) = 948362c15ad59abeef46971f9b870b70655a62c7
16SHA1 (patch-al) = 6247e3f85d555bae7850befbd7bfffbb233cecb3 16SHA1 (patch-al) = 6247e3f85d555bae7850befbd7bfffbb233cecb3
17SHA1 (patch-am) = 8910340d0a54ac0a053d50199e0dd77162c3b613 17SHA1 (patch-am) = f444bb78a0ca8ea3fa3435e5946c8d9251cb5102
18SHA1 (patch-an) = 17b4e17b3b562c29a050e9bb20447084ce82b8ab 18SHA1 (patch-an) = 17b4e17b3b562c29a050e9bb20447084ce82b8ab
19SHA1 (patch-ao) = 9bbd5561c010e0a1ab8e0a70d27a5f77fd2089d2 19SHA1 (patch-ao) = 9bbd5561c010e0a1ab8e0a70d27a5f77fd2089d2
20SHA1 (patch-ap) = b864db92761c843a91374663bd2dbcfa57b317cf 20SHA1 (patch-ap) = b864db92761c843a91374663bd2dbcfa57b317cf
21SHA1 (patch-ar) = 2a0c3f9a798afdfda7af4823e67579b2e000c072 21SHA1 (patch-ar) = 2a0c3f9a798afdfda7af4823e67579b2e000c072
22SHA1 (patch-at) = 6fdd64ce70eb8c2de5336f3415f45bc467e46373 22SHA1 (patch-at) = 6fdd64ce70eb8c2de5336f3415f45bc467e46373
23SHA1 (patch-au) = c1a759765095d246151ba027ed06f423e05c9218 23SHA1 (patch-au) = c1a759765095d246151ba027ed06f423e05c9218
24SHA1 (patch-av) = a1d41cb3a93879d54f0964ff84a63a297c333156 24SHA1 (patch-av) = a1d41cb3a93879d54f0964ff84a63a297c333156

cvs diff -r1.3 -r1.4 pkgsrc/lang/python25/patches/Attic/patch-am (expand / switch to unified diff)

--- pkgsrc/lang/python25/patches/Attic/patch-am 2009/07/24 14:50:33 1.3
+++ pkgsrc/lang/python25/patches/Attic/patch-am 2009/09/09 05:37:51 1.4
@@ -1,57 +1,57 @@ @@ -1,57 +1,57 @@
1$NetBSD: patch-am,v 1.3 2009/07/24 14:50:33 schmonz Exp $ 1$NetBSD: patch-am,v 1.4 2009/09/09 05:37:51 dsainty Exp $
2 2
3--- setup.py.orig 2008-10-16 14:58:19.000000000 -0400 3--- setup.py.orig 2008-10-16 14:58:19.000000000 -0400
4+++ setup.py 4+++ setup.py
5@@ -15,7 +15,7 @@ from distutils.command.install import in 5@@ -15,7 +15,7 @@
6 from distutils.command.install_lib import install_lib 6 from distutils.command.install_lib import install_lib
7  7
8 # This global variable is used to hold the list of modules to be disabled. 8 # This global variable is used to hold the list of modules to be disabled.
9-disabled_module_list = [] 9-disabled_module_list = []
10+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"] 10+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite", "_tkinter", "bsddb", "cjkcodecs" "gdbm", "mpz", "expat", "readline"]
11  11
12 def add_dir_to_list(dirlist, dir): 12 def add_dir_to_list(dirlist, dir):
13 """Add the directory 'dir' to the list 'dirlist' (at the front) if 13 """Add the directory 'dir' to the list 'dirlist' (at the front) if
14@@ -243,9 +243,15 @@ class PyBuildExt(build_ext): 14@@ -243,9 +243,15 @@
15 return sys.platform 15 return sys.platform
16  16
17 def detect_modules(self): 17 def detect_modules(self):
18- # Ensure that /usr/local is always used 18- # Ensure that /usr/local is always used
19- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 19- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
20- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 20- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
21+ # Add the buildlink directories for pkgsrc 21+ # Add the buildlink directories for pkgsrc
22+ if os.environ.has_key('BUILDLINK_DIR'): 22+ if os.environ.has_key('BUILDLINK_DIR'):
23+ dir = os.environ['BUILDLINK_DIR'] 23+ dir = os.environ['BUILDLINK_DIR']
24+ libdir = dir + '/lib' 24+ libdir = dir + '/lib'
25+ incdir = dir + '/include' 25+ incdir = dir + '/include'
26+ if libdir not in self.compiler.library_dirs: 26+ if libdir not in self.compiler.library_dirs:
27+ self.compiler.library_dirs.insert(0, libdir) 27+ self.compiler.library_dirs.insert(0, libdir)
28+ if incdir not in self.compiler.include_dirs: 28+ if incdir not in self.compiler.include_dirs:
29+ self.compiler.include_dirs.insert(0, incdir) 29+ self.compiler.include_dirs.insert(0, incdir)
30  30
31 # Add paths specified in the environment variables LDFLAGS and 31 # Add paths specified in the environment variables LDFLAGS and
32 # CPPFLAGS for header and library files. 32 # CPPFLAGS for header and library files.
33@@ -534,9 +540,7 @@ class PyBuildExt(build_ext): 33@@ -534,9 +540,7 @@
34 if krb5_h: 34 if krb5_h:
35 ssl_incs += krb5_h 35 ssl_incs += krb5_h
36 ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, 36 ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
37- ['/usr/local/ssl/lib', 37- ['/usr/local/ssl/lib',
38- '/usr/contrib/ssl/lib/' 38- '/usr/contrib/ssl/lib/'
39- ] ) 39- ] )
40+ [] ) 40+ [] )
41  41
42 if (ssl_incs is not None and 42 if (ssl_incs is not None and
43 ssl_libs is not None): 43 ssl_libs is not None):
44@@ -609,269 +613,51 @@ class PyBuildExt(build_ext): 44@@ -609,269 +613,51 @@
45 # a release. Most open source OSes come with one or more 45 # a release. Most open source OSes come with one or more
46 # versions of BerkeleyDB already installed. 46 # versions of BerkeleyDB already installed.
47  47
48- max_db_ver = (4, 5) 48- max_db_ver = (4, 5)
49- # NOTE: while the _bsddb.c code links against BerkeleyDB 4.6.x 49- # NOTE: while the _bsddb.c code links against BerkeleyDB 4.6.x
50- # we leave that version disabled by default as it has proven to be 50- # we leave that version disabled by default as it has proven to be
51- # quite a buggy library release on many platforms. 51- # quite a buggy library release on many platforms.
52- min_db_ver = (3, 3) 52- min_db_ver = (3, 3)
53- db_setup_debug = False # verbose debug prints from this script? 53- db_setup_debug = False # verbose debug prints from this script?
54- 54-
55- # construct a list of paths to look for the header file in on 55- # construct a list of paths to look for the header file in on
56- # top of the normal inc_dirs. 56- # top of the normal inc_dirs.
57- db_inc_paths = [ 57- db_inc_paths = [
@@ -280,111 +280,108 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50 @@ -280,111 +280,108 @@ $NetBSD: patch-am,v 1.3 2009/07/24 14:50
280+ bsddb185_define_macros=[('HAVE_DB_185_H',1)] 280+ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
281+ dblib_dir = [os.environ['PY_BDB_LIBDIRS']] 281+ dblib_dir = [os.environ['PY_BDB_LIBDIRS']]
282 else: 282 else:
283- sqlite_extra_link_args = () 283- sqlite_extra_link_args = ()
284- 284-
285- exts.append(Extension('_sqlite3', sqlite_srcs, 285- exts.append(Extension('_sqlite3', sqlite_srcs,
286- define_macros=sqlite_defines, 286- define_macros=sqlite_defines,
287- include_dirs=["Modules/_sqlite", 287- include_dirs=["Modules/_sqlite",
288- sqlite_incdir], 288- sqlite_incdir],
289- library_dirs=sqlite_libdir, 289- library_dirs=sqlite_libdir,
290- runtime_library_dirs=sqlite_libdir, 290- runtime_library_dirs=sqlite_libdir,
291- extra_link_args=sqlite_extra_link_args, 291- extra_link_args=sqlite_extra_link_args,
292- libraries=["sqlite3",])) 292- libraries=["sqlite3",]))
293- 293+ # check if db_incs/db.h really is db 1.85
 294+ f = "%s/db.h" % db_incs[0]
 295+ if os.path.exists(f):
 296+ data = open(f).read()
 297+ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
 298+ if m is None:
 299+ # check for 1.85 compat header
 300+ if os.path.exists("%s/db_185.h" % db_incs[0]):
 301+ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
 302+ else:
 303+ raise NotFound
 304+ try:
 305+ bltransform = os.environ['PY_BDB_TRANSFORM']
 306+ m = re.search(r"l:db:(db.)\s*", bltransform)
 307+ if m is not None and m.group(1) is not None:
 308+ dblibs = [m.group(1)]
 309+ except:
 310+ pass
 311
294- # Look for Berkeley db 1.85. Note that it is built as a different 312- # Look for Berkeley db 1.85. Note that it is built as a different
295- # module name so it can be included even when later versions are 313- # module name so it can be included even when later versions are
296- # available. A very restrictive search is performed to avoid 314- # available. A very restrictive search is performed to avoid
297- # accidentally building this module with a later version of the 315- # accidentally building this module with a later version of the
298- # underlying db library. May BSD-ish Unixes incorporate db 1.85 316- # underlying db library. May BSD-ish Unixes incorporate db 1.85
299- # symbols into libc and place the include file in /usr/include. 317- # symbols into libc and place the include file in /usr/include.
300- # 318- #
301- # If the better bsddb library can be built (db_incs is defined) 319- # If the better bsddb library can be built (db_incs is defined)
302- # we do not build this one. Otherwise this build will pick up 320- # we do not build this one. Otherwise this build will pick up
303- # the more recent berkeleydb's db.h file first in the include path 321- # the more recent berkeleydb's db.h file first in the include path
304- # when attempting to compile and it will fail. 322- # when attempting to compile and it will fail.
305- f = "/usr/include/db.h" 323- f = "/usr/include/db.h"
306- if os.path.exists(f) and not db_incs: 324- if os.path.exists(f) and not db_incs:
307- data = open(f).read() 325- data = open(f).read()
308- m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) 326- m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
309- if m is not None: 327- if m is not None:
310- # bingo - old version used hash file format version 2 328- # bingo - old version used hash file format version 2
311- ### XXX this should be fixed to not be platform-dependent 329- ### XXX this should be fixed to not be platform-dependent
312- ### but I don't have direct access to an osf1 platform and 330- ### but I don't have direct access to an osf1 platform and
313- ### seemed to be muffing the search somehow 331- ### seemed to be muffing the search somehow
314- libraries = platform == "osf1" and ['db'] or None 332- libraries = platform == "osf1" and ['db'] or None
315- if libraries is not None: 333- if libraries is not None:
316- exts.append(Extension('bsddb185', ['bsddbmodule.c'], 334- exts.append(Extension('bsddb185', ['bsddbmodule.c'],
317- libraries=libraries)) 335- libraries=libraries))
318- else: 336- else:
319- exts.append(Extension('bsddb185', ['bsddbmodule.c'])) 337- exts.append(Extension('bsddb185', ['bsddbmodule.c']))
320+ # check if db_incs/db.h really is db 1.85 
321+ f = "%s/db.h" % db_incs[0] 
322+ if os.path.exists(f): 
323+ data = open(f).read() 
324+ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) 
325+ if m is None: 
326+ # check for 1.85 compat header 
327+ if os.path.exists("%s/db_185.h" % db_incs[0]): 
328+ bsddb185_define_macros=[('HAVE_DB_185_H',1)] 
329+ else: 
330+ raise NotFound 
331+ try: 
332+ bltransform = os.environ['PY_BDB_TRANSFORM'] 
333+ m = re.search(r"l:db:(db.)\s*", bltransform) 
334+ if m is not None and m.group(1) is not None: 
335+ dblibs = [m.group(1)] 
336+ except: 
337+ pass 
338+ 
339+ # build the bsddb185 extension module 338+ # build the bsddb185 extension module
340+ exts.append(Extension('bsddb185', ['bsddbmodule.c'], 339+ exts.append(Extension('bsddb185', ['bsddbmodule.c'],
341+ library_dirs=dblib_dir, 340+ library_dirs=dblib_dir,
342+ runtime_library_dirs=dblib_dir, 341+ runtime_library_dirs=dblib_dir,
343+ include_dirs=db_incs, 342+ include_dirs=db_incs,
344+ define_macros=bsddb185_define_macros, 343+ define_macros=bsddb185_define_macros,
345+ libraries=dblibs)) 344+ libraries=dblibs))
346+ except: 345+ except:
347+ db_incs = None 346+ db_incs = None
348+ dblibs = [] 347+ dblibs = []
349+ dblib_dir = None 348+ dblib_dir = None
350  349
351 # The standard Unix dbm module: 350 # The standard Unix dbm module:
352 if platform not in ['cygwin']: 351 if platform not in ['cygwin']:
353@@ -884,6 +670,13 @@ class PyBuildExt(build_ext): 352@@ -884,11 +670,6 @@
354 exts.append( Extension('dbm', ['dbmmodule.c'], 353 exts.append( Extension('dbm', ['dbmmodule.c'],
355 define_macros=[('HAVE_NDBM_H',None)], 354 define_macros=[('HAVE_NDBM_H',None)],
356 libraries = ndbm_libs ) ) 355 libraries = ndbm_libs ) )
357+ elif find_file("ndbm.h", db_incs, []) is not None: 356- elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
358+ exts.append( Extension('dbm', ['dbmmodule.c'], 357- and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
359+ library_dirs=dblib_dir, 358- exts.append( Extension('dbm', ['dbmmodule.c'],
360+ runtime_library_dirs=dblib_dir, 359- define_macros=[('HAVE_GDBM_NDBM_H',None)],
361+ include_dirs=db_incs, 360- libraries = ['gdbm'] ) )
362+ define_macros=[('HAVE_NDBM_H',None)], 361 elif db_incs is not None:
363+ libraries=dblibs)) 
364 elif (self.compiler.find_library_file(lib_dirs, 'gdbm') 
365 and find_file("gdbm/ndbm.h", inc_dirs, []) is not None): 
366 exts.append( Extension('dbm', ['dbmmodule.c'], 362 exts.append( Extension('dbm', ['dbmmodule.c'],
367@@ -899,9 +692,9 @@ class PyBuildExt(build_ext): 363 library_dirs=dblib_dir,
 364@@ -899,9 +680,9 @@
368 libraries=dblibs)) 365 libraries=dblibs))
369  366
370 # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: 367 # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
371- if (self.compiler.find_library_file(lib_dirs, 'gdbm')): 368- if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
372- exts.append( Extension('gdbm', ['gdbmmodule.c'], 369- exts.append( Extension('gdbm', ['gdbmmodule.c'],
373- libraries = ['gdbm'] ) ) 370- libraries = ['gdbm'] ) )
374+ #if (self.compiler.find_library_file(lib_dirs, 'gdbm')): 371+ #if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
375+ # exts.append( Extension('gdbm', ['gdbmmodule.c'], 372+ # exts.append( Extension('gdbm', ['gdbmmodule.c'],
376+ # libraries = ['gdbm'] ) ) 373+ # libraries = ['gdbm'] ) )
377  374
378 # Unix-only modules 375 # Unix-only modules
379 if platform not in ['mac', 'win32']: 376 if platform not in ['mac', 'win32']:
380@@ -1536,8 +1329,8 @@ def main(): 377@@ -1536,8 +1317,8 @@
381 ext_modules=[Extension('_struct', ['_struct.c'])], 378 ext_modules=[Extension('_struct', ['_struct.c'])],
382  379
383 # Scripts to install 380 # Scripts to install
384- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', 381- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
385- 'Lib/smtpd.py'] 382- 'Lib/smtpd.py']
386+ scripts = ['Tools/scripts/pydoc2.5', 383+ scripts = ['Tools/scripts/pydoc2.5',
387+ 'Lib/smtpd2.5.py'] 384+ 'Lib/smtpd2.5.py']
388 ) 385 )
389  386
390 # --install-platlib 387 # --install-platlib