[csw-devel] SF.net SVN: gar:[13705] csw/mgar/pkg/file/trunk

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Mar 9 11:17:26 CET 2011


Revision: 13705
          http://gar.svn.sourceforge.net/gar/?rev=13705&view=rev
Author:   wahwah
Date:     2011-03-09 10:17:26 +0000 (Wed, 09 Mar 2011)

Log Message:
-----------
file: Upgrade to 5.05, Python bindings use hardcoded library name

The call to find_library was removed and replaced by the "libmagic.so.1"
string.

Modified Paths:
--------------
    csw/mgar/pkg/file/trunk/Makefile
    csw/mgar/pkg/file/trunk/checksums
    csw/mgar/pkg/file/trunk/files/check_pkgroot.sh

Added Paths:
-----------
    csw/mgar/pkg/file/trunk/files/0002-Do-not-use-find_library-at-runtime.patch

Modified: csw/mgar/pkg/file/trunk/Makefile
===================================================================
--- csw/mgar/pkg/file/trunk/Makefile	2011-03-09 03:54:33 UTC (rev 13704)
+++ csw/mgar/pkg/file/trunk/Makefile	2011-03-09 10:17:26 UTC (rev 13705)
@@ -1,7 +1,7 @@
 # $Id$
 
 NAME = file
-VERSION = 5.04
+VERSION = 5.05
 CATEGORIES = utils
 
 define BLURB
@@ -21,10 +21,14 @@
 CONFIGURE_ARGS += --disable-warnings
 TEST_TARGET = check
 
-PATCHFILES += 0001-libtool-dir-used-for-linking.patch 
-PATCHFILES += 0002-CSW-runpath.patch
-# PATCHFILES += 0001-Remove-surplus-flags-output-on-SPARC.patch
+# Patches specific to the 5.04 version:
+# PATCHFILES += 0001-libtool-dir-used-for-linking.patch 
+# PATCHFILES += 0002-CSW-runpath.patch
 
+# Patches specific to the 5.05 version:
+PATCHFILES += 0001-Remove-surplus-flags-output-on-SPARC.patch
+PATCHFILES += 0002-Do-not-use-find_library-at-runtime.patch
+
 NOISAEXEC = 1
 
 PACKAGES += CSWgfile
@@ -41,12 +45,9 @@
 PKGFILES_CSWpy-libmagic += /opt/csw/lib/python.*
 SPKG_DESC_CSWpy-libmagic = Python extension for libmagic
 CATALOGNAME_CSWpy-libmagic = py_libmagic
-# py-libmagic should have a .so object in it, so it's architecture-specific.
-# ARCHALL_CSWpy-libmagic = 1
+ARCHALL_CSWpy-libmagic = 1
 RUNTIME_DEP_PKGS_CSWpy-libmagic += CSWpython
 RUNTIME_DEP_PKGS_CSWpy-libmagic += CSWlibmagic1
-RUNTIME_DEP_PKGS_CSWpy-libmagic += CSWlibpython2-6-1-0
-CHECKPKG_OVERRIDES_CSWpy-libmagic += surplus-dependency|CSWpython
 
 PACKAGES += CSWlibmagic-data
 CATALOGNAME_CSWlibmagic-data = libmagic_data
@@ -80,7 +81,7 @@
 DISTUTILS_DEBUG = 1
 export DISTUTILS_DEBUG
 
-# BUILD64 = 1
+BUILD64 = 1
 
 include gar/category.mk
 
@@ -99,6 +100,11 @@
 	ginstall -d -m 755 $(DESTDIR)$(prefix)/gnu
 	(cd $(DESTDIR) && \
 		gln -s ../bin/gfile $(DESTDIR)$(prefix)/gnu/file)
+	# Injecting a symlink pointing at libmagic.so.1 on the filesystem, so that
+	# checkpkg realizes that the dependency is necessary.
+	if [ -d $(DESTDIR)$(libdir)/python/site-packages ]; then \
+	  ln -s ../../libmagic.so.1 $(DESTDIR)$(libdir)/python/site-packages/need-libmagic; \
+	fi
 	@$(MAKECOOKIE)
 
 post-merge:

Modified: csw/mgar/pkg/file/trunk/checksums
===================================================================
--- csw/mgar/pkg/file/trunk/checksums	2011-03-09 03:54:33 UTC (rev 13704)
+++ csw/mgar/pkg/file/trunk/checksums	2011-03-09 10:17:26 UTC (rev 13705)
@@ -1 +1 @@
-accade81ff1cc774904b47c72c8aeea0  file-5.04.tar.gz
+0b429063710457be2bd17a18389cb018  file-5.05.tar.gz

Added: csw/mgar/pkg/file/trunk/files/0002-Do-not-use-find_library-at-runtime.patch
===================================================================
--- csw/mgar/pkg/file/trunk/files/0002-Do-not-use-find_library-at-runtime.patch	                        (rev 0)
+++ csw/mgar/pkg/file/trunk/files/0002-Do-not-use-find_library-at-runtime.patch	2011-03-09 10:17:26 UTC (rev 13705)
@@ -0,0 +1,35 @@
+From 4d7a3366cfa5a60d39b14677dca940b5720a9130 Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Wed, 9 Mar 2011 10:27:30 +0100
+Subject: [PATCH] Do not use find_library at runtime
+
+---
+ python/magic.py |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/python/magic.py b/python/magic.py
+index 35a7182..7807ce2 100644
+--- a/python/magic.py
++++ b/python/magic.py
+@@ -6,14 +6,16 @@ Python bindings for libmagic
+ import ctypes
+ 
+ from ctypes import *
+-from ctypes.util import find_library
+ 
+ def _init():
+     """
+     Loads the shared library through ctypes and returns a library
+     L{ctypes.CDLL} instance 
+     """
+-    return ctypes.cdll.LoadLibrary(find_library('magic'))
++    # the find_library function depends on a compiler being installed at
++    # runtime, which would be unacceptable even if it worked (it doesn't).
++    # Removing the call to find_library and hardcoding the library name.
++    return ctypes.cdll.LoadLibrary('libmagic.so.1')
+ 
+ _libraries = {}
+ _libraries['magic'] = _init()
+-- 
+1.7.3.2
+

Modified: csw/mgar/pkg/file/trunk/files/check_pkgroot.sh
===================================================================
--- csw/mgar/pkg/file/trunk/files/check_pkgroot.sh	2011-03-09 03:54:33 UTC (rev 13704)
+++ csw/mgar/pkg/file/trunk/files/check_pkgroot.sh	2011-03-09 10:17:26 UTC (rev 13705)
@@ -11,5 +11,5 @@
 set -e
 set -x
 
-# This file was missing in file-5.05, and that broke py_libmagic.
-test -f ${PKGROOT}/opt/csw/lib/python/site-packages/magic.so
+# The 5.05 version has a pure Python rewrite of the Python bindings.
+# test -f ${PKGROOT}/opt/csw/lib/python/site-packages/magic.so


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list