Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # Copyright (C) 2022 Eneas Ulir de Queiroz
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:=uencrypt
  5. PKG_RELEASE:=5
  6. PKG_LICENSE:=GPL-2.0-or-later
  7. PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
  8. include $(INCLUDE_DIR)/package.mk
  9. include $(INCLUDE_DIR)/cmake.mk
  10. CMAKE_INSTALL:=1
  11. ifeq ($(BUILD_VARIANT),mbedtls)
  12. CMAKE_OPTIONS+=-DUSE_MBEDTLS=1
  13. else ifeq ($(BUILD_VARIANT),wolfssl)
  14. CMAKE_OPTIONS+=-DUSE_WOLFSSL=1
  15. endif
  16. TARGET_CFLAGS+=-Wall
  17. define Package/uencrypt/default
  18. SECTION:=utils
  19. CATEGORY:=Base system
  20. TITLE:=Small Decryption utility
  21. endef
  22. define Package/uencrypt/default/description
  23. This is a small encrypton/decryption program. It defaults
  24. to AES-128-CBC, but supports any encryption provided by
  25. the crypto library. Even though it can be used for
  26. non-critical* regular encryption and decryption operations,
  27. it is included here to unencrypt the configuration from mtd
  28. on some devices.
  29. * Key and IV are exposed on cmdline
  30. This variant uses $(1) as crypto provider
  31. endef
  32. define Package/uencrypt-mbedtls
  33. $(Package/uencrypt/default)
  34. VARIANT:=mbedtls
  35. TITLE+= using mbedTLS
  36. DEPENDS:=+libmbedtls
  37. CONFLICTS:=uencrypt-openssl uencrypt-wolfssl
  38. endef
  39. Package/uencrypt-mbedtls/description= \
  40. $(call Package/uencrypt/default/description,mbedTLS)
  41. define Package/uencrypt-openssl
  42. $(Package/uencrypt/default)
  43. VARIANT:=openssl
  44. TITLE+= using OpenSSL
  45. DEPENDS:=+libopenssl
  46. CONFLICTS:=uencrypt-wolfssl
  47. endef
  48. Package/uencrypt-openssl/description= \
  49. $(call Package/uencrypt/default/description,OpenSSL)
  50. define Package/uencrypt-wolfssl
  51. $(Package/uencrypt/default)
  52. VARIANT:=wolfssl
  53. TITLE+= using wolfSSL
  54. DEPENDS:=+libwolfssl
  55. endef
  56. Package/uencrypt-wolfssl/description= \
  57. $(call Package/uencrypt/default/description,wolfSSL)
  58. define Package/uencrypt/default/install
  59. $(INSTALL_DIR) $(1)/usr/bin
  60. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/uencrypt $(1)/usr/bin
  61. endef
  62. Package/uencrypt-openssl/install = $(Package/uencrypt/default/install)
  63. Package/uencrypt-wolfssl/install = $(Package/uencrypt/default/install)
  64. Package/uencrypt-mbedtls/install = $(Package/uencrypt/default/install)
  65. $(eval $(call BuildPackage,uencrypt-mbedtls))
  66. $(eval $(call BuildPackage,uencrypt-openssl))
  67. $(eval $(call BuildPackage,uencrypt-wolfssl))