lpac: make APDU backends configurable

Currently, lpac will be built with the PCSC and AT APDU backends by default
and its not configurable in OpenWrt.

Since smart card reads are not really common on OpenWrt devices lets
disable PCSC backend by default so we dont have to include PCSC lib and
daemon by default.

AT backend is left enabled by default since it has no external dependecies
and all modems have it.

QMI over QRTR backend is not selectable even though it is part of the 2.0.2
relase since it requires unstable libqmi 1.35.4 or newer and we are still
using 1.34 stable branch.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
This commit is contained in:
Robert Marko 2024-07-02 18:15:02 +02:00 committed by Rosen Penev
parent 7224e0ff04
commit 34f9d96b4c
2 changed files with 31 additions and 2 deletions

16
utils/lpac/Config.in Normal file
View File

@ -0,0 +1,16 @@
menu "Configuration"
depends on PACKAGE_lpac
config LPAC_WITH_PCSC
bool "Include APDU PCSC Backend support"
default n
help
Compile LPAC with APDU PCSC Backend support.
config LPAC_WITH_AT
bool "Include APDU AT Backend support"
default y
help
Compile LPAC with APDU AT Backend support.
endmenu

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=lpac PKG_NAME:=lpac
PKG_VERSION:=2.0.2 PKG_VERSION:=2.0.2
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/estkme-group/lpac/tar.gz/refs/tags/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/estkme-group/lpac/tar.gz/refs/tags/v$(PKG_VERSION)?
@ -22,7 +22,10 @@ define Package/lpac
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
TITLE:=eUICC eSIM LPA written in C TITLE:=eUICC eSIM LPA written in C
DEPENDS:=+libpcsclite +pcscd +libcurl DEPENDS:= \
+LPAC_WITH_PCSC:libpcsclite \
+LPAC_WITH_PCSC:pcscd \
+libcurl
URL:=https://github.com/estkme-group/lpac URL:=https://github.com/estkme-group/lpac
endef endef
@ -32,12 +35,22 @@ define Package/lpac/description
backends. backends.
endef endef
define Package/lpac/config
source "$(SOURCE)/Config.in"
endef
define Package/lpac/conffiles define Package/lpac/conffiles
/etc/config/lpac /etc/config/lpac
endef endef
TARGET_CFLAGS += $(FPIC) TARGET_CFLAGS += $(FPIC)
CMAKE_OPTIONS += \
-DLPAC_WITH_APDU_PCSC=$(if $(CONFIG_LPAC_WITH_PCSC),ON,OFF) \
-DLPAC_WITH_APDU_AT=$(if $(CONFIG_LPAC_WITH_AT),ON,OFF) \
# libqmi 1.35.4 or newer is required for this
-DLPAC_WITH_APDU_QMI_QRTR=OFF
define Package/lpac/install define Package/lpac/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/lpac.sh $(1)/usr/bin/lpac $(INSTALL_BIN) ./files/lpac.sh $(1)/usr/bin/lpac