rpms/libextractor/F-11 plugindir.patch, NONE, 1.1 libextractor.spec, 1.12, 1.13

ensc ensc at fedoraproject.org
Sun Nov 22 15:58:19 UTC 2009


Author: ensc

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

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-11/libextractor.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- libextractor.spec	7 Mar 2009 12:02:38 -0000	1.12
+++ libextractor.spec	22 Nov 2009 15:58:19 -0000	1.13
@@ -6,7 +6,7 @@
 
 Name:		libextractor
 Version:	0.5.22
-Release:	%release_func 1
+Release:	%release_func 1100
 Summary:	Simple library for keyword extraction
 
 Group:		System Environment/Libraries
@@ -15,6 +15,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
@@ -127,6 +128,7 @@ developing applications that use %name.
 
 %prep
 %setup -q
+%patch0 -p1
 
 install -pm644 %SOURCE10 .
 rm -f README.debian
@@ -140,17 +142,19 @@ export ac_cv_lib_rpm_rpmReadPackageFile=
 %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 's! -shared ! -Wl,--as-needed\0!g'					\
+	-e '\!sys_lib_dlsearch_path_spec=\"/lib /usr/lib !s!\"/lib /usr/lib !\"/%_lib /usr/%_lib !g'	\
 	libtool
 
 # not SMP safe
 make # %{?_smp_mflags}
-	
+
 
 
 %install
@@ -248,6 +252,9 @@ test "$1" != 0 || \
 
 
 %changelog
+* Sun Nov 22 2009 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> - 0.5.22-1100
+- fixed plugin loading by disabling various autodetections (#452504)
+
 * Sat Mar  7 2009 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> - 0.5.22-1
 - updated to 0.5.22
 - disabled rpm plugin for now as it does not build with rpm-4.6




More information about the fedora-extras-commits mailing list