[PATCH] opensc: simplify nsplugin build

View: New views
6 Messages — Rating Filter:   Alert me  

[PATCH] opensc: simplify nsplugin build

by Diego E. Pettenò :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The attached patch simplifies the Makefile.am support for building the
nsplugin. Beside removing the recursion inside npincludes (unneeded),
and avoiding entering the directory entirely when nsplugin is disabled,
it also avoids building the static copy of the plugin itself (see [1])
and at the same time installs it directly inside the nsplugin directory,
rather than sing a symlink (and “polluting” the main library path).

HTH,

[1]
http://www.flameeyes.eu/autotools-mythbuster/libtool/index.html#libtool.plugins.dlopen

--
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/

If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/


[opensc-0.11.10-nsplugin-simplify.patch]

Index: opensc-0.11.10/configure.ac
===================================================================
--- opensc-0.11.10.orig/configure.ac
+++ opensc-0.11.10/configure.ac
@@ -724,7 +724,6 @@ AC_CONFIG_FILES([
  src/pkcs15init/Makefile
  src/scconf/Makefile
  src/signer/Makefile
- src/signer/npinclude/Makefile
  src/tests/Makefile
  src/tests/regression/Makefile
  src/tools/Makefile
Index: opensc-0.11.10/src/Makefile.am
===================================================================
--- opensc-0.11.10.orig/src/Makefile.am
+++ opensc-0.11.10/src/Makefile.am
@@ -3,4 +3,8 @@ EXTRA_DIST = Makefile.mak
 
 # Order IS important
 SUBDIRS = common include scconf libopensc pkcs15init pkcs11 \
- tests tools openssh signer
+ tests tools openssh
+
+if ENABLE_NSPLUGIN
+SUBDIRS += signer
+endif
Index: opensc-0.11.10/src/signer/Makefile.am
===================================================================
--- opensc-0.11.10.orig/src/signer/Makefile.am
+++ opensc-0.11.10/src/signer/Makefile.am
@@ -1,27 +1,18 @@
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
 
-SUBDIRS = npinclude
-if ENABLE_NSPLUGIN
-noinst_HEADERS = opensc-crypto.h opensc-support.h signer.h
-lib_LTLIBRARIES = opensc-signer.la
-dist_noinst_DATA = testprog.c
-endif
+plugin_LTLIBRARIES = opensc-signer.la
+EXTRA_DIST = testprog.c
 
 AM_CFLAGS = $(OPENSSL_CFLAGS) $(LIBASSUAN_CFLAGS)
 INCLUDES = -I$(srcdir)/npinclude -I$(top_builddir)/src/include
 
 opensc_signer_la_CFLAGS = $(AM_CFLAGS) -DXP_UNIX
-opensc_signer_la_SOURCES = opensc-crypto.c opensc-support.c signer.c stubs.c dialog.c \
- signer.exports
+opensc_signer_la_SOURCES = opensc-crypto.c opensc-support.c signer.c dialog.c \
+ signer.exports opensc-crypto.h opensc-support.h signer.h \
+ npinclude/jri.h npinclude/jri_md.h npinclude/jritypes.h npinclude/npapi.h \
+ npinclude/npunix.c npinclude/npupp.h
 opensc_signer_la_LIBADD = $(OPENSSL_LIBS) $(LIBASSUAN_LIBS) \
  $(top_builddir)/src/libopensc/libopensc.la
 opensc_signer_la_LDFLAGS = $(AM_LDFLAGS) \
  -export-symbols "$(srcdir)/signer.exports" \
- -module -avoid-version -no-undefined
-
-if ENABLE_NSPLUGIN
-plugin_DATA=#Create directory
-install-exec-hook: install-pluginDATA
- -rm -f "$(DESTDIR)$(plugindir)/opensc-signer.so"
- $(LN_S) "$(libdir)/opensc-signer.so" "$(DESTDIR)$(plugindir)"
-endif
+ -module -avoid-version -no-undefined -shared
Index: opensc-0.11.10/src/signer/npinclude/Makefile.am
===================================================================
--- opensc-0.11.10.orig/src/signer/npinclude/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-
-noinst_HEADERS = jri.h jri_md.h jritypes.h npapi.h npunix.c npupp.h
Index: opensc-0.11.10/src/signer/stubs.c
===================================================================
--- opensc-0.11.10.orig/src/signer/stubs.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C; tab-width: 4; -*- */
-/*******************************************************************************
- * Simple LiveConnect Sample Plugin
- * Copyright (c) 1996 Netscape Communications. All rights reserved.
- ******************************************************************************/
-
-/*
-** Ok, so we don't usually include .c files (only .h files) but we're
-** doing it here to avoid some fancy make rules. First pull in the common
-** glue code:
-*/
-#ifdef XP_UNIX
-#include "npunix.c"
-#endif


_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: [PATCH] opensc: simplify nsplugin build

by Martin Paljak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

So it seems we have a nsplugin user and new developer?
Do you use it? Would you be willing to maintain/develop it?
nsplugin has not seen any real *development* for 8 years :
http://www.opensc-project.org/opensc/log/trunk/src/signer

As I've also written a web signing plugin for Firefox/Opera/Safari I  
can say it has changed from "Netscape plugins" to a more useful, cross-
browser API. I don't know if the current signer can do it. But it's  
not trivial, for example on OS X plugins can have 3 or four different  
entry ways into the plugin, depending on CPU architecture and browser  
- different browsers (Namely Opera) do it a bit differently, at least  
they used to 1.5 years ago.

If there are users who use the otherwise almost dead code, we can  
extract it and leave it for those who want it, the way it currently  
is. It would use a deprecated API (directly libopensc), compete with  
pkcs11.sign() method of Firefox, would not work on other browsers and  
would not have any real documentation or designed features.


On 24.10.2009, at 16:34, Diego Elio “Flameeyes” Pettenò wrote:

> The attached patch simplifies the Makefile.am support for building the
> nsplugin. Beside removing the recursion inside npincludes (unneeded),
> and avoiding entering the directory entirely when nsplugin is  
> disabled,
> it also avoids building the static copy of the plugin itself (see [1])
> and at the same time installs it directly inside the nsplugin  
> directory,
> rather than sing a symlink (and “polluting” the main library  
> path).
>
> HTH,
>
> [1]
> http://www.flameeyes.eu/autotools-mythbuster/libtool/index.html#libtool.plugins.dlopen
>
> --
> Diego Elio Pettenò — “Flameeyes”
> http://blog.flameeyes.eu/
>
> If you found a .asc file in this mail and know not what it is,
> it's a GnuPG digital signature: http://www.gnupg.org/
>
> <opensc-0.11.10-nsplugin-
> simplify.patch>_______________________________________________
> opensc-devel mailing list
> opensc-devel@...
> http://www.opensc-project.org/mailman/listinfo/opensc-devel

--
Martin Paljak
http://martin.paljak.pri.ee
+372.515.6495




_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: [PATCH] opensc: simplify nsplugin build

by Martin Paljak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 26.10.2009, at 12:22, Martin Paljak wrote:
> As I've also written a web signing plugin for Firefox/Opera/Safari I  
> can say it has changed from "Netscape plugins" to a more useful,  
> cross-browser API. I don't know if the current signer can do it. But  
> it's not trivial, for example on OS X plugins can have 3 or four  
> different entry ways into the plugin, depending on CPU architecture  
> and browser - different browsers (Namely Opera) do it a bit  
> differently, at least they used to 1.5 years ago.
For more info: http://en.wikipedia.org/wiki/NPAPI#Scripting_support

signer code is 8 years old ~2001. A modern plugin would expose a  
scriptable object, use the browser/modal windows for user interaction  
etc.





>
> On 24.10.2009, at 16:34, Diego Elio “Flameeyes” Pettenò wrote:
>
>> The attached patch simplifies the Makefile.am support for building  
>> the
>> nsplugin. Beside removing the recursion inside npincludes (unneeded),
>> and avoiding entering the directory entirely when nsplugin is  
>> disabled,
>> it also avoids building the static copy of the plugin itself (see  
>> [1])
>> and at the same time installs it directly inside the nsplugin  
>> directory,
>> rather than sing a symlink (and “polluting” the main library  
>> path).
>>
>> HTH,
>>
>> [1]
>> http://www.flameeyes.eu/autotools-mythbuster/libtool/index.html#libtool.plugins.dlopen
>>
>> --
>> Diego Elio Pettenò — “Flameeyes”
>> http://blog.flameeyes.eu/
>>
>> If you found a .asc file in this mail and know not what it is,
>> it's a GnuPG digital signature: http://www.gnupg.org/
>>
>> <opensc-0.11.10-nsplugin-
>> simplify.patch>_______________________________________________
>> opensc-devel mailing list
>> opensc-devel@...
>> http://www.opensc-project.org/mailman/listinfo/opensc-devel
>
> --
> Martin Paljak
> http://martin.paljak.pri.ee
> +372.515.6495
>
>
>
>

--
Martin Paljak
http://martin.paljak.pri.ee
+372.515.6495




_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: [PATCH] opensc: simplify nsplugin build

by Diego E. Pettenò :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Il giorno Mon, 26/10/2009 alle 12.22 +0200, Martin Paljak ha scritto:
>
> So it seems we have a nsplugin user and new developer?
> Do you use it? Would you be willing to maintain/develop it?

Actually, no to all counts.

I just stumbled across this after last opensc update in Gentoo; I'm
doing QA work in Gentoo and one of the things I take care of usually is
ensuring that plugins don't get static archives and .la files built and
installed, so I checked the buildsystem and patched it up (as well as
fixing installation path in Gentoo).

Sorry for giving hope about that.

--
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/

If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/


_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: [PATCH] opensc: simplify nsplugin build

by Martin Paljak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 26.10.2009, at 12:35, Diego Elio “Flameeyes” Pettenò wrote:

> Il giorno Mon, 26/10/2009 alle 12.22 +0200, Martin Paljak ha scritto:
>>
>> So it seems we have a nsplugin user and new developer?
>> Do you use it? Would you be willing to maintain/develop it?
>
> Actually, no to all counts.
>
> I just stumbled across this after last opensc update in Gentoo; I'm
> doing QA work in Gentoo and one of the things I take care of usually  
> is
> ensuring that plugins don't get static archives and .la files built  
> and
> installed, so I checked the buildsystem and patched it up (as well as
> fixing installation path in Gentoo).
>
> Sorry for giving hope about that.

No worries, this is still a sign that the only effort that has gone  
into signer during past 8 years have been "update to fix compilation  
issues" type of stuff.

I still suggest to reap it out and re-package as a separate entity  
only after somebody discovers that it is used.


--
Martin Paljak
http://martin.paljak.pri.ee
+372.515.6495




_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: [PATCH] opensc: simplify nsplugin build

by Peter Stuge-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Paljak wrote:
> I still suggest to reap it out and re-package as a separate entity  
> only after somebody discovers that it is used.

I am in favor.


//Peter
_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel