Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #
  2. # Copyright (C) 2020-2021 Jo-Philipp Wich <[email protected]>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=ucode
  9. PKG_RELEASE:=1
  10. PKG_SOURCE_PROTO:=git
  11. PKG_SOURCE_URL=https://github.com/jow-/ucode.git
  12. PKG_SOURCE_DATE:=2021-07-30
  13. PKG_SOURCE_VERSION:=929c8627cf077c3e348fb12b02553d4a444c5e48
  14. PKG_MIRROR_HASH:=
  15. PKG_MAINTAINER:=Jo-Philipp Wich <[email protected]>
  16. PKG_LICENSE:=ISC
  17. PKG_ABI_VERSION:=20210730
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION)
  21. define Package/ucode/default
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=ucode - Tiny scripting and templating language
  25. endef
  26. define Package/ucode
  27. $(Package/ucode/default)
  28. DEPENDS:=+libucode
  29. endef
  30. define Package/ucode/description
  31. ucode is a tiny script interpreter featuring an ECMAScript oriented
  32. script language and Jinja-inspired templating.
  33. endef
  34. define Package/libucode
  35. $(Package/ucode/default)
  36. TITLE+= - runtime library
  37. ABI_VERSION:=$(PKG_ABI_VERSION)
  38. DEPENDS:=+libjson-c
  39. endef
  40. define Package/libucode/description
  41. The libucode package provides the shared runtime library for the ucode interpreter.
  42. endef
  43. define Package/ucode-mod-fs
  44. $(Package/ucode/default)
  45. TITLE+= (filesystem module)
  46. DEPENDS:=ucode
  47. endef
  48. define Package/ucode-mod-fs/description
  49. The filesystem plugin module allows interaction with the local file system.
  50. endef
  51. define Package/ucode-mod-math
  52. $(Package/ucode/default)
  53. TITLE+= (math module)
  54. DEPENDS:=ucode
  55. endef
  56. define Package/ucode-mod-math/description
  57. The math plugin provides access to various <math.h> procedures.
  58. endef
  59. define Package/ucode-mod-ubus
  60. $(Package/ucode/default)
  61. TITLE+= (ubus module)
  62. DEPENDS:=ucode +libubus +libblobmsg-json
  63. endef
  64. define Package/ucode-mod-ubus/description
  65. The ubus module allows ucode template scripts to enumerate and invoke ubus
  66. procedures.
  67. endef
  68. define Package/ucode-mod-uci
  69. $(Package/ucode/default)
  70. TITLE+= (uci module)
  71. DEPENDS:=ucode +libuci
  72. endef
  73. define Package/ucode-mod-uci/description
  74. The uci module allows templates to read and modify uci configuration.
  75. endef
  76. define Build/InstallDev
  77. $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode
  78. $(CP) $(PKG_INSTALL_DIR)/usr/include/ucode/*.h $(1)/usr/include/ucode/
  79. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so* $(1)/usr/lib/
  80. endef
  81. define Package/ucode/install
  82. $(INSTALL_DIR) $(1)/usr/bin
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ucode $(1)/usr/bin/ucode
  84. endef
  85. define Package/libucode/install
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
  88. endef
  89. define Package/ucode-mod-fs/install
  90. $(INSTALL_DIR) $(1)/usr/lib/ucode
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
  92. endef
  93. define Package/ucode-mod-math/install
  94. $(INSTALL_DIR) $(1)/usr/lib/ucode
  95. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/
  96. endef
  97. define Package/ucode-mod-ubus/install
  98. $(INSTALL_DIR) $(1)/usr/lib/ucode
  99. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/
  100. endef
  101. define Package/ucode-mod-uci/install
  102. $(INSTALL_DIR) $(1)/usr/lib/ucode
  103. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/
  104. endef
  105. $(eval $(call BuildPackage,ucode))
  106. $(eval $(call BuildPackage,libucode))
  107. $(eval $(call BuildPackage,ucode-mod-fs))
  108. $(eval $(call BuildPackage,ucode-mod-math))
  109. $(eval $(call BuildPackage,ucode-mod-ubus))
  110. $(eval $(call BuildPackage,ucode-mod-uci))