rpms/nspluginwrapper/devel plugin-config.sh.in, NONE, 1.1 .cvsignore, 1.2, 1.3 nspluginwrapper-0.9.91.4-rh.patch, 1.2, 1.3 nspluginwrapper.spec, 1.4, 1.5 sources, 1.2, 1.3

Martin Stransky (stransky) fedora-extras-commits at redhat.com
Tue Aug 7 12:34:12 UTC 2007


Author: stransky

Update of /cvs/pkgs/rpms/nspluginwrapper/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7113

Modified Files:
	.cvsignore nspluginwrapper-0.9.91.4-rh.patch 
	nspluginwrapper.spec sources 
Added Files:
	plugin-config.sh.in 
Log Message:
added plugin configuration utility, added gecko dependency, removed suid


--- NEW FILE plugin-config.sh.in ---
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation.  Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): 
#

## 
## Usage:
##
## $ mozilla-plugin-config
##
## This script is meant to configure plugins from the mozilla
## rpm installation.
##
## The script will setup all the plugin voodoo needed to make
## mozilla work.

##
## Variables
##
MOZ_ARCH=$(uname -m)
case $MOZ_ARCH in
	x86_64 | ia64 | s390 )
		MOZ_LIB_DIR="/usr/lib64"
		SECONDARY_LIB_DIR="/usr/lib"
		;;
	* )
		MOZ_LIB_DIR="/usr/lib"
		SECONDARY_LIB_DIR="/usr/lib64"
		;;
esac

if [ ! -x $MOZ_LIB_DIR/firefox-FIREFOX_VERSION/firefox-bin ]; then
    if [ ! -x $SECONDARY_LIB_DIR/firefox-FIREFOX_VERSION/firefox-bin ]; then
	echo "Error: $MOZ_LIB_DIR/firefox-FIREFOX_VERSION/firefox-bin not found"
	if [ -d $SECONDARY_LIB_DIR ]; then
	    echo "       $SECONDARY_LIB_DIR/firefox-FIREFOX_VERSION/firefox-bin not found"
	fi
	exit 1
    fi
    MOZ_LIB_DIR="$SECONDARY_LIB_DIR"
fi

export LD_LIBRARY_PATH=$MOZ_LIB_DIR/firefox-FIREFOX_VERSION

# Set-up installed plugins
$MOZ_LIB_DIR/nspluginwrapper/plugin-config -c -f > /dev/null 2>&1



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	30 Jul 2007 09:52:11 -0000	1.2
+++ .cvsignore	7 Aug 2007 12:33:39 -0000	1.3
@@ -1 +1,2 @@
 nspluginwrapper-0.9.91.4.tar.bz2
+plugin-config-1.3.tar.gz

nspluginwrapper-0.9.91.4-rh.patch:

Index: nspluginwrapper-0.9.91.4-rh.patch
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/devel/nspluginwrapper-0.9.91.4-rh.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nspluginwrapper-0.9.91.4-rh.patch	3 Aug 2007 11:51:56 -0000	1.2
+++ nspluginwrapper-0.9.91.4-rh.patch	7 Aug 2007 12:33:39 -0000	1.3
@@ -1,5 +1,5 @@
 --- nspluginwrapper-0.9.91.4/Makefile.rh	2007-04-03 07:31:22.000000000 +0200
