-
Notifications
You must be signed in to change notification settings - Fork 3.9k
libs/faux, utils/klish3: add new packages #29192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # | ||
| # Copyright (C) 2026 OpenWrt.org | ||
| # | ||
| # This is free software, licensed under the GNU General Public License v2. | ||
| # See /LICENSE for more information. | ||
| # | ||
|
|
||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_NAME:=faux | ||
| PKG_VERSION:=2.2.1 | ||
| PKG_RELEASE:=1 | ||
|
|
||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||
| PKG_SOURCE_URL:=https://src.libcode.org/download/faux | ||
| PKG_HASH:=f58a73f6543785fe353d23691d9dc023bfdc0ed46d4ff41a560df867d42efbd0 | ||
|
|
||
| PKG_MAINTAINER:=Dharmik Parmar <dharmikparmar2004@yahoo.com> | ||
| PKG_LICENSE:=BSD-3-Clause | ||
| PKG_LICENSE_FILES:=LICENCE | ||
|
|
||
| PKG_INSTALL:=1 | ||
| PKG_BUILD_PARALLEL:=1 | ||
|
|
||
| include $(INCLUDE_DIR)/package.mk | ||
|
|
||
| define Package/libfaux | ||
| SECTION:=libs | ||
| CATEGORY:=Libraries | ||
| TITLE:=Auxiliary utility library used by klish3 | ||
| URL:=https://src.libcode.org/pkun/faux | ||
| DEPENDS:=+libpthread | ||
| endef | ||
|
|
||
| define Package/libfaux/description | ||
| The faux library contains assorted helper APIs for memory, strings, | ||
| event loops, async I/O and utility wrappers. | ||
| endef | ||
|
|
||
| define Package/faux-utils | ||
| SECTION:=utils | ||
| CATEGORY:=Utilities | ||
| TITLE:=Utilities from faux library | ||
| URL:=https://src.libcode.org/pkun/faux | ||
| DEPENDS:=+libfaux | ||
| endef | ||
|
|
||
| define Package/faux-utils/description | ||
| Utility binaries shipped by the faux project. | ||
| endef | ||
|
|
||
| define Build/InstallDev | ||
| $(INSTALL_DIR) $(1)/usr/include | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/include/faux $(1)/usr/include/ | ||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaux.so* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| define Package/libfaux/install | ||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfaux.so* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| define Package/faux-utils/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/faux-file2c $(1)/usr/bin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/faux-getch $(1)/usr/bin/ | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,libfaux)) | ||
| $(eval $(call BuildPackage,faux-utils)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # | ||
| # Copyright (C) 2026 OpenWrt.org | ||
| # | ||
| # This is free software, licensed under the GNU General Public License v2. | ||
| # See /LICENSE for more information. | ||
| # | ||
|
|
||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_NAME:=klish3 | ||
| PKG_VERSION:=3.2.0 | ||
| PKG_RELEASE:=1 | ||
|
|
||
| PKG_SOURCE:=klish-$(PKG_VERSION).tar.xz | ||
| PKG_SOURCE_URL:=https://src.libcode.org/download/klish | ||
| PKG_HASH:=8d9be7e7b51efd4dd1b128a74be090986e76eac1b86da7495ca46ba5ea071e25 | ||
|
|
||
| PKG_BUILD_DIR:=$(BUILD_DIR)/klish-$(PKG_VERSION) | ||
| PKG_INSTALL:=1 | ||
| PKG_BUILD_PARALLEL:=1 | ||
|
|
||
| PKG_MAINTAINER:=Dharmik Parmar <dharmikparmar2004@yahoo.com> | ||
| PKG_LICENSE:=BSD-3-Clause | ||
| PKG_LICENSE_FILES:=LICENCE | ||
|
|
||
| include $(INCLUDE_DIR)/package.mk | ||
|
|
||
| define Package/klish3 | ||
| SECTION:=utils | ||
| CATEGORY:=Utilities | ||
| SUBMENU:=Shells | ||
| TITLE:=Kommand Line Interface SHell v3 | ||
| URL:=https://src.libcode.org/pkun/klish | ||
| DEPENDS:=+libfaux +libxml2 +libpthread | ||
| CONFLICTS:=klish klish-xml-files | ||
| endef | ||
|
|
||
| define Package/klish3/description | ||
| Klish v3 is a framework for implementing Cisco-like or Juniper-like | ||
| command line interfaces. | ||
| This package ships the klish and klishd binaries along with required | ||
| runtime libraries and plugins. | ||
| endef | ||
|
|
||
| CONFIGURE_ARGS += \ | ||
| --with-libxml2=yes \ | ||
| --with-roxml=no \ | ||
| --with-expat=no \ | ||
| --with-lua=no | ||
|
|
||
| define Package/klish3/conffiles | ||
| /etc/klish/klish.conf | ||
| /etc/klish/klishd.conf | ||
| /etc/klish/xml/example.xml | ||
| endef | ||
|
|
||
| define Package/klish3/install | ||
| $(INSTALL_DIR) $(1)/usr/bin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/klish $(1)/usr/bin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/klishd $(1)/usr/bin/ | ||
|
|
||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish.so* $(1)/usr/lib/ | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtinyrl.so* $(1)/usr/lib/ | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-db-ischeme.so* $(1)/usr/lib/ | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-db-libxml2.so* $(1)/usr/lib/ | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-plugin-klish.so* $(1)/usr/lib/ | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libklish-plugin-script.so* $(1)/usr/lib/ | ||
|
Comment on lines
+62
to
+68
|
||
|
|
||
| $(INSTALL_DIR) $(1)/etc/klish/xml | ||
| $(INSTALL_CONF) ./files/etc/klish/klish.conf $(1)/etc/klish/ | ||
| $(INSTALL_CONF) ./files/etc/klish/klishd.conf $(1)/etc/klish/ | ||
| $(INSTALL_CONF) ./files/etc/klish/xml/example.xml $(1)/etc/klish/xml/ | ||
|
|
||
| $(INSTALL_DIR) $(1)/usr/share/klish | ||
| $(INSTALL_DATA) $(PKG_BUILD_DIR)/klish.xsd $(1)/usr/share/klish/ | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,klish3)) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # OpenWrt default config for /etc/klish/klish.conf. | ||
| # Used by the klish client utility. | ||
|
|
||
| # Default Unix socket used to reach klishd. | ||
| #UnixSocketPath=/tmp/klish-unix-socket | ||
|
|
||
| # BusyBox less does not support GNU less flags like -I -X -K -R. | ||
| # Keep pager defaults compatible with OpenWrt base images. | ||
| Pager="/usr/bin/less -EFN~" | ||
|
|
||
| # Enable or disable pager usage globally. | ||
| #UsePager=y |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||||||||||||||||||
| # Template for config file /etc/klish/klishd.conf. It's used by klishd daemon. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # The klishd uses UNIX domain socket to receive connections. It will create an | ||||||||||||||||||||||
| # filesystem entry to allow clients to find connection point. By default klishd | ||||||||||||||||||||||
| # uses /tmp/klish-unix-socket path. | ||||||||||||||||||||||
|
Comment on lines
+1
to
+5
|
||||||||||||||||||||||
| # Template for config file /etc/klish/klishd.conf. It's used by klishd daemon. | |
| # The klishd uses UNIX domain socket to receive connections. It will create an | |
| # filesystem entry to allow clients to find connection point. By default klishd | |
| # uses /tmp/klish-unix-socket path. | |
| # Template for config file /etc/klish/klishd.conf. It is used by the klishd daemon. | |
| # klishd uses a UNIX domain socket to receive connections. It will create a | |
| # filesystem entry to allow clients to find the connection point. By default, | |
| # klishd uses the /tmp/klish-unix-socket path. |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,56 @@ | ||||||||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||||||||
| <KLISH | ||||||||||
| xmlns="https://klish.libcode.org/klish3" | ||||||||||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||||||||
| xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd"> | ||||||||||
|
||||||||||
| xsi:schemaLocation="https://src.libcode.org/pkun/klish/src/master/klish.xsd"> | |
| xsi:schemaLocation="https://klish.libcode.org/klish3 /usr/share/klish/klish.xsd"> |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ls command declares a path parameter but the script ignores it (ls \"\"). This makes the example misleading. Either use the parameter in the script (per klish variable substitution rules) or remove the unused <PARAM> to keep the example coherent.
| echo "" | |
| ls "" | |
| echo "${path}" | |
| ls "${path}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- a/klish/ksession/kcontext.c | ||
| +++ b/klish/ksession/kcontext.c | ||
| @@ -5,6 +5,10 @@ | ||
| #include <sys/types.h> | ||
| #include <unistd.h> | ||
|
|
||
| +#undef stdin | ||
| +#undef stdout | ||
| +#undef stderr | ||
| + | ||
| #include <faux/str.h> | ||
| #include <faux/conv.h> | ||
| #include <faux/list.h> | ||
| --- a/klish/ksession/kexec.c | ||
| +++ b/klish/ksession/kexec.c | ||
| @@ -15,6 +15,10 @@ | ||
| #include <signal.h> | ||
| #include <errno.h> | ||
|
|
||
| +#undef stdin | ||
| +#undef stdout | ||
| +#undef stderr | ||
| + | ||
| #include <faux/list.h> | ||
| #include <faux/buf.h> | ||
| #include <faux/eloop.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title contains a capitalization typo:
SHellshould beShell.