Hi,

I'm a Gentoo Linux developer and I recently got my hands on a token that
works with opensc, so I started looking into improving our support for
it in PAM (I'm the maintainer of the PAM packages).

Looking at pam_pkcs11 I found that the build system is slightly
sub-optimal, in the sense that it builds, by default, static objects for
plugins (like the PAM module itself), and uses a custom override rule
for install to avoid installing the static version.

It also install the examples in the datadir instead of the docdir (which
is what you would probably want, even the manual on the site refers
to /usr/share/doc).

The attached patch fixes both problems, and at the same time defines a
pamdir variable that can be used to select a different location for the
PAM module (not all systems use the same path).

HTH!

-- 
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/

Index: pam_pkcs11-0.6.1/etc/Makefile.am
===================================================================
--- pam_pkcs11-0.6.1.orig/etc/Makefile.am
+++ pam_pkcs11-0.6.1/etc/Makefile.am
@@ -10,4 +10,4 @@ EXTRA_DIST = pam_pkcs11.conf.example \
 	pkcs11_eventmgr.conf.example \
 	card_eventmgr.conf.example
 
-pkgdata_DATA = $(EXTRA_DIST)
+doc_DATA = $(EXTRA_DIST)
Index: pam_pkcs11-0.6.1/src/pam_pkcs11/Makefile.am
===================================================================
--- pam_pkcs11-0.6.1.orig/src/pam_pkcs11/Makefile.am
+++ pam_pkcs11-0.6.1/src/pam_pkcs11/Makefile.am
@@ -5,17 +5,15 @@ MAINTAINERCLEANFILES = Makefile.in
 AM_CFLAGS = -Wall -fno-strict-aliasing $(CRYPTO_CFLAGS)
 AM_CPPFLAGS = -Wall -fno-strict-aliasing $(CRYPTO_CFLAGS)
 
-lib_LTLIBRARIES = pam_pkcs11.la
+pamdir=$(libdir)/security
+
+pam_LTLIBRARIES = pam_pkcs11.la
 
 pam_pkcs11_la_SOURCES =  pam_pkcs11.c  \
 			mapper_mgr.c mapper_mgr.h \
 			pam_config.c pam_config.h
-pam_pkcs11_la_LDFLAGS = -module -avoid-version
+pam_pkcs11_la_LDFLAGS = -module -avoid-version -shared
 pam_pkcs11_la_LIBADD = $(LIBMAPPERS) $(CRYPTO_LIBS)
 
-install:       
-	$(mkinstalldirs) $(DESTDIR)/$(libdir)/security
-	$(libLTLIBRARIES_INSTALL) $(top_builddir)/src/pam_pkcs11/.libs/pam_pkcs11.so $(DESTDIR)/$(libdir)/security
-
 format:
 	indent *.c *.h
Index: pam_pkcs11-0.6.1/src/mappers/Makefile.am
===================================================================
--- pam_pkcs11-0.6.1.orig/src/mappers/Makefile.am
+++ pam_pkcs11-0.6.1/src/mappers/Makefile.am
@@ -52,56 +52,56 @@ lib_LTLIBRARIES = opensc_mapper.la opens
 endif
 
 openssh_mapper_la_SOURCES = openssh_mapper.c openssh_mapper.h
-openssh_mapper_la_LDFLAGS = -module -avoid-version
+openssh_mapper_la_LDFLAGS = -module -avoid-version -shared
 openssh_mapper_la_LIBADD = libmappers.la
 
 # generic_mapper_la_SOURCES = generic_mapper.c generic_mapper.h
-# generic_mapper_la_LDFLAGS = -module -avoid-version
+# generic_mapper_la_LDFLAGS = -module -avoid-version -shared
 # generic_mapper_la_LIBADD = libmappers.la
 
 # subject_mapper_la_SOURCES = subject_mapper.c subject_mapper.h
-# subject_mapper_la_LDFLAGS = -module -avoid-version
+# subject_mapper_la_LDFLAGS = -module -avoid-version -shared
 # subject_mapper_la_LIBADD = libmappers.la
 
 if HAVE_LDAP
 ldap_mapper_la_SOURCES = ldap_mapper.c ldap_mapper.h
-ldap_mapper_la_LDFLAGS = -module -avoid-version
+ldap_mapper_la_LDFLAGS = -module -avoid-version -shared
 ldap_mapper_la_LIBADD = libmappers.la
 endif
 
 opensc_mapper_la_SOURCES = opensc_mapper.c opensc_mapper.h
-opensc_mapper_la_LDFLAGS = -module -avoid-version
+opensc_mapper_la_LDFLAGS = -module -avoid-version -shared
 opensc_mapper_la_LIBADD = libmappers.la
 
 # mail_mapper_la_SOURCES = mail_mapper.c mail_mapper.h
-# mail_mapper_la_LDFLAGS = -module -avoid-version
+# mail_mapper_la_LDFLAGS = -module -avoid-version -shared
 # mail_mapper_la_LIBADD = libmappers.la
 
 # ms_mapper_la_SOURCES = ms_mapper.c ms_mapper.h
-# ms_mapper_la_LDFLAGS = -module -avoid-version
+# ms_mapper_la_LDFLAGS = -module -avoid-version -shared
 # ms_mapper_la_LIBADD = libmappers.la
 
 # krb_mapper_la_SOURCES = krb_mapper.c krb_mapper.h
-# krb_mapper_la_LDFLAGS = -module -avoid-version
+# krb_mapper_la_LDFLAGS = -module -avoid-version -shared
 # krb_mapper_la_LIBADD = libmappers.la
 
 # cn_mapper_la_SOURCES = cn_mapper.c cn_mapper.h
-# cn_mapper_la_LDFLAGS = -module -avoid-version
+# cn_mapper_la_LDFLAGS = -module -avoid-version -shared
 # cn_mapper_la_LIBADD = libmappers.la
 
 # uid_mapper_la_SOURCES = uid_mapper.c uid_mapper.h
-# uid_mapper_la_LDFLAGS = -module -avoid-version
+# uid_mapper_la_LDFLAGS = -module -avoid-version -shared
 # uid_mapper_la_LIBADD = libmappers.la
 
 # pwent_mapper_la_SOURCES = pwent_mapper.c pwent_mapper.h
-# pwent_mapper_la_LDFLAGS = -module -avoid-version
+# pwent_mapper_la_LDFLAGS = -module -avoid-version -shared
 # pwent_mapper_la_LIBADD = libmappers.la
 
 # digest_mapper_la_SOURCES = digest_mapper.c digest_mapper.h
-# digest_mapper_la_LDFLAGS = -module -avoid-version
+# digest_mapper_la_LDFLAGS = -module -avoid-version -shared
 # digest_mapper_la_LIBADD = libmappers.la
 
 # null_mapper_la_SOURCES = null_mapper.c null_mapper.h
-# null_mapper_la_LDFLAGS = -module -avoid-version
+# null_mapper_la_LDFLAGS = -module -avoid-version -shared
 # null_mapper_la_LIBADD = libmappers.la
 
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to