rpms/libextractor/F-12 plugindir.patch, NONE, 1.1 libextractor.spec, 1.16, 1.17

ensc ensc at fedoraproject.org
Sun Nov 22 15:48:07 UTC 2009


Author: ensc

Update of /cvs/extras/rpms/libextractor/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7683

Modified Files:
	libextractor.spec 
Added Files:
	plugindir.patch 
Log Message:
fixed plugin loading by disabling various autodetections (#452504)


plugindir.patch:
 extractor.c |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

--- NEW FILE plugindir.patch ---
Disabled autodetection of:
  * plugin directory: method was broken as it searches under
    /usr/bin/libextractor; patch hardcodes correct pth becase we
    have fixed installation locations

  * plugin name: we do not ship .la files and have plugins at a fixed
    location; hence, append .so suffix when loading module

Index: libextractor-0.5.23/src/main/extractor.c
===================================================================
--- libextractor-0.5.23.orig/src/main/extractor.c
+++ libextractor-0.5.23/src/main/extractor.c
@@ -516,6 +516,9 @@ static char * os_get_installation_path()
   char * dima;
   char * path;
 
+  if (1)
+	  return strdup(LIBDIR "/" PLUGINDIR);
+
   lpref = get_path_from_ENV_PREFIX();
 #if LINUX
   pexe = get_path_from_proc_exe();
@@ -791,12 +794,29 @@ loadLibrary (const char *name,
 	     ExtractMethod * method)
 {
   lt_dladvise advise;
+  char		*lib_name = NULL;
 
   LTDL_MUTEX_LOCK
   lt_dladvise_init(&advise);
-  lt_dladvise_ext(&advise);
   lt_dladvise_local(&advise);
-  *libHandle = lt_dlopenadvise (name, advise);
+  if (0) {
+	  lt_dladvise_ext(&advise);
+	  lib_name = strdup(name);
+  } else if (strlen(name) < 3 || strcmp(name + strlen(name) - 3, ".so") != 0) {
+	  lib_name = malloc(strlen(name) + sizeof ".so");
+
+	  if (lib_name) {
+		  strcpy(lib_name, name);
+		  strcat(lib_name, ".so");
+	  }
+  }
+
+  if (!lib_name) {
+	  LTDL_MUTEX_UNLOCK;
+	  return -1;
+  }
+
+  *libHandle = lt_dlopenadvise (lib_name, advise);
   lt_dladvise_destroy(&advise);
   if (*libHandle == NULL)
     {
@@ -807,9 +827,11 @@ loadLibrary (const char *name,
 	       lt_dlerror ());
 #endif
       LTDL_MUTEX_UNLOCK
+      free(lib_name);
       return -1;
     }
   LTDL_MUTEX_UNLOCK
+  free(lib_name);
 
   *method = (ExtractMethod) getSymbolWithPrefix (*libHandle, name, "_extract");
   if (*method == NULL) {


Index: libextractor.spec
===================================================================
RCS file: /cvs/extras/rpms/libextractor/F-12/libextractor.spec,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- libextractor.spec	13 Sep 2009 13:36:27 -0000	1.16
+++ libextractor.spec	22 Nov 2009 15:48:06 -0000	1.17
@@ -6,10 +6,12 @@
 
 %{?with_noarch:%global noarch	BuildArch:	noarch}
 %{!?release_func:%global release_func() %1%{?dist}}
+%{!?apply:%global  apply(p:n:b:) %patch%%{-n:%%{-n*}} %%{-p:-p%%{-p*}} %%{-b:-b%%{-b*}} \
+%nil}
 
 Name:		libextractor
 Version:	0.5.23
-Release:	%release_func 0
+Release:	%release_func 1200
 Summary:	Simple library for keyword extraction
 
 Group:		System Environment/Libraries
@@ -18,6 +20,7 @@ URL:		http://gnunet.org/libextractor/
 Source0:	http://gnunet.org/libextractor/download/%name-%version.tar.gz
 #Source1:	http://gnunet.org/libextractor/download/%name-%version.tar.gz.sig
 Source10:	README.fedora
+Patch0:		plugindir.patch
 BuildRoot:	%_tmppath/%name-%version-%release-root
 
 BuildRequires:	gettext
@@ -130,6 +133,7 @@ developing applications that use %name.
 
 %prep
 %setup -q
+%apply -n0 -p1
 
 install -pm644 %SOURCE10 .
 rm -f README.debian
@@ -138,16 +142,18 @@ sed -i 's!\(-L\(/usr\|\$with_qt\)/lib\|-
 
 %build
 %{!?with_mpeg:export ac_cv_lib_mpeg2_mpeg2_init=no}
-
+export lt_cv_sys_dlsearch_path='/%_lib:%_prefix/%_lib:%plugindir'
 %configure --disable-static	\
 	--disable-rpath		\
 	--disable-xpdf		\
-	--with-qt=/usr
+	--with-qt=/usr		\
+	CPPFLAGS='-DLIBDIR=\"%_libdir\"'	\
+	LDFLAGS='-Wl,-as-needed'
 
 # build with --as-needed and disable rpath
 sed -i \
 	-e 's! -shared ! -Wl,--as-needed\0!g'					\
-	-e '/sys_lib_dlsearch_path_spec=\"\/lib \/usr\/lib /s!\"\/lib \/usr\/lib !/\"/%_lib /usr/%_lib !g'	\
+	-e '\!sys_lib_dlsearch_path_spec=\"/lib /usr/lib !s!\"/lib /usr/lib !\"/%_lib /usr/%_lib !g'	\
 	libtool
 
 # not SMP safe
@@ -250,6 +256,9 @@ test "$1" != 0 || \
 
 
 %changelog
+* Sun Nov 22 2009 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> - 0.5.23-1200
+- fixed plugin loading by disabling various autodetections (#452504)
+
 * Sun Sep 13 2009 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 - conditionalized build of 'flac' plugin and noarch subpackages to
   ease packaging under RHEL5




More information about the scm-commits mailing list