Skip to contentSkip to conversation

shellinabox: new package

PATCH New Olivier Singla 2 participants 2 messages Jul 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 shellinabox: new package

From: "Olivier Singla" <[email protected]>

Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins.

---
 package/Config.in                                  |  1 +
 .../shellinabox/0001-Makefile.am-fix-static.patch  | 15 +++++++++++++++
 package/shellinabox/Config.in                      | 11 +++++++++++
 package/shellinabox/shellinabox.hash               |  2 ++
 package/shellinabox/shellinabox.mk                 | 22 ++++++++++++++++++++++
 5 files changed, 51 insertions(+)
 create mode 100644 package/shellinabox/0001-Makefile.am-fix-static.patch
 create mode 100644 package/shellinabox/Config.in
 create mode 100644 package/shellinabox/shellinabox.hash
 create mode 100644 package/shellinabox/shellinabox.mk
package/Config.in +1 -0
index 15271a2..d6c7600 100644
@@ -1530,6 +1530,7 @@ menu "Networking applications"
 	source "package/sconeserver/Config.in"
 	source "package/ser2net/Config.in"
 	source "package/shairport-sync/Config.in"
+	source "package/shellinabox/Config.in"
 	source "package/smcroute/Config.in"
 	source "package/socat/Config.in"
 	source "package/socketcand/Config.in"
package/shellinabox/0001-Makefile.am-fix-static.patch new file +15 -0
new file mode 100644
index 0000000..0fadde0
@@ -0,0 +1,15 @@
+Makefile: disable always building statically.
+
+Signed-off-by:  "Olivier Singla" <[email protected]>
+
+--- shellinabox-2.19/Makefile.am.orig	2016-07-03 20:46:42.655784211 -0400
++++ shellinabox-2.19/Makefile.am	2016-07-03 20:46:50.582801842 -0400
+@@ -126,7 +126,7 @@
+ 
+ shellinaboxd_LDADD   = liblogging.la                                          \
+                        libhttp.la
+-shellinaboxd_LDFLAGS = -static
++shellinaboxd_LDFLAGS =
+ ## Added this for compatibility with older versions of autoconf/automake
+ docdir               = ${datadir}/doc/${PACKAGE}
+ 
package/shellinabox/Config.in new file +11 -0
new file mode 100644
index 0000000..393afe1
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_SHELLINABOX
+	bool "shellinabox"
+	select BR2_PACKAGE_ZLIB
+	depends on BR2_PACKAGE_OPENSSL
+	help
+	  Shell In A Box implements a web server that can export arbitrary command
+	  line tools to a web based terminal emulator. This emulator is accessible
+	  to any JavaScript and CSS enabled web browser and does not require any
+	  additional browser plugins.
+
+	  https://github.com/shellinabox/shellinabox
package/shellinabox/shellinabox.hash new file +2 -0
new file mode 100644
index 0000000..b7d4523
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256	d25ba9f72f04471fc1a8a564c65ef466c4553280ff3eeb365ed9c897d05ed2da	v2.19.tar.gz
package/shellinabox/shellinabox.mk new file +22 -0
new file mode 100644
index 0000000..94e49e0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# shellinabox
+#
+################################################################################
+
+SHELLINABOX_VERSION = v2.19
+SHELLINABOX_SOURCE = $(SHELLINABOX_VERSION).tar.gz
+SHELLINABOX_SITE = https://github.com/shellinabox/shellinabox/archive
+
+# Fetching from Github, and patching Makefile.am, so we need to autoreconf
+SHELLINABOX_AUTORECONF = YES
+
+SHELLINABOX_DEPENDENCIES = zlib
+
+SHELLINABOX_LICENSE = GPLv2 with OpenSSL exception
+SHELLINABOX_CONF_OPTS += --enable-ssl
+SHELLINABOX_DEPENDENCIES += openssl
+SHELLINABOX_LICENSE_FILES = COPYING GPL-2
+SHELLINABOX_CONF_OPTS += --disable-runtime-loading
+
+$(eval $(autotools-package))
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/1 shellinabox: new package

Hello,

