--- nspluginwrapper-0.9.91.4.orig/debian/README.Debian +++ nspluginwrapper-0.9.91.4/debian/README.Debian @@ -0,0 +1,37 @@ +nspluginwrapper for Debian +-------------------------- + +nspluginwrapper is an RPC-based mechanism for running non-native plugins +built for the Netscape 4 plugin API (NPAPI) on architectures they were +not built for. For example, this allows you to use the Flash plugin for +the i386 architecture on an amd64 machine running a native 64-bit browser. + +It is known to work with Firefox, Iceweasel, Mozilla, Iceape and Konqueror. + +nspluginwrapper for Debian is built exclusively for the amd64 architecture +because the ia32-libs and ia32-libs-gtk packages are not available on other +architectures, and a gcc with target i386 is not available for ia64. Were +these available for, e.g. the PowerPC platform, it would be possible to +package nspluginwrapper for that platform. However, cross-compilers for the +i386 architecture would need to be made available, and this is highly +unlikely. + +Since Debian does not package any binary-only plugins, no automated +mechanism for automated nspluginwrapperisation is provided. Instead, +download the plugin and unpack it to a location where it will remain and +run: + + nspluginwrapper -i /path/to/npplugin.so + +To remove a plugin, run: + + nspluginwrapper -r ~/.mozilla/plugins/npwrapper.npplugin.so + +Alternately, install any plugins as normal into your .mozilla/plugins/ +directory and run: + + nspluginwrapper -a -u -v + +To automatically install any compatibility stubs without prompting. + + -- Rob Andrews Wed, 11 Apr 2007 19:14:03 +0100 --- nspluginwrapper-0.9.91.4.orig/debian/changelog +++ nspluginwrapper-0.9.91.4/debian/changelog @@ -0,0 +1,48 @@ +nspluginwrapper (0.9.91.4-2ubuntu1) gutsy; urgency=low + + [ Alexander Sack ] + * src/npw-config.c: NSPLUGIN_DIR environment can override default + mozilla_system_dir and can specify custom install dir for created + wrapper library. + * debian/control: use MOTU as maintainer; drop ia32-libs-gtk from Depends + (since gutsy provided by ia32-libs). + + -- Alexander Sack Wed, 20 Jun 2007 14:00:05 +0200 + +nspluginwrapper (0.9.91.4-2) unstable; urgency=low + + * Add build dependency on g++-multilib + (Closes: #423131, thanks Pär Andersson) + + -- Rob Andrews Thu, 10 May 2007 12:17:09 -0400 + +nspluginwrapper (0.9.91.4-1) unstable; urgency=low + + * New upstream release + * Install into /usr/lib/nspluginwrapper/plugins and symlink to + browser-specific plugin paths (Closes: #417288) + * (to compliment the above) Remove symlinks to plugins on removal + Only operates on symlinks in global directorys, includes: + /usr/lib/firefox/plugins + /usr/lib/iceweasel/plugins + /usr/lib/mozilla/plugins + * Remove ia64 from the architecture list - there isn't a compiler available + to build i386 binaries on the architecture + * Explicitly set --with-lib32, as otherwise it assumes it to be /usr/lib + * Explicitly set --with-lib64, as otherwise it assumes it to be /usr/lib64 + * Not autoconf/automake, so don't need config.sub/config.guess + + -- Rob Andrews Wed, 11 Apr 2007 19:14:03 +0100 + +nspluginwrapper (0.9.91.3-1) unstable; urgency=low + + * New upstream release + + -- Rob Andrews Mon, 5 Mar 2007 14:44:48 +0000 + +nspluginwrapper (0.9.91.2-1) unstable; urgency=low + + * Initial release (Closes: #410061) + + -- Rob Andrews Wed, 14 Feb 2007 00:12:53 +0000 + --- nspluginwrapper-0.9.91.4.orig/debian/compat +++ nspluginwrapper-0.9.91.4/debian/compat @@ -0,0 +1 @@ +5 --- nspluginwrapper-0.9.91.4.orig/debian/control +++ nspluginwrapper-0.9.91.4/debian/control @@ -0,0 +1,19 @@ +Source: nspluginwrapper +Section: contrib/utils +Priority: extra +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Rob Andrews +Build-Depends: debhelper (>= 5), autotools-dev, libc6-dev-i386, libxt-dev, x11proto-core-dev, x11proto-xext-dev, libx11-dev, libatk1.0-dev, libfontconfig1-dev, libgtk2.0-dev, libglib2.0-dev, libpango1.0-dev, ia32-libs, g++-multilib +Standards-Version: 3.7.2 +Xs-Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/nspluginwrapper/ubuntu + +Package: nspluginwrapper +Architecture: amd64 +Depends: ${shlibs:Depends}, linux32 +Description: A wrapper to run Netscape plugins on other architectures + nspluginwrapper is an Open Source compatibility plugin for Netscape 4 + (NPAPI) plugins. That is, it enables you to use plugins on platforms + they were not built for. + . + This package is built to run i386 plugins, since there are no known + binary-only plugins built for any other architecture. --- nspluginwrapper-0.9.91.4.orig/debian/copyright +++ nspluginwrapper-0.9.91.4/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Rob Andrews on +Wed, 14 Feb 2007 00:12:53 +0000. + +It was downloaded from http://gwenole.beauchesne.info/en/projects/nspluginwrapper + +Upstream Author: Gwenole Beauchesne + +Copyright: 2006 Gwenole Beauchesne + +License: + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + See /usr/share/common-licenses/GPL-2 on your debian system. + +The Debian packaging is (C) 2007, Rob Andrews and +is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. --- nspluginwrapper-0.9.91.4.orig/debian/dirs +++ nspluginwrapper-0.9.91.4/debian/dirs @@ -0,0 +1,6 @@ +usr/bin +usr/sbin +usr/lib/nspluginwrapper/plugins +usr/lib/mozilla/plugins +usr/lib/firefox/plugins +usr/lib/iceweasel/plugins --- nspluginwrapper-0.9.91.4.orig/debian/docs +++ nspluginwrapper-0.9.91.4/debian/docs @@ -0,0 +1,3 @@ +NEWS +README +TODO --- nspluginwrapper-0.9.91.4.orig/debian/nspluginwrapper.1 +++ nspluginwrapper-0.9.91.4/debian/nspluginwrapper.1 @@ -0,0 +1,57 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH NSPLUGINWRAPPER 1 "February 14, 2007" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +nspluginwrapper \- tool to manage nspluginwrapper-wrapped plugins +.SH SYNOPSIS +.B nspluginwrapper +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B nspluginwrapper +command. +.PP +\fBnspluginwrapper\fP is a compatibility layer to allow the usage of non-native +plugins in a web browser supporting the Netscape 4 plugin API (NPAPI). +.SH OPTIONS +A summary of options is included below. +.TP +.B \-h +Display help and exit +.TP +.B \-i \fInpPLUGIN.so\fP +Install wrapper for npPLUGIN.so into the mozilla plugins directory +.TP +.B \-r \fI/path/to/npwrapper.npPLUGIN.so\fP +Remove the wrapper for npPLUGIN.so +.TP +.B \-u +Update plugins currently installed +.TP +.B \-a +Set automatic mode for plugins discovery +.TP +.B \-l +List plugins currently installed +.TP +.B \-v +Show verbose messages +.SH AUTHOR +nspluginwrapper was written by Gwenole Beauchesne . +.PP +This manual page was written by Rob Andrews , +for the Debian project (but may be used by others). --- nspluginwrapper-0.9.91.4.orig/debian/rules +++ nspluginwrapper-0.9.91.4/debian/rules @@ -0,0 +1,85 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# debian/rules that uses debhelper. + +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +config.status: configure + dh_testdir + ./configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --with-lib32=lib32 \ + --with-lib64=lib \ + --biarch \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="-Wl,-z,defs" + + +build: build-stamp + +build-stamp: config.status + dh_testdir + $(MAKE) + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + -$(MAKE) distclean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/nspluginwrapper install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman debian/nspluginwrapper.1 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- nspluginwrapper-0.9.91.4.orig/debian/watch +++ nspluginwrapper-0.9.91.4/debian/watch @@ -0,0 +1,8 @@ +# watch control file for uscan +# See uscan(1) for format + +# Compulsory line, this is a version 3 file +version=3 + +# +http://gwenole.beauchesne.info/en/projects/nspluginwrapper .*/nspluginwrapper-(.*)\.tar\.bz2 --- nspluginwrapper-0.9.91.4.orig/src/npw-config.c +++ nspluginwrapper-0.9.91.4/src/npw-config.c @@ -43,6 +43,16 @@ static bool g_verbose = false; static const char NPW_CONFIG[] = "nspluginwrapper"; +/* On Debian systems, we install/remove symlinks from these paths. + * This information is used twice, so declare globally */ +static const char *debian_link_dirs[] = { + LIBDIR "/mozilla/plugins", + LIBDIR "/firefox/plugins", + LIBDIR "/iceweasel/plugins", + NULL, /* if this isn't here, it reads into whatever data is in memory after + possibly differing in behaviour to the same code in functions */ +}; + static void error(const char *format, ...) { va_list args; @@ -113,6 +123,10 @@ static const char default_dir[] = LIBDIR "/mozilla/plugins"; static const char *dir = NULL; + char *plugin_dir = getenv("NSPLUGIN_DIR"); + if(plugin_dir) + return plugin_dir; + if (dir == NULL) { const char **dirs = NULL; @@ -152,7 +166,7 @@ } else if (access("/etc/debian_version", F_OK) == 0) { static const char *debian_dirs[] = { - "/usr/lib/mozilla/plugins", // XXX how unfortunate + LIBDIR "/nspluginwrapper/plugins", }; dirs = debian_dirs; } @@ -803,6 +817,47 @@ printf(" into %s\n", d_plugin_path); free(plugin_data); + + /* Install symlinks on Debian systems */ + if (is_system_wide_wrapper_plugin(plugin_path) && (access("/etc/debian_version", F_OK) == 0)) + { + static const char *ldir = NULL; + const char **ldirs = NULL; + char *lname = NULL; + + ldirs = debian_link_dirs; + + while ((ldir = *ldirs++) != NULL) + { + if (access(ldir, F_OK) == 0) + { + /* Can write to this directory, make a symlink in it */ + if (g_verbose) + printf("And create symlink to plugin in %s: ", ldir); + + if ((lname = malloc(strlen(ldir) + strlen(NPW_WRAPPER_BASE) + strlen(plugin_base) + 3)) != NULL) + { + sprintf(lname, "%s/%s.%s", ldir, NPW_WRAPPER_BASE, plugin_base); + + if (symlink(d_plugin_path, lname) == 0) + { + if (g_verbose) + printf("done.\n"); + } + else + { + if (g_verbose) + printf("failed!\n"); + } + + free(lname); + } + else + if (g_verbose) + printf("*gulp* malloc() failed!\n"); + } + } + } return 0; } @@ -859,6 +914,48 @@ if (unlink(plugin_path) < 0) return 1; + /* Remove links to the plugin on Debian systems */ + if (access("/etc/debian_version", F_OK) == 0) + { + static const char *ldir = NULL; + const char **ldirs = NULL; + char *lname = NULL; + char *plugin_base = strrchr(plugin_path, '/'); + char *lbuf = NULL; + + if (plugin_base == NULL) + return 1; + else + plugin_base++; + + ldirs = debian_link_dirs; + + while ((ldir = *ldirs++) != NULL) + { + if ((lname = malloc(strlen(ldir) + strlen(plugin_base) + 2)) == NULL) + return 1; + + sprintf(lname, "%s/%s", ldir, plugin_base); + lbuf = malloc(strlen(plugin_path) + 1); + + if (readlink(lname, lbuf, strlen(plugin_path)) > 0) + { + /* readlink doesn't null terminate */ + *(lbuf + strlen(plugin_path)) = 0; + + if (strcmp(lbuf, plugin_path) == 0) + { + unlink(lname); + if (g_verbose) + printf("Deleted symlink '%s' to this plugin.\n", lname); + } + } + + free(lname); + free(lbuf); + } + } + return 0; }