summaryrefslogtreecommitdiffstats
path: root/package/mongoose
diff options
context:
space:
mode:
authorCharles Manning <cdhmanning@gmail.com>2012-12-12 12:03:16 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2013-05-02 22:52:50 +0200
commitc85da87012e1e05364aa27e786bf9152847b5325 (patch)
tree35fbb81e349223ea0ee8a678521e908df1cdcaf9 /package/mongoose
parente9b771283765e74792df6a05775383f6d4da2636 (diff)
downloadbuildroot-novena-c85da87012e1e05364aa27e786bf9152847b5325.tar.gz
buildroot-novena-c85da87012e1e05364aa27e786bf9152847b5325.zip
Add package for mongoose web server
[Peter: drop noauth patch, cleanup Config.in, don't install to staging, ..] Signed-off-by: Charles Manning <cdhmanning@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/mongoose')
-rw-r--r--package/mongoose/Config.in10
-rwxr-xr-xpackage/mongoose/S85mongoose41
-rw-r--r--package/mongoose/mongoose.mk26
3 files changed, 77 insertions, 0 deletions
diff --git a/package/mongoose/Config.in b/package/mongoose/Config.in
new file mode 100644
index 000000000..719971201
--- /dev/null
+++ b/package/mongoose/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_MONGOOSE
+ bool "mongoose"
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ Mongoose is a small and easy to use web server
+
+ https://github.com/valenok/mongoose
+
+comment "mongoose needs a toolchain with thread support"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/mongoose/S85mongoose b/package/mongoose/S85mongoose
new file mode 100755
index 000000000..e9e8524ca
--- /dev/null
+++ b/package/mongoose/S85mongoose
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Start/stop the mongoose HTTP server
+#
+
+set -e
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+NAME=mongoose
+DESC="Mongoose HTTP server"
+
+DAEMON=`which mongoose`
+OPTIONS="-max_threads 3 -root /var/www -ports 80"
+
+[ -e /etc/default/mongoose ] && . /etc/default/mongoose
+
+case "$1" in
+ start)
+ echo "Starting $DESC:"
+ start-stop-daemon -S -x "$DAEMON" -b -- $OPTIONS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -K -x "$DAEMON"
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon -K -x "$DAEMON"
+ start-stop-daemon -S -x "$DAEMON" -b -- $OPTIONS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/package/mongoose/mongoose.mk b/package/mongoose/mongoose.mk
new file mode 100644
index 000000000..5ebeb24f4
--- /dev/null
+++ b/package/mongoose/mongoose.mk
@@ -0,0 +1,26 @@
+#############################################################
+#
+# mongoose
+#
+#############################################################
+
+MONGOOSE_VERSION = 3.3
+MONGOOSE_SOURCE = mongoose-$(MONGOOSE_VERSION).tgz
+MONGOOSE_SITE = https://mongoose.googlecode.com/files
+MONGOOSE_LICENSE = MIT
+MONGOOSE_LICENSE_FILES = COPYING
+
+MONGOOSE_CFLAGS = $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -DNO_SSL
+
+define MONGOOSE_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D) \
+ linux COPT="$(MONGOOSE_CFLAGS)"
+endef
+
+define MONGOOSE_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 755 $(@D)/mongoose $(TARGET_DIR)/usr/sbin/mongoose
+ $(INSTALL) -D -m 755 package/mongoose/S85mongoose \
+ $(TARGET_DIR)/etc/init.d/S85mongoose
+endef
+
+$(eval $(generic-package))