Opencryptoki package compilation issue

I am trying to add a new package opencryptoki to OpenWrt. I am running into a build issue. Won't mind a second pair of eyes to point out the mistake.

On ubuntu the commands to compile opencryptoki are
autoreconf --force --install --verbose --warnings=all
./configure
make

Makefile

include $(TOPDIR)/rules.mk

PKG_NAME:=opencryptoki
PKG_VERSION:=3.11.1
PKG_RELEASE:=1
PKG_REV:=53ab2ad6f7ef79efa714a9a83c21920afa3bc576

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/opencryptoki/opencryptoki.git
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_PROTO:=git

PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4

PKG_LICENSE:=CPL-1.0

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/libopencryptoki/Default/description
OpenCryptoki library
endef

define Package/opencryptoki/Default/description
PKCS11 Cryptographic Token Interface Standard implementation
endef

define Package/libopencryptoki
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=opencryptoki library
endef

define Package/opencryptoki
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libopencryptoki +openssl-util
  TITLE:=PKCS11 Cryptographic Token Interface Standard implementation
endef

CONFIGURE_ARGS += "--enable-icsftok=no"
CONFIGURE_ARGS += "--enable-ccatok=no"

TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -fpie
TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib -pie

define Package/libopencryptoki/install
        $(INSTALL_DIR) $(1)/lib
        $(CP) $(PKG_BUILD_DIR)/libopencryptoki.so* $(1)/lib/
endef

define Package/opencryptoki/install
        $(INSTALL_DIR) $(1)/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/pkcsconf $(1)/sbin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/pkcsslotd $(1)/sbin/
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/pkcs $(1)/sbin/
endef

define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/libopencryptoki.so* $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/libopencryptoki.a $(1)/usr/lib
endef

$(eval $(call BuildPackage,opencryptoki))
$(eval $(call BuildPackage,libopencryptoki))

CMake Error: The source directory "openwrt/build_dir/target-arm_cortex-a7_uClibc-1.0.14_eabi/opencryptoki-3.11.1" does not appear to contain CMakeLists.txt.

Is the error caused by this^^^ ?

Thanks :smiley:

Yes, that solved cmake error. I am working through more errors. There is libldap dependency. Will publish the makefile, once I hash out all the errors. Thanks for eyeballing and pointing out the error.

Hi zer0_0ne. I am working on this issue too and I am trying to install openldap library. I found a packages from web site of openwrt but I couldn't build it yet. Did you install it?