-+++ nspluginwrapper-0.9.91.4/Makefile	2007-08-03 13:34:34.000000000 +0200
++++ nspluginwrapper-0.9.91.4/Makefile	2007-08-06 13:43:16.000000000 +0200
 @@ -52,23 +52,6 @@ ifneq (,$(findstring $(OS),netbsd dragon
  X_LDFLAGS += -Wl,--rpath,$(x11prefix)/$(lib64)
  endif
@@ -237,7 +237,7 @@
  		-Wl,--version-script,$(patsubst $(LSB_OBJ_DIR)/%.o,$(LSB_SRC_DIR)/%.Version,$<) \
  		-Wl,-soname,`grep "$(patsubst $(LSB_OBJ_DIR)/%.o,%,$<) " $(LSB_SRC_DIR)/LibNameMap.txt | cut -f2 -d' '`
 --- nspluginwrapper-0.9.91.4/configure.rh	2007-04-02 23:42:24.000000000 +0200
-+++ nspluginwrapper-0.9.91.4/configure	2007-08-03 13:40:32.000000000 +0200
++++ nspluginwrapper-0.9.91.4/configure	2007-08-06 13:52:12.000000000 +0200
 @@ -21,44 +21,16 @@ TMPS="${TMPDIR1}/npw-conf-${RANDOM}-$$-$
  
  # default parameters
@@ -453,7 +453,7 @@
 +if $pkgconfig --exists firefox-plugin; then
 +    GECKO_CFLAGS=`$pkgconfig --cflags firefox-plugin --cflags firefox-xpcom --cflags firefox-gtkmozembed`
 +    GECKO_LDFLAGS=`$pkgconfig --libs firefox-plugin  --libs firefox-xpcom --libs firefox-gtkmozembed`
-+    GECKO_LIBDIR=`$pkgconfig --libs-only-L firefox-xpcom | sed -e "s|-L||"`
++    GECKO_LIBDIR=`$pkgconfig --libs-only-L firefox-xpcom | sed -e "s|-L||" -e "s| ||g"`
 +else
 +    echo "gecko-devel not found"
 +    exit 1
@@ -617,7 +617,7 @@
 +echo "DONT_STRIP=yes" >> $config_mak
 +
 --- nspluginwrapper-0.9.91.4/src/npw-wrapper.c.rh	2007-04-02 21:52:57.000000000 +0200
-+++ nspluginwrapper-0.9.91.4/src/npw-wrapper.c	2007-08-03 13:34:34.000000000 +0200
++++ nspluginwrapper-0.9.91.4/src/npw-wrapper.c	2007-08-06 13:43:16.000000000 +0200
 @@ -42,6 +42,7 @@
  
  #include "rpc.h"
@@ -638,8 +638,8 @@
  
    // Cache MIME info and plugin name/description
    if (g_plugin.name == NULL && g_plugin.description == NULL && g_plugin.formats == NULL) {
---- /dev/null	2007-08-03 09:39:03.625062137 +0200
-+++ nspluginwrapper-0.9.91.4/src/npw-dir.c	2007-08-03 13:34:34.000000000 +0200
+--- /dev/null	2007-08-06 09:37:34.625861988 +0200
++++ nspluginwrapper-0.9.91.4/src/npw-dir.c	2007-08-06 13:43:16.000000000 +0200
 @@ -0,0 +1,97 @@
 +/*
 + *  npw-dir.h - Directory management for nspluginwrapper
@@ -739,7 +739,7 @@
 +  return(p_path);
 +}
 --- nspluginwrapper-0.9.91.4/src/debug.h.rh	2007-03-04 16:01:22.000000000 +0100
-+++ nspluginwrapper-0.9.91.4/src/debug.h	2007-08-03 13:34:34.000000000 +0200
++++ nspluginwrapper-0.9.91.4/src/debug.h	2007-08-06 13:43:16.000000000 +0200
 @@ -29,7 +29,7 @@ extern void npw_printf(const char *forma
  extern void npw_vprintf(const char *format, va_list args) attribute_hidden;
  
@@ -750,7 +750,7 @@
  #else
  #define D(x) ;
 --- nspluginwrapper-0.9.91.4/src/sysdeps.h.rh	2007-03-04 16:01:22.000000000 +0100
-+++ nspluginwrapper-0.9.91.4/src/sysdeps.h	2007-08-03 13:34:34.000000000 +0200
++++ nspluginwrapper-0.9.91.4/src/sysdeps.h	2007-08-06 13:43:16.000000000 +0200
 @@ -43,8 +43,8 @@
  #define NPW_VIEWER NPW_VIEWER_BASE
  #define NPW_WRAPPER_BASE "npwrapper"
@@ -763,7 +763,7 @@
  #define NPW_PLUGIN_IDENT_SIZE 32
  typedef struct __attribute__((packed)) {
 --- nspluginwrapper-0.9.91.4/src/npw-viewer.sh.rh	2007-04-02 21:52:57.000000000 +0200
-+++ nspluginwrapper-0.9.91.4/src/npw-viewer.sh	2007-08-03 13:34:34.000000000 +0200
++++ nspluginwrapper-0.9.91.4/src/npw-viewer.sh	2007-08-06 13:43:16.000000000 +0200
 @@ -4,7 +4,13 @@
  #
  OS="`uname -s`"
@@ -828,13 +828,13 @@
  esac
  
 +# Set a new LD_LIBRARY_PATH that is TARGET specific
-+export LD_LIBRARY_PATH=$NPW_VIEWER_DIR:$GECKO_LIBDIR:$LD_LIBRARY_PATH
++export LD_LIBRARY_PATH=$NPW_VIEWER_DIR:$GECKO_LIBDIR
 +
  # Expand PATH for RealPlayer package on NetBSD (realplay)
  if test "$OS" = "NetBSD"; then
      REALPLAYER_HOME="/usr/pkg/lib/RealPlayer"
---- /dev/null	2007-08-03 09:39:03.625062137 +0200
-+++ nspluginwrapper-0.9.91.4/src/npw-dir.h	2007-08-03 13:34:34.000000000 +0200
+--- /dev/null	2007-08-06 09:37:34.625861988 +0200
++++ nspluginwrapper-0.9.91.4/src/npw-dir.h	2007-08-06 13:43:16.000000000 +0200
 @@ -0,0 +1,35 @@
 +/*
 + *  npw-dir.h - Directory management for nspluginwrapper
@@ -872,8 +872,8 @@
 +
 +#endif
 --- nspluginwrapper-0.9.91.4/src/npw-config.c.rh	2007-04-02 22:42:15.000000000 +0200
-+++ nspluginwrapper-0.9.91.4/src/npw-config.c	2007-08-03 13:34:34.000000000 +0200
-@@ -38,10 +38,15 @@
++++ nspluginwrapper-0.9.91.4/src/npw-config.c	2007-08-06 13:43:16.000000000 +0200
+@@ -38,10 +38,16 @@
  #include <pwd.h>
  #include <dirent.h>
  
@@ -883,13 +883,14 @@
  
  static bool g_auto = false;
  static bool g_verbose = false;
++static bool g_fast = false;
  static const char NPW_CONFIG[] = "nspluginwrapper";
 +static char *p_plugin_dir = NULL;
 +static char *p_plugin_prefix = NULL;
  
  static void error(const char *format, ...)
  {
-@@ -254,11 +259,31 @@ static const char **get_mozilla_plugin_d
+@@ -254,11 +260,31 @@ static const char **get_mozilla_plugin_d
       ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) | \
        (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
  
@@ -926,7 +927,7 @@
  
  /* The ELF file header.  This appears at the start of every ELF file.  */
  #define EI_NIDENT (16)
-@@ -281,6 +306,30 @@ typedef struct
+@@ -281,6 +307,30 @@ typedef struct
    Elf32_Half	e_shstrndx;		/* Section header string table index */
  } Elf32_Ehdr;
  
@@ -957,7 +958,7 @@
  #define EI_MAG0		0		/* File identification byte 0 index */
  #define ELFMAG0		0x7f		/* Magic number byte 0 */
  #define EI_MAG1		1		/* File identification byte 1 index */
-@@ -326,6 +375,20 @@ typedef struct
+@@ -326,6 +376,20 @@ typedef struct
    Elf32_Word	sh_entsize;		/* Entry size if section holds table */
  } Elf32_Shdr;
  
@@ -978,7 +979,7 @@
  #define SHT_NOBITS	  8		/* Program space with no data (bss) */
  #define SHT_DYNSYM	  11		/* Dynamic linker symbol table */
  
-@@ -340,17 +403,32 @@ typedef struct
+@@ -340,17 +404,32 @@ typedef struct
    Elf32_Half	st_shndx;		/* Section index */
  } Elf32_Sym;
  
@@ -1018,7 +1019,7 @@
  
  void *load_data(int fd, long offset, unsigned int size)
  {
-@@ -374,7 +452,7 @@ static bool is_little_endian(void)
+@@ -374,7 +453,7 @@ static bool is_little_endian(void)
    return x.b[0] == 0x04;
  }
  
@@ -1027,7 +1028,7 @@
  {
    hdr->e_type			= bswap_16(hdr->e_type);
    hdr->e_machine		= bswap_16(hdr->e_machine);
-@@ -391,7 +469,24 @@ static void elf_swap_ehdr(ElfW(Ehdr) *hd
+@@ -391,7 +470,24 @@ static void elf_swap_ehdr(ElfW(Ehdr) *hd
    hdr->e_shstrndx		= bswap_16(hdr->e_shstrndx);
  }
  
@@ -1053,7 +1054,7 @@
  {
    shdr->sh_name			= bswap_32(shdr->sh_name);
    shdr->sh_type			= bswap_32(shdr->sh_type);
-@@ -405,35 +500,49 @@ static void elf_swap_shdr(ElfW(Shdr) *sh
+@@ -405,35 +501,49 @@ static void elf_swap_shdr(ElfW(Shdr) *sh
    shdr->sh_entsize		= bswap_32(shdr->sh_entsize);
  }
  
@@ -1116,7 +1117,7 @@
    if (ehdr.e_type != ET_DYN)
  	return false;
    if (ehdr.e_version != EV_CURRENT)
-@@ -456,22 +565,22 @@ static bool is_plugin_fd(int fd, NPW_Plu
+@@ -456,22 +566,22 @@ static bool is_plugin_fd(int fd, NPW_Plu
  	strcpy(out_plugin_info->target_os, target_os);
    }
  
@@ -1144,7 +1145,7 @@
  	if (sec->sh_type == SHT_DYNSYM
  		&& strcmp(sdata[ehdr.e_shstrndx] + sec->sh_name, ".dynsym") == 0) {
  	  symtab_sec = sec;
-@@ -480,25 +589,25 @@ static bool is_plugin_fd(int fd, NPW_Plu
+@@ -480,25 +590,25 @@ static bool is_plugin_fd(int fd, NPW_Plu
    }
    if (symtab_sec == NULL)
  	goto done;
@@ -1176,7 +1177,7 @@
  	  continue;
  	if (!strcmp(name, "NP_GetMIMEDescription") ||
  		!strcmp(name, "NP_Initialize") ||
-@@ -515,11 +624,126 @@ static bool is_plugin_fd(int fd, NPW_Plu
+@@ -515,18 +625,156 @@ static bool is_plugin_fd(int fd, NPW_Plu
    return ret;
  }
  
@@ -1304,8 +1305,30 @@
 +  EXIT_VIEWER_OK		= 0,  
  };
  
++static int detect_plugin_viewer_fast(const char *filename, NPW_PluginInfo *out_plugin_info)
++{
++  char viewer_arch_path[PATH_MAX];
++  get_viewer_path(viewer_arch_path,PATH_MAX,out_plugin_info->target_arch);
++  if (access(viewer_arch_path, F_OK) != 0) {
++    return(false);
++  }
++
++  char viewer_path[PATH_MAX];
++  sprintf(viewer_path, "%s/%s", viewer_arch_path, NPW_VIEWER);
++  if (access(viewer_path, F_OK) != 0)
++	return(false);
++
++  return(true);
++}
++
  static int detect_plugin_viewer(const char *filename, NPW_PluginInfo *out_plugin_info)
-@@ -527,6 +751,7 @@ static int detect_plugin_viewer(const ch
+ {
++  if(g_auto && out_plugin_info && out_plugin_info->target_arch) {
++    int ret = detect_plugin_viewer_fast(filename, out_plugin_info);
++    if(ret)
++      return(EXIT_VIEWER_OK);
++  }
++
    static const char *target_arch_table[] = {
  	NULL,
  	"i386",
@@ -1313,7 +1336,7 @@
  	NULL
    };
    const int target_arch_table_size = sizeof(target_arch_table) / sizeof(target_arch_table[0]);
-@@ -552,8 +777,8 @@ static int detect_plugin_viewer(const ch
+@@ -552,8 +800,8 @@ static int detect_plugin_viewer(const ch
  	const char *target_arch = target_arch_table[i];
  	if (target_arch == NULL)
  	  continue;
@@ -1324,7 +1347,7 @@
  	if (access(viewer_arch_path, F_OK) != 0) {
  	  target_arch_table[i] = NULL;		// this target ARCH is not available, skip it for good
  	  continue;
-@@ -562,10 +787,8 @@ static int detect_plugin_viewer(const ch
+@@ -562,10 +810,8 @@ static int detect_plugin_viewer(const ch
  	  const char *target_os = target_os_table[j];
  	  if (target_os == NULL)
  		continue;
@@ -1336,7 +1359,7 @@
  	  if (access(viewer_path, F_OK) != 0)
  		continue;
  	  int pid = fork();
-@@ -727,7 +950,9 @@ static int do_install_plugin(const char 
+@@ -727,7 +973,9 @@ static int do_install_plugin(const char 
    plugin_base += 1;
  
    char d_plugin_path[PATH_MAX];
@@ -1347,7 +1370,7 @@
    if (n < 0 || n >= sizeof(d_plugin_path))
  	return 3;
  
-@@ -813,24 +1038,30 @@ static int install_plugin(const char *pl
+@@ -813,24 +1061,30 @@ static int install_plugin(const char *pl
    if (g_verbose)
  	printf("Install plugin %s\n", plugin_path);
  
@@ -1393,19 +1416,26 @@
  
    return ret;
  }
-@@ -961,6 +1192,8 @@ static void print_usage(void)
+@@ -961,6 +1215,9 @@ static void print_usage(void)
    printf("   -h --help               print this message\n");
    printf("   -v --verbose            flag: set verbose mode\n");
    printf("   -a --auto               flag: set automatic mode for plugins discovery\n");
++  printf("   -f --fast               flag: fast install (don't probe plugins)\n");
 +  printf("   -d --dir plugin-dir     flag: target plugin(s) directory\n");
 +  printf("   -p --prefix prefix      flag: a prefix of wrapped plugin file\n");
    printf("   -l --list               list plugins currently installed\n");
    printf("   -u --update             update plugin(s) currently installed\n");
    printf("   -i --install [FILE(S)]  install plugin(s)\n");
-@@ -986,6 +1219,18 @@ static int process_auto(int argc, char *
+@@ -986,6 +1243,24 @@ static int process_auto(int argc, char *
    return 0;
  }
  
++static int process_fast(int argc, char *argv[])
++{
++  g_fast = true;
++  return 0;
++}
++
 +static int process_dir(int argc, char *argv[])
 +{ 
 +  p_plugin_dir = argv[0];
@@ -1421,7 +1451,7 @@
  static int process_list(int argvc, char *argv[])
  {
    const char **plugin_dirs = get_mozilla_plugin_dirs();
-@@ -1041,8 +1286,6 @@ static int process_install(int argc, cha
+@@ -1041,8 +1316,6 @@ static int process_install(int argc, cha
  	  error("%s is not a valid NPAPI plugin", plugin_path);
  	ret = detect_plugin_viewer(plugin_path, &plugin_info);
  	if (ret != EXIT_VIEWER_OK) {
@@ -1430,7 +1460,7 @@
  	  error("no appropriate viewer found for %s", plugin_path);
  	}
  	ret = install_plugin(plugin_path, &plugin_info);
-@@ -1077,55 +1320,54 @@ static int process_remove(int argc, char
+@@ -1077,55 +1350,55 @@ static int process_remove(int argc, char
  
  int main(int argc, char *argv[])
  {
@@ -1473,6 +1503,7 @@
 +	{ "-h", "--help",          process_help,           1, 0 },
 +        { "-v", "--verbose",       process_verbose,        0, 0 },
 +        { "-a", "--auto",          process_auto,           0, 0 },
++        { "-f", "--fast",          process_fast,           0, 0 },
 +        { "-d", "--dir",           process_dir,            0, 1 },
 +        { "-p", "--prefix",        process_prefix,         0, 1 },
 +        { "-l", "--list",          process_list,           1, 0 },


Index: nspluginwrapper.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/devel/nspluginwrapper.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- nspluginwrapper.spec	3 Aug 2007 11:51:56 -0000	1.4
+++ nspluginwrapper.spec	7 Aug 2007 12:33:39 -0000	1.5
@@ -1,3 +1,11 @@
+# To determine the current gecko-devel version:
+# rpm -q --provides firefox-devel | grep gecko-devel
+%define gecko_ver 1.8.1.5
+
+%define plugin_config_version 1.3
+%define plugin_config_name plugin-config-%{plugin_config_version}
+%define plugin_config_binary plugin-config
+
 # Compile as a debug package?
 %define make_debug_package 0
 
@@ -21,8 +29,8 @@
 %define libdir64		/usr/lib64
 
 # define nspluginswrapper libdir (invariant, including libdir)
-%define pkglibdir32		%{libdir32}/%{name}
-%define pkglibdir64		%{libdir64}/%{name}
+%define pkgdir32		%{libdir32}/%{name}
+%define pkgdir64		%{libdir64}/%{name}
 
 # define mozilla plugin dir and back up dir for 32-bit browsers
 %define pluginsourcedir32	%{libdir32}/mozilla/plugins
@@ -37,13 +45,13 @@
 %if "%{target_bits}" == "32"
 %define lib	  	%{lib32}
 %define libdir  	%{libdir32}
-%define pkglibdir  	%{pkglibdir32}
+%define pkgdir  	%{pkgdir32}
 %define plugindir	%{plugindir32}
 %define pluginsourcedir	%{pluginsourcedir32}
 %else
 %define lib	  	%{lib64}
 %define libdir  	%{libdir64}
-%define pkglibdir  	%{pkglibdir64}
+%define pkgdir  	%{pkgdir64}
 %define plugindir	%{plugindir64}
 %define pluginsourcedir	%{pluginsourcedir64}
 %endif
@@ -51,15 +59,18 @@
 Summary:	A compatibility layer for Netscape 4 plugins
 Name:		nspluginwrapper
 Version:	0.9.91.4
-Release:	10%{?dist}
+Release:	11%{?dist}
 Source0:	%{name}-%{version}%{?svndate:-%{svndate}}.tar.bz2
+Source1:        %{plugin_config_name}.tar.gz 
+Source2:        plugin-config.sh.in
 Patch0:		nspluginwrapper-0.9.91.4-rh.patch
 License:	GPL
 Group:		Networking/WWW
 Url:		http://gwenole.beauchesne.info/projects/nspluginwrapper/
 Provides:	%{name} = %{version}-%{release}
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
-Requires:	%{_bindir}/linux32
+Requires:	%{_bindir}/linux32 
+Requires:	gecko-libs = %{gecko_ver}
 BuildRequires:	pkgconfig gtk2-devel glib
 BuildRequires:	libXt-devel cairo-devel
 BuildRequires:	gecko-devel
@@ -75,7 +86,7 @@
   * nspluginwrapper: a tool to manage plugins installation and update
 
 %prep
-%setup  -q
+%setup  -q -a 1
 %patch0 -p1 -b .rh
 
 # remove old/incompatibile stuff
@@ -83,6 +94,8 @@
 rm -rf lsb-build
 
 %build
+# Build wrapper
+
 # set the propper built options
 %if %{make_debug_package}
     %if "%{target_bits}" == "64"
@@ -107,7 +120,7 @@
 	    --prefix=%{_prefix} 		\
 	    --target-cpu=%{_target_cpu}		\
 	    --pkgdir=%{name}			\
-	    --pkglibdir=%{pkglibdir}	        \
+	    --pkglibdir=%{pkgdir}	        \
 	    --with-lib32=%{lib32}		\
 	    --with-lib64=%{lib64}		\
 	    --with-base-lib=%{lib}		\
@@ -116,47 +129,70 @@
 	    
 make
 popd
+
+#Build plugin configuration utility
+pushd %{plugin_config_name}
+./configure --prefix=/usr CFLAGS="$RPM_OPT_FLAGS"
+make
+popd
 	
 %install
 rm -rf $RPM_BUILD_ROOT
 
 mkdir -p $RPM_BUILD_ROOT%{_bindir}
 mkdir -p $RPM_BUILD_ROOT%{plugindir}
-mkdir -p $RPM_BUILD_ROOT%{pluginsourcedir}
 
 make -C %{build_dir} install DESTDIR=$RPM_BUILD_ROOT
 
-ln -s %{pkglibdir}/npwrapper.so $RPM_BUILD_ROOT/%{plugindir}/npwrapper.so
+ln -s %{pkgdir}/npwrapper.so $RPM_BUILD_ROOT/%{plugindir}/npwrapper.so
+
+# Install plugin-config utility
+pushd %{plugin_config_name}
+DESTDIR=$RPM_BUILD_ROOT make install
+
+cd $RPM_BUILD_ROOT/usr/bin
+mv %{plugin_config_binary} $RPM_BUILD_ROOT/%{pkgdir}
+
+rm -rf $RPM_BUILD_ROOT/usr/doc/plugin-config
+
+GECKO_VERSION=`pkg-config --modversion firefox-plugin`
+
+cat %{SOURCE2} | %{__sed} -e "s|FIREFOX_VERSION|$GECKO_VERSION|g" \
+    > $RPM_BUILD_ROOT%{_bindir}/mozilla-plugin-config
+chmod 755 $RPM_BUILD_ROOT%{_bindir}/mozilla-plugin-config
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post
-if [ -x /usr/bin/firefox-plugin-config ]; then
-    /usr/bin/firefox-plugin-config
+if [ -x /usr/bin/mozilla-plugin-config ]; then
+    /usr/bin/mozilla-plugin-config
 fi
-if [ -x /usr/bin/seamonkey-plugin-config ]; then
-    /usr/bin/seamonkey-plugin-config
-fi
-
 %postun
-if [ -x /usr/bin/firefox-plugin-config ]; then
-    /usr/bin/firefox-plugin-config
-fi
-if [ -x /usr/bin/seamonkey-plugin-config ]; then
-    /usr/bin/seamonkey-plugin-config
+if [ -x /usr/bin/mozilla-plugin-config ]; then
+    /usr/bin/mozilla-plugin-config
 fi
 
 %files
 %defattr(-,root,root)
 %doc README COPYING NEWS
-%dir %{pkglibdir}
+%dir %{pkgdir}
 %dir %{plugindir}
-%dir %{pluginsourcedir}
-%{pkglibdir}/*
-%{plugindir}/*
+
+%{pkgdir}/%{plugin_config_binary}
+%{pkgdir}/npconfig
+%{pkgdir}/libxpcom.so
+%{pkgdir}/npwrapper.so
+%{pkgdir}/npviewer.bin
+%{pkgdir}/npviewer
+%{plugindir}/npwrapper.so
+%{_bindir}/mozilla-plugin-config
 
 %changelog
+* Mon Aug 6 2007 Martin Stransky <stransky at redhat.com> 0.9.91.4-11
+- added gecko dependency
+- added plugin configuration utility
+
 * Fri Aug 3 2007 Martin Stransky <stransky at redhat.com> 0.9.91.4-10
 - fixed totem-complex plugin wrapping
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	30 Jul 2007 09:52:11 -0000	1.2
+++ sources	7 Aug 2007 12:33:39 -0000	1.3
@@ -1 +1,2 @@
 76df5586c229844d28b5db40368e8912  nspluginwrapper-0.9.91.4.tar.bz2
+cae31f40f7f52e6e0de0764632aa0680  plugin-config-1.3.tar.gz




More information about the fedora-extras-commits mailing list