forked from SynoCommunity/spksrc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- SynoCommunity#3834 add sftp support and hence add cross/libssh2 - SynoCommunity#3783/ SynoCommunity#3258 fix mouse handling - replace usage of ncurses by slang - add patch to fix subshell for /bin/sh shell linked to /bin/bash (subshell for /bin/sh is not supported) - add new mc icon - update synocli-file with reworked mc
- Loading branch information
Showing
15 changed files
with
142 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
PKG_NAME = libssh2 | ||
PKG_VERS = 1.9.0 | ||
PKG_EXT = tar.gz | ||
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) | ||
PKG_DIST_SITE = https://www.libssh2.org/download/ | ||
PKG_DIR = $(PKG_NAME)-$(PKG_VERS) | ||
|
||
DEPENDS = cross/openssl | ||
|
||
HOMEPAGE = https://www.libssh2.org | ||
COMMENT = libssh2 is a client-side C library implementing the SSH2 protocol. | ||
LICENSE = https://www.libssh2.org/license.html | ||
|
||
GNU_CONFIGURE = 1 | ||
CONFIGURE_ARGS = --disable-examples-build | ||
|
||
include ../../mk/spksrc.cross-cc.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lnk:lib/libssh2.so | ||
lnk:lib/libssh2.so.1 | ||
lib:lib/libssh2.so.1.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
libssh2-1.9.0.tar.gz SHA1 21e98282b103307a16792e5e2d4c99beaf0b3b9c | ||
libssh2-1.9.0.tar.gz SHA256 d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd | ||
libssh2-1.9.0.tar.gz MD5 1beefafe8963982adc84b408b2959927 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
dnl original patch provided by alllexx88 as 3689-bash-subshell-V3.patch | ||
dnl https://midnight-commander.org/ticket/3689 | ||
|
||
--- src/subshell/common.c.org 2019-06-16 17:49:31.000000000 +0000 | ||
+++ src/subshell/common.c 2019-12-29 17:28:33.049619129 +0000 | ||
@@ -369,7 +369,7 @@ | ||
switch (mc_global.shell->type) | ||
{ | ||
case SHELL_BASH: | ||
- execl (mc_global.shell->path, "bash", "-rcfile", init_file, (char *) NULL); | ||
+ execl (mc_global.shell->path, mc_global.shell->name, "-rcfile", init_file, (char *) NULL); | ||
break; | ||
|
||
case SHELL_ZSH: | ||
--- lib/shell.c.org 2019-06-16 17:49:31.000000000 +0000 | ||
+++ lib/shell.c 2019-12-29 17:34:32.741113924 +0000 | ||
@@ -33,6 +33,8 @@ | ||
#include <stdarg.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
+#include <sys/wait.h> | ||
+#include <unistd.h> | ||
|
||
#include "global.h" | ||
#include "util.h" | ||
@@ -191,16 +193,56 @@ | ||
mc_shell->type = SHELL_NONE; | ||
} | ||
|
||
+/* --------------------------------------------------------------------------------------------- | ||
+ This function returns TRUE for a shell if it has an internal variable with respective name. | ||
+ We unset environmental variable of the same name in the child fork to make sure it's internal. | ||
+ --------------------------------------------------------------------------------------------- */ | ||
+static gboolean | ||
+mc_shell_internal_variable_isset (mc_shell_t * mc_shell, const char * name) | ||
+{ | ||
+ pid_t cpid, w; | ||
+ int status; | ||
+ char *command; | ||
+ | ||
+ command = g_strdup_printf ("([ -z \"${%s+x}\" ] && exit 1) || exit 0", name); | ||
+ | ||
+ cpid = fork(); | ||
+ if (cpid == -1) { | ||
+ /* failed to fork */ | ||
+ g_free (command); | ||
+ return FALSE; | ||
+ } | ||
+ | ||
+ if (cpid == 0) { /* Code executed by child */ | ||
+ unsetenv(name); | ||
+ execl(mc_shell->path, mc_shell->path, "-c", command, (char *) NULL); | ||
+ /* execl failed */ | ||
+ exit(1); | ||
+ } else { /* Code executed by parent */ | ||
+ g_free (command); | ||
+ do { | ||
+ w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); | ||
+ if (w == -1) { | ||
+ /* waitpid error */ | ||
+ return FALSE; | ||
+ } | ||
+ } while (!WIFEXITED(status) && !WIFSIGNALED(status)); | ||
+ | ||
+ return (WIFEXITED(status)) && (WEXITSTATUS(status) == 0); | ||
+ } | ||
+} | ||
+ | ||
/* --------------------------------------------------------------------------------------------- */ | ||
|
||
static void | ||
mc_shell_recognize_path (mc_shell_t * mc_shell) | ||
{ | ||
- /* If shell is not symlinked to busybox, it is safe to assume it is a real shell */ | ||
- if (strstr (mc_shell->path, "/bash") != NULL || getenv ("BASH") != NULL) | ||
+ /* If shell is not symlinked to busybox, it is safe to assume it is a real shell | ||
+ Let's assume shell is bash if BASH internal variable is set */ | ||
+ if (mc_shell_internal_variable_isset (mc_shell, "BASH")) | ||
{ | ||
mc_shell->type = SHELL_BASH; | ||
- mc_shell->name = "bash"; | ||
+ mc_shell->name = mc_shell->path; | ||
} | ||
else if (strstr (mc_shell->path, "/sh") != NULL || getenv ("SH") != NULL) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
COMMANDS="mc mcedit mcdiff mcview" | ||
|
||
service_postinst () | ||
{ | ||
# Use the mc-utf8 command for mc | ||
ln -s ${SYNOPKG_PKGDEST}/bin/mc-utf8 /usr/local/bin/mc | ||
ln -s ${SYNOPKG_PKGDEST}/bin/mc-utf8 /usr/local/bin/mcedit | ||
ln -s ${SYNOPKG_PKGDEST}/bin/mc-utf8 /usr/local/bin/mcdiff | ||
ln -s ${SYNOPKG_PKGDEST}/bin/mc-utf8 /usr/local/bin/mcview | ||
for cmd in $COMMANDS | ||
do | ||
if [ -e "${SYNOPKG_PKGDEST}/bin/$cmd" ]; then | ||
ln -s "${SYNOPKG_PKGDEST}/bin/$cmd" "/usr/local/bin/$cmd" | ||
fi | ||
done | ||
} | ||
|
||
service_postuninst () | ||
{ | ||
# Remove symlinks | ||
rm -f /usr/local/bin/mc | ||
rm -f /usr/local/bin/mcedit | ||
rm -f /usr/local/bin/mcdiff | ||
rm -f /usr/local/bin/mcview | ||
for cmd in $COMMANDS | ||
do | ||
if [ -L "/usr/local/bin/$cmd" ]; then | ||
if [ "$(readlink /usr/local/bin/$cmd)" == "${SYNOPKG_PKGDEST}/bin/$cmd" ]; then | ||
rm -f "/usr/local/bin/$cmd" | ||
fi | ||
fi | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,30 @@ | ||
SPK_NAME = synocli-file | ||
SPK_VERS = 1.0 | ||
SPK_REV = 1 | ||
SPK_REV = 2 | ||
SPK_ICON = src/synocli-file.png | ||
|
||
include ../../mk/spksrc.common.mk | ||
|
||
DEPENDS = cross/less cross/tree cross/ncdu cross/jdupes cross/rhash cross/mc cross/nano cross/file | ||
DEPENDS += cross/detox cross/rmlint | ||
ifneq ($(findstring $(ARCH), powerpc ppc824x ppc853x ppc854x $(ARM5_ARCHES)),$(ARCH)) | ||
# to build rnm, GCC >= 4.8 is required, but not contained in older toolchains. | ||
DEPENDS += cross/rnm | ||
endif | ||
|
||
MAINTAINER = SynoCommunity | ||
DISPLAY_NAME = SynoCli File Tools | ||
ifneq ($(findstring $(ARCH), powerpc ppc824x ppc853x ppc854x $(ARM5_ARCHES)),$(ARCH)) | ||
# to build rnm, GCC >= 4.8 is required, but not contained in older toolchains. | ||
DEPENDS += cross/rnm | ||
DESCRIPTION = "SynoCli File Tools provides a set of small command-line utilities: less, tree, ncdu, jdupes, rhash, mc \(midnight commander\), nano, file, detox, rmlint, rnm." | ||
else | ||
DESCRIPTION = "SynoCli File Tools provides a set of small command-line utilities: less, tree, ncdu, jdupes, rhash, mc \(midnight commander\), nano, file, detox, rmlint." | ||
endif | ||
|
||
STARTABLE = no | ||
CHANGELOG = "1. Initial release" | ||
CHANGELOG = "Midnight-Commander: add sftp support; Fix subshell; fix mouse handling; fix mcedit, mcview and mcdiff" | ||
|
||
HOMEPAGE = https://github.com/SynoCommunity/spksrc/wiki/FAQ-SynoCliFile | ||
LICENSE = Each tool is licensed by it\'s own. | ||
HOMEPAGE = https://github.com/SynoCommunity/spksrc/wiki/FAQ-SynoCliFile | ||
LICENSE = Each tool is licensed under it\'s respective license. | ||
|
||
SERVICE_SETUP = src/service-setup.sh | ||
|
||
POST_STRIP_TARGET = synoclifile_extra_install | ||
|
||
include ../../mk/spksrc.spk.mk | ||
|
||
.PHONY: synoclifile_extra_install | ||
synoclifile_extra_install: | ||
install -m 755 src/mc-utf8 $(STAGING_DIR)/bin/mc-utf8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters