aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-22 16:09:56 +0200
committerJo-Philipp Wich <jo@mein.io>2021-03-19 20:16:11 +0100
commit56f4e54127ff14c0fff22940dfa10e237b291989 (patch)
treeba9daf715ff6215dae4cf8e8a1c59931328580ec
parent0c0cb97da7f5cc06919449131dd57ed805f8f78d (diff)
downloadupstream-56f4e54127ff14c0fff22940dfa10e237b291989.tar.gz
upstream-56f4e54127ff14c0fff22940dfa10e237b291989.tar.bz2
upstream-56f4e54127ff14c0fff22940dfa10e237b291989.zip
ucode: introduce package
This commit introduces ucode, a tiny template processor utilizing a syntax closely resembling ECMA Script for embedded script blocks. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--package/utils/ucode/Makefile116
1 files changed, 116 insertions, 0 deletions
diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile
new file mode 100644
index 0000000000..64b6c7bcda
--- /dev/null
+++ b/package/utils/ucode/Makefile
@@ -0,0 +1,116 @@
+#
+# Copyright (C) 2020-2021 Jo-Philipp Wich <jo@mein.io>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ucode
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/jow-/ucode.git
+PKG_SOURCE_DATE:=2021-03-19
+PKG_SOURCE_VERSION:=4a5b9010ccc56fdf288fe758023af445feb93fad
+PKG_MIRROR_HASH:=145a2ce69e14cae9b448de85b94c7a817ba3aea04b1611399186ad36fb88958e
+PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_LICENSE:=ISC
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/ucode/default
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=ucode - Tiny scripting and templating language
+endef
+
+define Package/ucode
+ $(Package/ucode/default)
+ DEPENDS:=+libjson-c
+endef
+
+define Package/ucode/description
+ ucode is a tiny script interpreter featuring an ECMAScript oriented
+ script language and Jinja-inspired templating.
+endef
+
+
+define Package/ucode-mod-fs
+ $(Package/ucode/default)
+ TITLE+= (filesystem module)
+ DEPENDS:=ucode
+endef
+
+define Package/ucode-mod-fs/description
+ The filesystem plugin module allows interaction with the local file system.
+endef
+
+
+define Package/ucode-mod-math
+ $(Package/ucode/default)
+ TITLE+= (math module)
+ DEPENDS:=ucode
+endef
+
+define Package/ucode-mod-math/description
+ The math plugin provides access to various <math.h> procedures.
+endef
+
+
+define Package/ucode-mod-ubus
+ $(Package/ucode/default)
+ TITLE+= (ubus module)
+ DEPENDS:=ucode +libubus +libblobmsg-json
+endef
+
+define Package/ucode-mod-ubus/description
+ The ubus module allows ucode template scripts to enumerate and invoke ubus
+ procedures.
+endef
+
+
+define Package/ucode-mod-uci
+ $(Package/ucode/default)
+ TITLE+= (uci module)
+ DEPENDS:=ucode +libuci
+endef
+
+define Package/ucode-mod-uci/description
+ The uci module allows templates to read and modify uci configuration.
+endef
+
+
+define Package/ucode/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/ucode $(1)/usr/bin/ucode
+endef
+
+define Package/ucode-mod-fs/install
+ $(INSTALL_DIR) $(1)/usr/lib/ucode
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/fs.so $(1)/usr/lib/ucode/
+endef
+
+define Package/ucode-mod-math/install
+ $(INSTALL_DIR) $(1)/usr/lib/ucode
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/math.so $(1)/usr/lib/ucode/
+endef
+
+define Package/ucode-mod-ubus/install
+ $(INSTALL_DIR) $(1)/usr/lib/ucode
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/ubus.so $(1)/usr/lib/ucode/
+endef
+
+define Package/ucode-mod-uci/install
+ $(INSTALL_DIR) $(1)/usr/lib/ucode
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/uci.so $(1)/usr/lib/ucode/
+endef
+
+
+$(eval $(call BuildPackage,ucode))
+$(eval $(call BuildPackage,ucode-mod-fs))
+$(eval $(call BuildPackage,ucode-mod-math))
+$(eval $(call BuildPackage,ucode-mod-ubus))
+$(eval $(call BuildPackage,ucode-mod-uci))