aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/Makefile1
-rw-r--r--www/mongoose/Makefile89
-rw-r--r--www/mongoose/distinfo2
-rw-r--r--www/mongoose/files/mongoose.in39
-rw-r--r--www/mongoose/files/patch-mongoose.c65
-rw-r--r--www/mongoose/pkg-descr9
6 files changed, 205 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile
index d1ef60a779e9..d9b5cee72751 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -539,6 +539,7 @@
SUBDIR += mohawk
SUBDIR += moinmoin
SUBDIR += monast
+ SUBDIR += mongoose
SUBDIR += mongrel2
SUBDIR += moodle24
SUBDIR += moodle25
diff --git a/www/mongoose/Makefile b/www/mongoose/Makefile
new file mode 100644
index 000000000000..7cfb3b94c23b
--- /dev/null
+++ b/www/mongoose/Makefile
@@ -0,0 +1,89 @@
+# Created by: Boris Lytochkin (lytboris@gmail.com)
+# $FreeBSD$
+
+PORTNAME= mongoose
+PORTVERSION= 5.3
+CATEGORIES= www
+
+MAINTAINER= lytboris@gmail.com
+COMMENT= Small, fast, embeddable web server with CGI, SSL, Authorization
+
+LICENSE= GPLv2
+
+USE_GITHUB= yes
+GH_ACCOUNT= cesanta
+GH_TAGNAME= ${GH_COMMIT}
+GH_COMMIT= 30a7965
+
+USES= gmake dos2unix
+
+ALL_TARGET= server
+MAKE_ENV= LIBS=-lpthread
+BUILD_WRKSRC= ${WRKSRC}/examples
+
+USE_RC_SUBR= mongoose
+
+NO_OPTIONS_SORT= YES
+
+FS_DESC=Filesystem options
+
+OPTIONS_MONGOOSE=AUTH CGI DAV DIRECTORY_LISTING LOGGING SSI
+OPTIONS_NS=SSL IPV6 DEBUG
+OPTIONS_DEFINE=${OPTIONS_MONGOOSE} ${OPTIONS_NS} DEBUG_HEXDUMP THREADS
+OPTIONS_DEFAULT=${OPTIONS_DEFINE:NDEBUG*}
+
+POPEN_DESC= Enable process execute in SSI
+CGI_DESC= Enable CGI
+AUTH_DESC= Enable authentication
+DAV_DESC= Enable DAV (requires DIRECTORY_LISTING)
+DIRECTORY_LISTING_DESC= Enable directory listing
+LOGGING_DESC= Enable logging
+SSI_DESC= Enable SSI
+THREADS_DESC= Enable threads
+SSL_DESC= Enable SSL
+IPV6_DESC= Enable IPv6 support
+DEBUG_DESC= Build with debug enabled
+DEBUG_HEXDUMP_DESC= Enable hexdump of sent and received traffic
+
+.include <bsd.port.options.mk>
+
+CFLAGS_EXTRA=
+
+.for FLAG in ${OPTIONS_MONGOOSE}
+. if !${PORT_OPTIONS:M${FLAG}}
+CFLAGS_EXTRA+=-DMONGOOSE_NO_${FLAG}
+. endif
+.endfor
+
+.for FLAG in ${OPTIONS_NS}
+. if ${PORT_OPTIONS:M${FLAG}}
+CFLAGS_EXTRA+=-DNS_ENABLE_${FLAG}
+. endif
+.endfor
+
+.if !${PORT_OPTIONS:MTHREADS}
+CFLAGS_EXTRA+=-DNS_DISABLE_THREADS -DMONGOOSE_NO_THREADS
+.endif
+
+.if ${PORT_OPTIONS:MDEBUG_HEXDUMP}
+CFLAGS_EXTRA+=-DNS_ENABLE_HEXDUMP
+.endif
+
+.if ${PORT_OPTIONS:MSSL}
+USE_OPENSSL= YES
+CFLAGS_EXTRA+= -lssl
+.endif
+
+.if !empty(PORT_OPTIONS:MDAV) && empty(PORT_OPTIONS:MDIRECTORY_LISTING)
+BROKEN= DAV requires DIRECTORY_LISTING
+.endif
+
+MAKE_ENV+= CFLAGS_EXTRA="-DMONGOOSE_NO_WEBSOCKET ${CFLAGS_EXTRA}"
+
+PLIST_FILES= bin/mongoose
+
+do-install:
+ ${MV} ${BUILD_WRKSRC}/server ${BUILD_WRKSRC}/mongoose
+ ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/mongoose ${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/www/mongoose/distinfo b/www/mongoose/distinfo
new file mode 100644
index 000000000000..58a4958819ee
--- /dev/null
+++ b/www/mongoose/distinfo
@@ -0,0 +1,2 @@
+SHA256 (mongoose-5.3.tar.gz) = 3ced399521edfa75a020f2b9457c5b4ba40c518139bb5237c1d88e4b2c85de16
+SIZE (mongoose-5.3.tar.gz) = 109908
diff --git a/www/mongoose/files/mongoose.in b/www/mongoose/files/mongoose.in
new file mode 100644
index 000000000000..b6070e587216
--- /dev/null
+++ b/www/mongoose/files/mongoose.in
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: mongoose
+# REQUIRE: daemon
+
+# Define these mongoose_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/mongoose
+#
+# mongoose_enable Set to "YES" to run mongoose.
+# mongoose_flags Flags passed to mongoose, see mongoose --help
+
+. /etc/rc.subr
+
+name="mongoose"
+rcvar=mongoose_enable
+command="%%PREFIX%%/bin/mongoose"
+
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+mongoose_enable=${mongoose_enable-"NO"}
+mongoose_flags=${mongoose_flags-"/var/empty"}
+mongoose_pidfile=${mongoose_pidfile-"/var/run/mongoose"}
+
+start_cmd="mongoose_start"
+
+load_rc_config $name
+
+mongoose_start () {
+ echo "Starting mongoose."
+ /usr/sbin/daemon -p $mongoose_pidfile $command $mongoose_flags >/dev/null 2>&1
+}
+
+run_rc_command "$1"
diff --git a/www/mongoose/files/patch-mongoose.c b/www/mongoose/files/patch-mongoose.c
new file mode 100644
index 000000000000..94ec1c4595ab
--- /dev/null
+++ b/www/mongoose/files/patch-mongoose.c
@@ -0,0 +1,65 @@
+--- mongoose.c
++++ mongoose.c
+@@ -1162,19 +1162,6 @@ typedef pid_t process_id_t;
+ #define MONGOOSE_IDLE_TIMEOUT_SECONDS 30
+ #endif
+
+-#ifdef MONGOOSE_NO_SOCKETPAIR
+-#define MONGOOSE_NO_CGI
+-#endif
+-
+-#ifdef MONGOOSE_NO_FILESYSTEM
+-#define MONGOOSE_NO_AUTH
+-#define MONGOOSE_NO_CGI
+-#define MONGOOSE_NO_DAV
+-#define MONGOOSE_NO_DIRECTORY_LISTING
+-#define MONGOOSE_NO_LOGGING
+-#define MONGOOSE_NO_SSI
+-#endif
+-
+ struct vec {
+ const char *ptr;
+ int len;
+--- mongoose.h
++++ mongoose.h
+@@ -22,6 +22,40 @@
+
+ #define MONGOOSE_VERSION "5.4"
+
++#ifdef MONGOOSE_NO_SOCKETPAIR
++#ifndef MONGOOSE_NO_CGI
++#define MONGOOSE_NO_CGI
++#endif
++#endif
++
++#ifdef MONGOOSE_NO_FILESYSTEM
++#ifndef MONGOOSE_NO_AUTH
++#define MONGOOSE_NO_AUTH
++#endif
++#ifndef MONGOOSE_NO_CGI
++#define MONGOOSE_NO_CGI
++#endif
++#ifndef MONGOOSE_NO_DAV
++#define MONGOOSE_NO_DAV
++#endif
++#ifndef MONGOOSE_NO_DIRECTORY_LISTING
++#define MONGOOSE_NO_DIRECTORY_LISTING
++#endif
++#ifndef MONGOOSE_NO_LOGGING
++#define MONGOOSE_NO_LOGGING
++#endif
++#ifndef MONGOOSE_NO_SSI
++#define MONGOOSE_NO_SSI
++#endif
++#endif
++
++// DAV requires MONGOOSE_NO_DIRECTORY_LISTING
++#ifndef MONGOOSE_NO_DAV
++#ifdef MONGOOSE_NO_DIRECTORY_LISTING
++#undef MONGOOSE_NO_DIRECTORY_LISTING
++#endif
++#endif
++
+ #include <stdio.h> // required for FILE
+ #include <stddef.h> // required for size_t
+
diff --git a/www/mongoose/pkg-descr b/www/mongoose/pkg-descr
new file mode 100644
index 000000000000..31737e7dda30
--- /dev/null
+++ b/www/mongoose/pkg-descr
@@ -0,0 +1,9 @@
+Mongoose is a small, fast and easy to use web server. It supports
+CGI, SSI, SSL, Digest auth, Websocket, WEbDAV, Resumed download, URL
+rewrite, file blacklist. Having SHTTPD as a predecessor, another
+feature of mongoose is the ability to embed it into existing C/C++
+applications. Embedded API is very clean and simple.
+Mongoose has small memory footprint. Use it when other
+web servers like Apache are too heavy for your tasks.
+
+WWW: https://github.com/cesanta/mongoose