summaryrefslogtreecommitdiffstats
path: root/utils/mox-pkcs11/Makefile
blob: fe325cbb5a021a36cd6f3cb14350c5961e50e4d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# SPDX-License-Identifier: GPL-3.0-only
# Copyright (C) 2020, 2025 CZ.NIC z.s.p.o. (https://www.nic.cz/)

include $(TOPDIR)/rules.mk

PKG_NAME:=mox-pkcs11
PKG_VERSION:=2.0
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/mox-pkcs11.git
PKG_MIRROR_HASH:=424b5247288310c6a71b7babed201dc153c58fca73241530254d2cbc84f1b4ef
PKG_SOURCE_VERSION:=v$(PKG_VERSION)

PKG_MAINTAINER:=Tomáš Macholda <tomas.macholda@nic.cz>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE.txt

include $(INCLUDE_DIR)/package.mk

define Package/mox-pkcs11
	SECTION:=utils
	CATEGORY:=Utilities
	TITLE:=MOX PKCS11 module
	DEPENDS:=@(TARGET_mvebu_cortexa53_DEVICE_ripe_atlas-v5||TARGET_mvebu_cortexa53_DEVICE_cznic_turris-mox) +libopenssl +libkeyutils
	URL:=https://gitlab.nic.cz/turris/mox-pkcs11
endef

define Package/mox-pkcs11/description
  PKCS#11 module that provides access to Turris MOX internal ECDSA key
  for cryptographic operations.
endef

define Build/Compile
	$(TARGET_CC) \
	$(TARGET_CFLAGS) \
	$(TARGET_LDFLAGS) \
	$(FPIC) \
	-o $(PKG_BUILD_DIR)/libmox-pkcs11.so $(PKG_BUILD_DIR)/mox-pkcs11.c
	-lcrypto \
	-lkeyutils \
	-Wall \
	-shared
endef

define Package/mox-pkcs11/install
	$(INSTALL_DIR) $(1)/usr/lib/pkcs11/
	$(INSTALL_DATA) $(PKG_BUILD_DIR)/libmox-pkcs11.so $(1)/usr/lib/pkcs11/
endef

$(eval $(call BuildPackage,mox-pkcs11))