1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2022-2023 Enéas Ulir de Queiroz
7 define Package
/openssl
/engine
/Default
11 DEPENDS
:=libopenssl @OPENSSL_ENGINE
+libopenssl-conf
15 # 2 - package name, defaults to libopenssl-$(1)
16 define Package
/openssl
/add-engine
17 OSSL_ENG_PKG
:=$(if
$(2),$(2),libopenssl-
$(1))
18 Package
/$$(OSSL_ENG_PKG
)/conffiles
:=/etc
/ssl
/engines.cnf.d
/$(1).cnf
20 define Package
/$$(OSSL_ENG_PKG
)/install
21 $$(INSTALL_DIR
) $$(1)/usr
/lib
/$(ENGINES_DIR
)
22 $$(INSTALL_BIN
) $$(PKG_INSTALL_DIR
)/usr
/lib
/$(ENGINES_DIR
)/$(1).so \
23 $$(1)/usr
/lib
/$(ENGINES_DIR
)
24 $$(INSTALL_DIR
) $$(1)/etc
/ssl
/engines.cnf.d
25 $$(INSTALL_DATA
) .
/files
/$(1).cnf
$$(1)/etc
/ssl
/engines.cnf.d
/
28 define Package
/$$(OSSL_ENG_PKG
)/postinst
:=
30 OPENSSL_UCI
="$$$${IPKG_INSTROOT}/etc/config/openssl"
32 [ -z
"$$$${IPKG_INSTROOT}" ] && uci
-q
get openssl.
$(1) >/dev
/null
&& exit
0
34 cat
<< EOF
>> "$$$${OPENSSL_UCI}"
40 [ -n
"$$$${IPKG_INSTROOT}" ] ||
/etc
/init.d
/openssl reload
43 define Package
/$$(OSSL_ENG_PKG
)/postrm
:=
45 [ -n
"$$$${IPKG_INSTROOT}" ] && exit
0
46 uci delete openssl.
$(1)
48 /etc
/init.d
/openssl reload