libp11: package PKCS#11 OpenSSL engine
authorDaniel Golle <daniel@makrotopia.org>
Mon, 26 Sep 2016 07:29:05 +0000 (09:29 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 26 Sep 2016 08:14:29 +0000 (10:14 +0200)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libs/libp11/Makefile
libs/libp11/patches/001-fix-install.patch [new file with mode: 0644]

index 5d6b9babfeeb49f22e221ee4defe2857acfb2098..c477d2b1ad50de1e6c4e99134e32bc381c7b87bf 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libp11
 PKG_VERSION:=0.4.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MD5SUM:=70489f6dbe0b7fd72aab010c25016fa047723f67ea50ce9ae73bc8d38181b673
 
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
@@ -30,6 +30,7 @@ define Package/libp11
   TITLE:=PKCS#11 wrapper library
   URL:=https://www.opensc-project.org/opensc/wiki/libp11
   DEPENDS:=+libopenssl
+  CONFLICTS:=engine_pkcs11
 endef
 
 define Package/libp11/description
@@ -37,6 +38,8 @@ define Package/libp11/description
   to make using PKCS#11 implementations easier.
 endef
 
+CONFIGURE_ARGS += --with-enginesdir=/usr/lib/engines
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/
        $(CP) $(PKG_INSTALL_DIR)/usr/include/libp11.h $(1)/usr/include/
@@ -48,8 +51,11 @@ define Build/InstallDev
 endef
 
 define Package/libp11/install
-       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libp11.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/engines
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/engines/*.so* $(1)/usr/lib/engines
+       $(LN) pkcs11.so $(1)/usr/lib/engines/libpkcs11.so
 endef
 
 $(eval $(call BuildPackage,libp11))
diff --git a/libs/libp11/patches/001-fix-install.patch b/libs/libp11/patches/001-fix-install.patch
new file mode 100644 (file)
index 0000000..eb9b774
--- /dev/null
@@ -0,0 +1,69 @@
+Index: libp11-0.4.1/src/Makefile.am
+===================================================================
+--- libp11-0.4.1.orig/src/Makefile.am
++++ libp11-0.4.1/src/Makefile.am
+@@ -36,12 +36,6 @@ pkcs11_la_LIBADD = $(libp11_la_OBJECTS)
+ pkcs11_la_LDFLAGS = $(AM_LDFLAGS) -module -shared -shrext $(SHARED_EXT) \
+       -avoid-version -export-symbols "$(srcdir)/pkcs11.exports"
+-# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
+-check-local: $(LTLIBRARIES)
+-      cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-install-exec-hook:
+-      cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-
+ if WIN32
+ # def file required for MS users to build library
+ mylibdir=$(libdir)
+Index: libp11-0.4.1/src/Makefile.in
+===================================================================
+--- libp11-0.4.1.orig/src/Makefile.in
++++ libp11-0.4.1/src/Makefile.in
+@@ -839,7 +839,7 @@ distdir: $(DISTFILES)
+         fi; \
+       done
+ check-am: all-am
+-      $(MAKE) $(AM_MAKEFLAGS) check-local
++      $(MAKE) $(AM_MAKEFLAGS)
+ check: check-am
+ all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h
+ installdirs:
+@@ -910,7 +910,7 @@ install-dvi-am:
+ install-exec-am: install-libLTLIBRARIES
+       @$(NORMAL_INSTALL)
+-      $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
++      $(MAKE) $(AM_MAKEFLAGS)
+ install-html: install-html-am
+ install-html-am:
+@@ -955,7 +955,7 @@ uninstall-am: uninstall-enginesLTLIBRARI
+ .MAKE: all check-am install-am install-exec-am install-strip
+-.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
++.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+       clean-enginesLTLIBRARIES clean-generic clean-libLTLIBRARIES \
+       clean-libtool cscopelist-am ctags ctags-am distclean \
+       distclean-compile distclean-generic distclean-hdr \
+@@ -963,7 +963,7 @@ uninstall-am: uninstall-enginesLTLIBRARI
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am \
+       install-enginesLTLIBRARIES install-exec install-exec-am \
+-      install-exec-hook install-html install-html-am \
++      install-html install-html-am \
+       install-includeHEADERS install-info install-info-am \
+       install-libLTLIBRARIES install-man install-mylibDATA \
+       install-pdf install-pdf-am install-pkgconfigDATA install-ps \
+@@ -979,11 +979,6 @@ uninstall-am: uninstall-enginesLTLIBRARI
+       $(srcdir)/config.h.in $(srcdir)/config.h.in~
+-# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
+-check-local: $(LTLIBRARIES)
+-      cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-install-exec-hook:
+-      cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+ @WIN32_TRUE@.libs/@WIN_LIBPREFIX@p11-@LIBP11_LT_OLDEST@.dll.def:      libp11.la
+ .rc.lo: