File lpac.spec of Package lpac

#
# spec file for package lpac
#
# Copyright (c) 2023-2024, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           lpac
Version:        1.0.0
Release:        0
Summary:        C-based eUICC LPA
# The launcher (cli wrapper under src directory ): AGPLv3
# The interfaces:  MIT
# The API framework (libeuicc, code under euicc directory): LGPLv2
License:        AGPL-3.0-only and MIT and LGPL-2.0-only
URL:            https://github.com/estkme-group/lpac
Source:         %{name}-%{version}.tar.xz
BuildRequires:  chrpath
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pcsc-lite-devel
Requires:       pcsc-lite
Provides:       bundled(cJSON)

%description
C-based eUICC LPA.

Features:
 * Supports activation code (Activate Code) and confirmation code (Confirm Code).
 * Supports custom request IMEI.
 * Profile management --enable, disable, delete, set nickname, etc.
 * Discovery function (Push Model) -- Query and download configuration files.
   pushed by telecom operators.
 * Notification management--query, send, delete.
 * View eUICC metadata--Query the eUICC eID, root SM-DP+ server and SM-DS server
   addresses


libapduinterface
The APDU library and HTTP library will be used by default libhttpinterface.
Please rename them in advance to select the library you want to use. Or
tell lpac to use the APDU library and HTTP library through the
"APDU_INTERFACE" and "HTTP_INTERFACE" environment variables.

APDU:
* libapduinterface_at - /dev/ttyUSB0AT command interface suitable for LTE module
* libapduinterface_pcsc - PCSC card reader interface
* libapduinterface_stdio - standard input and output

libapduinterface_at is suitable for the AT command interface of the LTE module,
usually /dev/ttyUSBx. You need to confirm the specific AT command interface
yourself.

HTTP:
* libhttpinterface_curlcurl - http library
* libhttpinterface_stdio - HTTP interface using standard input and output.

The following takes the typical usage scenario of using PCSC card reader and
cURL library to download profiles as an example to define environment variables:

Example:
* export APDU_INTERFACE=%{_libdir}/lpac/libapduinterface_pcsc.so
* export HTTP_INTERFACE=%{_libdir}/lpac/libhttpinterface_curl.so

See the official documentation for more details:
https://github-com.translate.goog/estkme-group/lpac?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=de&_x_tr_pto=wapp

%prep
%setup
cp interface/LICENSE LICENSE.interface
cp euicc/LICENSE LICENSE.api
cp src/LICENSE LICENSE.launcher

%build
%cmake
%cmake_build

%install
install -Dpm0755 build/output/lpac %{buildroot}%{_bindir}/lpac
install -d %{buildroot}%{_libdir}/lpac
install -m0755 ./build/output/lib*.so %{buildroot}%{_libdir}/lpac/

# RPATH contains the builddir yucks!
chrpath -d %{buildroot}%{_bindir}/lpac


%files
%license LICENSE.*
%doc README.md
%{_bindir}/lpac
%dir %{_libdir}/lpac
%{_libdir}/lpac/libapduinterface_at.so
%{_libdir}/lpac/libapduinterface_pcsc.so
%{_libdir}/lpac/libapduinterface_stdio.so
%{_libdir}/lpac/libhttpinterface_curl.so
%{_libdir}/lpac/libhttpinterface_stdio.so

%changelog
openSUSE Build Service is sponsored by