new package: yuma123

This commit is contained in:
Tee KOBAYASHI 2022-04-04 20:53:38 +09:00 committed by xtkoba
parent c98913ac5e
commit a93394d31d
19 changed files with 326 additions and 0 deletions

28
packages/yuma123/build.sh Normal file
View File

@ -0,0 +1,28 @@
TERMUX_PKG_HOMEPAGE=https://yuma123.org/
TERMUX_PKG_DESCRIPTION="Provides an opensource YANG API in C"
TERMUX_PKG_LICENSE="BSD 3-Clause, MIT, Public Domain"
TERMUX_PKG_LICENSE_FILE="debian/copyright"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.12
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/yuma123/yuma123_${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=81a0e4d4b4420891fb0a091e9cf4c36d50dbdc5dfedb09609e9b1fee58377ea9
TERMUX_PKG_DEPENDS="libssh2, libxml2, ncurses, openssl, readline, zlib"
termux_step_pre_configure() {
autoreconf -fi
CPPFLAGS+=" -D__USE_BSD"
_NEED_DUMMY_LIBRT_A=
_LIBRT_A=$TERMUX_PREFIX/lib/librt.a
if [ ! -e $_LIBRT_A ]; then
_NEED_DUMMY_LIBRT_A=true
echo '!<arch>' > $_LIBRT_A
fi
}
termux_step_post_make_install() {
if [ $_NEED_DUMMY_LIBRT_A ]; then
rm -f $_LIBRT_A
fi
}

View File

@ -0,0 +1,20 @@
--- a/netconf/man/netconf-subsystem.1
+++ b/netconf/man/netconf-subsystem.1
@@ -18,7 +18,7 @@
the 'netconf' subsystem is requested.
.SH USAGE
The location of this program needs to be configured
-in the /etc/ssh/sshd_config file. The following
+in the @TERMUX_PREFIX@/etc/ssh/sshd_config file. The following
configuration needs to be present:
.nf
@@ -37,7 +37,7 @@
and UNIX socket names. This option allows multiple
netconfd instances to run on the same host.
-/etc/ssh/sshd_config:
+@TERMUX_PREFIX@/etc/ssh/sshd_config:
.nf
\&...
Port 830

View File

@ -0,0 +1,38 @@
--- a/netconf/man/netconfd.1
+++ b/netconf/man/netconfd.1
@@ -102,7 +102,7 @@
The name of the configuration file to use.
Any parameter except this one can be set in the config file.
The default config file
-.I /etc/yuma/netconfd.conf
+.I @TERMUX_PREFIX@/etc/yuma/netconfd.conf
will not be checked if this parameter is present.
.IP --\fBdatapath\fP=list
Internal file search path for configuration data files.
@@ -250,7 +250,7 @@
.IP --\fBncxserver-sockname\fP=path
Overrides the default /tmp/ncxserver.sock UNIX
socket name netconfd listens on for incoming connections.
-You have to add corresponding entry to /etc/ssh/sshd_config e.g.:
+You have to add corresponding entry to @TERMUX_PREFIX@/etc/ssh/sshd_config e.g.:
.nf
\&...
Port 1830
@@ -260,7 +260,7 @@
.IP --\fBport\fP=number
Specifies the TCP ports that the server will accept
connections from. These ports must also be configured
-in the /etc/ssh/sshd_config file for the SSH master
+in the @TERMUX_PREFIX@/etc/ssh/sshd_config file for the SSH master
server to accept the connection and invoke the netconf
subsystem.
@@ -485,7 +485,7 @@
.SH CONFIGURATION FILES
.IP \fBnetconfd.conf\fP
YANG config file
-The default is: \fB/etc/yuma/netconfd.conf\fP
+The default is: \fB@TERMUX_PREFIX@/etc/yuma/netconfd.conf\fP
An ASCII configuration file format is supported to
store command line parameters.

View File

@ -0,0 +1,20 @@
--- a/netconf/man/yangcli.1
+++ b/netconf/man/yangcli.1
@@ -167,7 +167,7 @@
The name of the configuration file to use.
Any parameter except this one can be set in the config file.
The default config file
-.I /etc/yuma/yangcli.conf
+.I @TERMUX_PREFIX@/etc/yuma/yangcli.conf
will be not be checked if this parameter is present.
.IP --\fBdatapath\fP=list
Internal file search path for configuration data files.
@@ -567,7 +567,7 @@
.SH CONFIGURATION FILES
.IP \fByangcli.conf\fP
YANG config file
-The default is: \fB/etc/yuma/yangcli.conf\fP
+The default is: \fB@TERMUX_PREFIX@/etc/yuma/yangcli.conf\fP
An ASCII configuration file format is supported to
store command line parameters.

View File

@ -0,0 +1,20 @@
--- a/netconf/man/yangdiff.1
+++ b/netconf/man/yangdiff.1
@@ -77,7 +77,7 @@
The name of the configuration file to use.
Any parameter except this one can be set in the config file.
The default config file
-.I /etc/yuma/yangdiff.conf
+.I @TERMUX_PREFIX@/etc/yuma/yangdiff.conf
will be not be checked if this parameter is present.
.IP --\fBdifftype\fP=string
The type of comparison output requested.
@@ -408,7 +408,7 @@
.SH CONFIGURATION FILES
.IP \fByangdiff.conf\fP
YANG config file
-The default is: \fB/etc/yuma/yangdiff.conf\fP
+The default is: \fB@TERMUX_PREFIX@/etc/yuma/yangdiff.conf\fP
An ASCII configuration file format is supported to
store command line parameters.

View File

@ -0,0 +1,20 @@
--- a/netconf/man/yangdump.1
+++ b/netconf/man/yangdump.1
@@ -94,7 +94,7 @@
The name of the configuration file to use.
Any parameter except this one can be set in the config file.
The default config file
-.I /etc/yuma/yangdump.conf
+.I @TERMUX_PREFIX@/etc/yuma/yangdump.conf
will be not be checked if this parameter is present.
.IP --\fBdefnames\fP=boolean
If true, output to a file with the default name for the format,
@@ -655,7 +655,7 @@
.SH CONFIGURATION FILES
.IP \fByangdump.conf\fP
YANG config file
-The default is: \fB/etc/yuma/yangdump.conf\fP
+The default is: \fB@TERMUX_PREFIX@/etc/yuma/yangdump.conf\fP
An ASCII configuration file format is supported to
store command line parameters.

View File

@ -0,0 +1,11 @@
--- a/netconf/src/agt/agt.h
+++ b/netconf/src/agt/agt.h
@@ -149,7 +149,7 @@
#define AGT_MAX_PORTS 4
-#define AGT_DEF_CONF_FILE (const xmlChar *)"/etc/yuma/netconfd.conf"
+#define AGT_DEF_CONF_FILE (const xmlChar *)"@TERMUX_PREFIX@/etc/yuma/netconfd.conf"
/* this behavior used to set to TRUE, before 1.15-1 */
#define AGT_DEF_DELETE_EMPTY_NP FALSE

View File

@ -0,0 +1,11 @@
--- a/netconf/src/agt/agt_ncxserver.h
+++ b/netconf/src/agt/agt_ncxserver.h
@@ -45,7 +45,7 @@
* C O N S T A N T S *
* *
*********************************************************************/
-#define NCXSERVER_SOCKNAME "/tmp/ncxserver.sock"
+#define NCXSERVER_SOCKNAME "@TERMUX_PREFIX@/tmp/ncxserver.sock"
/********************************************************************
* *

View File

@ -0,0 +1,11 @@
--- a/netconf/src/mgr/mgr_ses.c
+++ b/netconf/src/mgr/mgr_ses.c
@@ -621,7 +621,7 @@
ses_putstr(scb, (const xmlChar *)str);
ses_putchar(scb, ';');
} else {
- ses_putstr(scb, (const xmlChar *)"/tmp;");
+ ses_putstr(scb, (const xmlChar *)"@TERMUX_PREFIX@/tmp;");
}
/* groups list is empty */

View File

@ -0,0 +1,11 @@
--- a/netconf/src/ncx/ncxconst.h
+++ b/netconf/src/ncx/ncxconst.h
@@ -284,7 +284,7 @@
"$YUMA_INSTALL/data/startup-cfg.xml"
#define NCX_DEF_INSTALL_STARTUP_FILE (const xmlChar *)\
- "/etc/yuma/startup-cfg.xml"
+ "@TERMUX_PREFIX@/etc/yuma/startup-cfg.xml"
/* Default backup config data file name */
#define NCX_DEF_BACKUP_FILE (const xmlChar *)"backup-cfg.xml"

View File

@ -0,0 +1,11 @@
--- a/netconf/src/ncx/ncxmod.c
+++ b/netconf/src/ncx/ncxmod.c
@@ -3892,7 +3892,7 @@
/* 8) try /usr/lib/yuma */
if (!ncxmod_run_path) {
- if (test_pathlist("/usr/lib/yuma",
+ if (test_pathlist("@TERMUX_PREFIX@/lib/yuma",
buff,
bufflen,
fname,

View File

@ -0,0 +1,20 @@
--- a/netconf/src/ncx/ncxmod.h
+++ b/netconf/src/ncx/ncxmod.h
@@ -168,7 +168,7 @@
#define NCXMOD_YUMA_DIR (const xmlChar *)"~/.yuma"
/* per user yangcli internal data home when $HOME not defined */
-#define NCXMOD_TEMP_YUMA_DIR (const xmlChar *)"/tmp/yuma"
+#define NCXMOD_TEMP_YUMA_DIR (const xmlChar *)"@TERMUX_PREFIX@/tmp/yuma"
/* Yuma work directory name */
#define NCXMOD_YUMA_DIRNAME (const xmlChar *)".yuma"
@@ -176,7 +176,7 @@
/* sub-directory name yangcli uses to store local per-session workdirs
* appended to ncxmod_yumadir_path
*/
-#define NCXMOD_TEMP_DIR (const xmlChar *)"/tmp"
+#define NCXMOD_TEMP_DIR (const xmlChar *)"@TERMUX_PREFIX@/tmp"
/********************************************************************
* *

View File

@ -0,0 +1,37 @@
--- a/netconf/src/ncx/val.c
+++ b/netconf/src/ncx/val.c
@@ -3685,7 +3685,7 @@
size_t buf_len;
} serializer_node_t;
-static ssize_t writer_fn(void *cookie, const void *buffer, size_t size)
+static int writer_fn(void *cookie, const char *buffer, int size)
{
serializer_node_t* ser = (serializer_node_t *)cookie;
@@ -3717,15 +3717,9 @@
serializer_node_t ser;
status_t res;
FILE* fp;
- cookie_io_functions_t io_functions;
val_value_t* copy_val;
- io_functions.read=NULL;
- io_functions.write=(cookie_write_function_t *)writer_fn;
- io_functions.seek=NULL;
- io_functions.close=NULL;
-
- fp=fopencookie (&ser, "w", io_functions);
+ fp=fwopen (&ser, writer_fn);
assert(fp != NULL);
ser.buf=NULL;
@@ -3747,7 +3741,7 @@
}
fclose(fp);
- fp=fopencookie (&ser, "w", io_functions);
+ fp=fwopen (&ser, writer_fn);
assert(fp != NULL);
ser.buf=(char*)malloc(ser.buf_len+1);

View File

@ -0,0 +1,11 @@
--- a/netconf/src/subsys/netconf-subsystem.c
+++ b/netconf/src/subsys/netconf-subsystem.c
@@ -138,7 +138,7 @@
int arg_idx = 1;
char defname[21];
- strncpy(defname, "/tmp/subsys-err.log", 20);
+ strncpy(defname, "@TERMUX_PREFIX@/tmp/subsys-err.log", 20);
err_filename = defname;
while ( arg_idx < argc-1 ) {
if ( !strcmp( argv[arg_idx], "-filename" ) ||

View File

@ -0,0 +1,11 @@
--- a/netconf/src/yangcli/yangcli.h
+++ b/netconf/src/yangcli/yangcli.h
@@ -93,7 +93,7 @@
#define YANGCLI_DEF_FIXORDER TRUE
-#define YANGCLI_DEF_CONF_FILE (const xmlChar *)"/etc/yuma/yangcli.conf"
+#define YANGCLI_DEF_CONF_FILE (const xmlChar *)"@TERMUX_PREFIX@/etc/yuma/yangcli.conf"
#define YANGCLI_DEF_SERVER (const xmlChar *)"default"

View File

@ -0,0 +1,11 @@
--- a/netconf/src/yangdiff/yangdiff.h
+++ b/netconf/src/yangdiff/yangdiff.h
@@ -71,7 +71,7 @@
#define YANGDIFF_DEF_OUTPUT (const xmlChar *)"stdout"
#define YANGDIFF_DEF_DIFFTYPE (const xmlChar *)"summary"
#define YANGDIFF_DEF_DT YANGDIFF_DT_NORMAL
-#define YANGDIFF_DEF_CONFIG (const xmlChar *)"/etc/yuma/yangdiff.conf"
+#define YANGDIFF_DEF_CONFIG (const xmlChar *)"@TERMUX_PREFIX@/etc/yuma/yangdiff.conf"
#define YANGDIFF_DEF_FILENAME (const xmlChar *)"yangdiff.log"
#define YANGDIFF_MOD (const xmlChar *)"yangdiff"

View File

@ -0,0 +1,13 @@
--- a/netconf/src/yangrpc/example/yangrpc-example.c
+++ b/netconf/src/yangrpc/example/yangrpc-example.c
@@ -52,8 +52,8 @@
char public_key[1024];
boolean autoload = TRUE;
- sprintf(private_key,"/home/%s/.ssh/id_rsa",user);
- sprintf(public_key,"/home/%s/.ssh/id_rsa.pub",user);
+ sprintf(private_key,"@TERMUX_HOME@/.ssh/id_rsa",user);
+ sprintf(public_key,"@TERMUX_HOME@/.ssh/id_rsa.pub",user);
while ((optc = getopt_long (argc, argv, "a:s:p:u:P:k:K", long_options, NULL)) != -1) {
switch (optc) {

View File

@ -0,0 +1,11 @@
--- a/netconf/src/yangrpc/example/yangrpc-parse-example.c
+++ b/netconf/src/yangrpc/example/yangrpc-parse-example.c
@@ -22,7 +22,7 @@
res = yangrpc_init(NULL);
assert(res==NO_ERR);
- res = yangrpc_connect("localhost"/*server*/, 830/*port*/, "vladimir"/*user*/,"mysecretpass"/*password*/,"/home/vladimir/.ssh/id_rsa.pub"/*public_key*/, "/home/vladimir/.ssh/id_rsa"/*private_key*/, NULL, &yangrpc_cb_ptr);
+ res = yangrpc_connect("localhost"/*server*/, 830/*port*/, "vladimir"/*user*/,"mysecretpass"/*password*/,"@TERMUX_HOME@/.ssh/id_rsa.pub"/*public_key*/, "@TERMUX_HOME@/.ssh/id_rsa"/*private_key*/, NULL, &yangrpc_cb_ptr);
assert(res==NO_ERR);
res = yangrpc_parse_cli(yangrpc_cb_ptr, "xget /interfaces-state", &request_val);

View File

@ -0,0 +1,11 @@
--- a/netconf/src/ydump/yangdump.h
+++ b/netconf/src/ydump/yangdump.h
@@ -79,7 +79,7 @@
#define YANGDUMP_DEF_OUTPUT "stdout"
-#define YANGDUMP_DEF_CONFIG (const xmlChar *)"/etc/yuma/yangdump.conf"
+#define YANGDUMP_DEF_CONFIG (const xmlChar *)"@TERMUX_PREFIX@/etc/yuma/yangdump.conf"
#define YANGDUMP_DEF_TOC (const xmlChar *)"menu"