PSARC/2016/219 Coolkey PKCS#11 provider for smartcard devices
24657612 coolkey needs to deliver 32-bit libraries
--- a/components/coolkey/Makefile Fri Nov 25 17:16:40 2016 -0800
+++ b/components/coolkey/Makefile Sat Nov 26 05:55:27 2016 -0800
@@ -45,7 +45,6 @@
include ../../make-rules/shared-macros.mk
-BITS= 64
COMPONENT_NAME= coolkey
COMPONENT_VERSION= 1.1.0
COMPONENT_PROJECT_URL= http://pki.fedoraproject.org/wiki/CoolKey
@@ -63,15 +62,25 @@
include $(WS_MAKE_RULES)/ips.mk
# Configuration related patch needs aclocal to be regenerated
-COMPONENT_PREP_ACTION +=(cd $(@D); autoconf);
+COMPONENT_PREP_ACTION += (cd $(@D); autoconf);
+
-# Do not add the SUNWspro area to the RUNPATH
-# Although -norunpath is set in CXXFLAGS, we need to append
-# the -norunpath option here, so it's picked up when building
-# shared libraries (CC -G)
-CXX += $(studio_NORUNPATH)
-COMPONENT_BUILD_ENV += CXXFLAGS="$(CXXFLAGS)"
-COMPONENT_INSTALL_ENV += CXXFLAGS="$(CXXFLAGS)"
+# Do not add the SUNWspro area to the RUNPATH. Follow exactly what CC does.
+REAL_SPRO_VROOT = $(realpath $(SPRO_VROOT))
+LD_UNSET.32.i386 = -R$(REAL_SPRO_VROOT)/lib/rw7:$(REAL_SPRO_VROOT)/lib
+LD_UNSET.32.sparc = -R$(REAL_SPRO_VROOT)/lib/rw7:$(REAL_SPRO_VROOT)/lib/$(MACH):$(REAL_SPRO_VROOT)/lib
+LD_UNSET.32 = $(LD_UNSET.32.$(MACH)):/usr/ccs/lib:/lib:/usr/lib
+LD_UNSET.64.i386 = -R$(REAL_SPRO_VROOT)/lib/rw7/$(MACH64):$(REAL_SPRO_VROOT)/lib/$(MACH64):/usr/ccs/lib/$(MACH64):/lib/64:/usr/lib/64
+LD_UNSET.64.sparc = -R$(REAL_SPRO_VROOT)/lib/rw7/v9:$(REAL_SPRO_VROOT)/lib/$(MACH)/64:/usr/ccs/lib/$(MACH64):/lib/$(MACH64):/usr/lib/$(MACH64)
+LD_UNSET.64 = $(LD_UNSET.64.$(MACH))
+LD_UNSET += $(LD_UNSET.$(BITS))
+COMPONENT_BUILD_ENV += LD_UNSET="$(LD_UNSET)"
+COMPONENT_INSTALL_ENV += LD_UNSET="$(LD_UNSET)"
+
+# Propagate correct LDFLAGS to the linking phase.
+LDFLAGS += $(CC_BITS)
+COMPONENT_BUILD_ARGS += LDFLAGS="$(LDFLAGS)"
+COMPONENT_INSTALL_ARGS += LDFLAGS="$(LDFLAGS)"
# Requires PC/SC headers and library
CONFIGURE_ENV += PCSC_CFLAGS="$(CFLAGS) -I$(USRINCDIR)/PCSC"
@@ -83,11 +92,11 @@
CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)"
# Common targets
-configure: $(CONFIGURE_64)
+configure: $(CONFIGURE_32_and_64)
-build: $(BUILD_64)
+build: $(BUILD_32_and_64)
-install: $(INSTALL_64)
+install: $(INSTALL_32_and_64)
test: $(NO_TEST)
--- a/components/coolkey/coolkey.p5m Fri Nov 25 17:16:40 2016 -0800
+++ b/components/coolkey/coolkey.p5m Sat Nov 26 05:55:27 2016 -0800
@@ -41,4 +41,9 @@
file path=usr/lib/$(MACH64)/libckyapplet.so.1.0.0
file path=usr/lib/$(MACH64)/libcoolkeypk11.so
link path=usr/lib/$(MACH64)/libcoolkeypk11.so.1 target=libcoolkeypk11.so
+link path=usr/lib/libckyapplet.so target=libckyapplet.so.1.0.0
+link path=usr/lib/libckyapplet.so.1 target=libckyapplet.so.1.0.0
+file path=usr/lib/libckyapplet.so.1.0.0
+file path=usr/lib/libcoolkeypk11.so
+link path=usr/lib/libcoolkeypk11.so.1 target=libcoolkeypk11.so
license coolkey.license license=LGPLv2.1
--- a/components/coolkey/patches/00-configuration.patch Fri Nov 25 17:16:40 2016 -0800
+++ b/components/coolkey/patches/00-configuration.patch Sat Nov 26 05:55:27 2016 -0800
@@ -1,10 +1,11 @@
-In-house patch created to remove the /pkcs11 subdir from "pkcs11dir" definition as
-Solaris does not use that convention for its pkcs11 libraries.
+In-house patch created to remove the /pkcs11 subdir from "pkcs11dir" definition
+as Solaris does not use that convention for its pkcs11 libraries.
-Fixed erroneous blank line found in coolkeypk11.sym file creation which causes an
-error with studio compiler and sun linker.
+Fixed erroneous blank line found in coolkeypk11.sym file creation which causes
+an error with Studio compiler and Solaris linker.
-Added 64-fit flag for c++ and ld linking to solaris section of aclocal.m4
+Added proper 32-bit or 64-fit flag for C++ and ld linking to solaris section
+of aclocal.m4.
This patch is Solaris buildenv specific and may not be suitable for upstream.
@@ -65,14 +66,14 @@
clean-generic:
rm -f coolkeypk11.sym
---- ORIGINAL/./aclocal.m4 2016-06-29 00:23:04.484933583 -0400
-+++ ././aclocal.m4 2016-06-29 08:09:30.082985198 -0400
+--- a/aclocal.m4 2016-09-14 08:45:59.170910473 +0000
++++ b/aclocal.m4 2016-09-14 09:01:07.886108085 +0000
@@ -3575,7 +3575,7 @@
_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-+ $CC -G -m64 ${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
++ $CC $LDFLAGS -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/coolkey/patches/18-configure.in.patch Sat Nov 26 05:55:27 2016 -0800
@@ -0,0 +1,18 @@
+Upstream fixes already included in the latest community updates to coolkey v1.1.0
+
+Fixes a syntax error when running configure script.
+
+--- a/configure.in (revision 53)
++++ b/configure.in (revision 81)
+@@ -124,9 +124,9 @@
+ if test $WINDOWS -ne 1; then
+ PKG_CHECK_MODULES(NSS, nss, true, [ AC_MSG_ERROR(could not find NSS Crypto libraries) ])
+ fi
+- enable_pk11install = "yes"
++ enable_pk11install="yes"
+ else
+- enable_pk11install = "no"
++ enable_pk11install="no"
+ AC_MSG_WARN([skipping pk11install])
+ fi
+