Thanks. I've applied your patch, but after doing some changes. Read on below for the details.

When sending a new version, you should make sure the prefix of the patch is "PATCH v2". This can be achieved by using the --subject-prefix option of git format-patch.

package/shellinabox/0001-Makefile.am-fix-static.patch line 3

Quoted 9 lines · Olivier Singla
package/shellinabox/0001-Makefile.am-fix-static.patch new file +3 -0
new file mode 100644
index 0000000..0fadde0
@@ -0,0 +1,15 @@
+Makefile: disable always building statically.
+
+Signed-off-by:  "Olivier Singla" <[email protected]>

Looks good. Please submit this patch to the upstream shellinabox developers.

package/shellinabox/0001-Makefile.am-fix-static.patch line 7

Quoted 4 lines
package/shellinabox/0001-Makefile.am-fix-static.patch new file +4 -0
+config BR2_PACKAGE_SHELLINABOX
+	bool "shellinabox"
+	select BR2_PACKAGE_ZLIB
+	depends on BR2_PACKAGE_OPENSSL

This should have been a "select" not a "depends on". And they should be ordered alphabetically.

package/shellinabox/0001-Makefile.am-fix-static.patch line 12

Quoted 5 lines
package/shellinabox/0001-Makefile.am-fix-static.patch new file +5 -0
+	help
+	  Shell In A Box implements a web server that can export arbitrary command
+	  line tools to a web based terminal emulator. This emulator is accessible
+	  to any JavaScript and CSS enabled web browser and does not require any
+	  additional browser plugins.

Those lines were slightly too long, so I rewrapped the Config.in help text.

Quoted 16 lines
package/shellinabox/0001-Makefile.am-fix-static.patch new file +2 -0
+
+	  https://github.com/shellinabox/shellinabox
package/shellinabox/shellinabox.hash new file +2 -0
new file mode 100644
index 0000000..b7d4523
@@ -0,0 +1,2 @@
+# Locally calculated after checking pgp signature
+sha256	d25ba9f72f04471fc1a8a564c65ef466c4553280ff3eeb365ed9c897d05ed2da	v2.19.tar.gz
package/shellinabox/shellinabox.mk new file +0 -0
new file mode 100644
index 0000000..94e49e0

package/shellinabox/shellinabox.mk line 9

Quoted 9 lines
package/shellinabox/shellinabox.mk new file +9 -0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# shellinabox
+#
+################################################################################
+
+SHELLINABOX_VERSION = v2.19
+SHELLINABOX_SOURCE = $(SHELLINABOX_VERSION).tar.gz
+SHELLINABOX_SITE = https://github.com/shellinabox/shellinabox/archive

In the previous review, I think you were told to use the github helper function, but didn't take into account this comment. So I've done the necessary change.

package/shellinabox/shellinabox.mk line 18

Quoted 9 lines
package/shellinabox/shellinabox.mk new file +9 -0
+
+# Fetching from Github, and patching Makefile.am, so we need to autoreconf
+SHELLINABOX_AUTORECONF = YES
+
+SHELLINABOX_DEPENDENCIES = zlib
+
+SHELLINABOX_LICENSE = GPLv2 with OpenSSL exception
+SHELLINABOX_CONF_OPTS += --enable-ssl
+SHELLINABOX_DEPENDENCIES += openssl

It would have been good to indicate why you force enable the OpenSSL support, while it seemed to be optional. I've tested, and indeed with OpenSSL disabled, it fails to build. I've reported this issue upstream.

So, I've grouped things together and added a comment:

# The OpenSSL support is supposed to be optional, but in practice,

# with OpenSSL disabled, it fails to build. See
# https://github.com/shellinabox/shellinabox/issues/385.
SHELLINABOX_DEPENDENCIES = zlib openssl
SHELLINABOX_CONF_OPTS = \
        --disable-runtime-loading \
        --enable-ssl

As said above, I've fixed those issues and applied your patch.

Since shellinaboxd is a daemon, it would be great to have it started automatically at boot time. Could you submit a follow-up patch that adds either a init script or a systemd service file (or ideally both) ?

Thanks a lot for your contribution!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com