Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2017 00:19:14 +0000 (UTC)
From:      "Sergey A. Osokin" <osa@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r454295 - in head/www: . unit unit/files
Message-ID:  <201711160019.vAG0JEIw048524@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: osa
Date: Thu Nov 16 00:19:13 2017
New Revision: 454295
URL: https://svnweb.freebsd.org/changeset/ports/454295

Log:
  Add NGINX unit - a dynamic web application server, designed to
  run applications in multiple languages.
  
  Please visit the http://unit.nginx.org/ site for more details.

Added:
  head/www/unit/
  head/www/unit/Makefile   (contents, props changed)
  head/www/unit/distinfo   (contents, props changed)
  head/www/unit/files/
  head/www/unit/files/unitd.in   (contents, props changed)
  head/www/unit/pkg-descr   (contents, props changed)
Modified:
  head/www/Makefile

Modified: head/www/Makefile
==============================================================================
--- head/www/Makefile	Wed Nov 15 22:43:20 2017	(r454294)
+++ head/www/Makefile	Thu Nov 16 00:19:13 2017	(r454295)
@@ -2375,6 +2375,7 @@
     SUBDIR += udmsearch
     SUBDIR += ufdbguard
     SUBDIR += uglifyjs
+    SUBDIR += unit
     SUBDIR += usermanager
     SUBDIR += uwsgi
     SUBDIR += uwsgitop

Added: head/www/unit/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/unit/Makefile	Thu Nov 16 00:19:13 2017	(r454295)
@@ -0,0 +1,159 @@
+# $FreeBSD$
+
+PORTNAME=	unit
+PORTVERSION=	0.2
+CATEGORIES=	www
+MASTER_SITES=	http://unit.nginx.org/download/
+
+MAINTAINER=	osa@FreeBSD.org
+COMMENT=	Dynamic web application server
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES+=		cpe
+
+CPE_VENDOR=	nginx
+CPE_PRODUCT=	unit
+
+NO_OPTIONS_SORT=	yes
+OPTIONS_DEFINE=	\
+	DEBUG \
+	IPV6 \
+	UNIXSOCK \
+	PHP \
+	PYTHON27 \
+	PYTHON34 \
+	PYTHON35 \
+	PYTHON36
+
+OPTIONS_DEFAULT?=IPV6 PYTHON27
+
+DEBUG_DESC=	Enable debug logging
+IPV6_DESC=	Enable IPv6
+UNIXSOCK_DESC=	Enable unix sockets
+GO_DESC=	Enable Go module
+PHP_DESC=	Enable PHP module
+PYTHON27_DESC=	Enable Python 2.7 module
+PYTHON34_DESC=	Enable Python 3.4 module
+PYTHON35_DESC=	Enable Python 3.5 module
+PYTHON36_DESC=	Enable Python 3.6 module
+
+.include <bsd.port.options.mk>
+
+HAS_CONFIGURE=	yes
+
+UNIT_VARDIR?=	/var
+UNIT_RUNDIR?=	${UNIT_VARDIR}/run/unit
+UNIT_LOGDIR?=	${UNIT_VARDIR}/log/${PORTNAME}
+UNIT_LOGFILE?=	${UNIT_LOGDIR}/${PORTNAME}.log
+UNIT_PIDFILE?=	${UNIT_RUNDIR}/${PORTNAME}.pid
+UNIT_SOCK?=	${UNIT_RUNDIR}/control.unit.sock
+
+PLIST_FILES+=	etc/rc.d/unitd \
+		sbin/unitd
+
+CONFIGURE_ARGS+=--bindir=${PREFIX}/bin \
+		--sbindir=${PREFIX}/sbin \
+		--modules=${PREFIX}/libexec/${PORTNAME} \
+		--log=${UNIT_LOGFILE} \
+		--pid=${UNIT_PIDFILE} \
+		--ld-opt="-L${LOCALBASE}/lib"
+
+USE_RC_SUBR=	unitd
+SUB_LIST+=	UNIT_PIDFILE=${UNIT_PIDFILE} \
+		UNIT_SOCK=${UNIT_SOCK} \
+		PREFIX=${PREFIX}
+
+.if ${PORT_OPTIONS:MDEBUG}
+CONFIGURE_ARGS+=--debug
+.endif
+
+.if empty(PORT_OPTIONS:MIPV6)
+CONFIGURE_ARGS+=--no-ipv6
+.endif
+
+.if empty(PORT_OPTIONS:MUNIXSOCK)
+CONFIGURE_ARGS+=--no-unix-sockets
+.else
+CONFIGURE_ARGS+=--control=unix:${UNIT_SOCK}
+.endif
+
+.if ${PORT_OPTIONS:MGO}
+BUILD_DEPENDS+=	${LOCALBASE}/bin/go:lang/go
+RUN_DEPENDS+=	${LOCALBASE}/bin/go:lang/go
+PLIST_FILES+=	go/src/unit/cbytes-1.6.go \
+		go/src/unit/cbytes-1.7.go \
+		go/src/unit/nxt_go_array.c \
+		go/src/unit/nxt_go_array.h \
+		go/src/unit/nxt_go_lib.c \
+		go/src/unit/nxt_go_lib.h \
+		go/src/unit/nxt_go_log.h \
+		go/src/unit/nxt_go_mutex.h \
+		go/src/unit/nxt_go_port.c \
+		go/src/unit/nxt_go_port.h \
+		go/src/unit/nxt_go_port_memory.c \
+		go/src/unit/nxt_go_port_memory.h \
+		go/src/unit/nxt_go_process.c \
+		go/src/unit/nxt_go_process.h \
+		go/src/unit/nxt_go_run_ctx.c \
+		go/src/unit/nxt_go_run_ctx.h \
+		go/src/unit/port.go \
+		go/src/unit/request.go \
+		go/src/unit/response.go \
+		go/src/unit/unit.go \
+		go/pkg/freebsd_amd64/unit.a
+.endif
+
+.if ${PORT_OPTIONS:MPHP}
+USES+=	php:embed
+PLIST_FILES+=	libexec/unit/php.unit.so
+.endif
+
+.if ${PORT_OPTIONS:MPYTHON27}
+USES+=	python:2.7
+PLIST_FILES+=	libexec/unit/python2.7.unit.so
+.endif
+
+.if ${PORT_OPTIONS:MPYTHON34}
+USES+=	python:3.4
+PLIST_FILES+=	libexec/unit/python3.4.unit.so
+.endif
+
+.if ${PORT_OPTIONS:MPYTHON35}
+USES+=	python:3.5
+PLIST_FILES+=	libexec/unit/python3.5.unit.so
+.endif
+
+.if ${PORT_OPTIONS:MPYTHON36}
+USES+=	python:3.6
+PLIST_FILES+=	libexec/unit/python3.6.unit.so
+.endif
+
+post-configure:
+.if ${PORT_OPTIONS:MGO}
+	@cd ${WRKSRC} && ./configure go --go=${PREFIX}/bin/go --go-path=${PREFIX}/go
+.endif
+.if ${PORT_OPTIONS:MPHP}
+	@cd ${WRKSRC} && ./configure php --config=${PREFIX}/bin/php-config --lib-path="${PREFIX}/lib"
+.endif
+.if ${PORT_OPTIONS:MPYTHON27}
+	@cd ${WRKSRC} && ./configure python --config=${PREFIX}/bin/python2.7-config
+.endif
+.if ${PORT_OPTIONS:MPYTHON34}
+	@cd ${WRKSRC} && ./configure python --config=${PREFIX}/bin/python3.4-config
+.endif
+.if ${PORT_OPTIONS:MPYTHON35}
+	@cd ${WRKSRC} && ./configure python --config=${PREFIX}/bin/python3.5-config
+.endif
+.if ${PORT_OPTIONS:MPYTHON36}
+	@cd ${WRKSRC} && ./configure python --config=${PREFIX}/bin/python3.6-config
+.endif
+
+post-install:
+	${MKDIR} ${STAGEDIR}${UNIT_LOGDIR}
+	${MKDIR} ${STAGEDIR}${UNIT_RUNDIR}
+	${ECHO_CMD} @dir ${UNIT_LOGDIR} >> ${TMPPLIST}
+	${ECHO_CMD} @dir ${UNIT_RUNDIR} >> ${TMPPLIST}
+
+.include <bsd.port.mk>

Added: head/www/unit/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/unit/distinfo	Thu Nov 16 00:19:13 2017	(r454295)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1508776840
+SHA256 (unit-0.2.tar.gz) = 07d7f6dc9d6b7014ed8e80176864c37a1dc688cc8272f0d9f37e8817aa7a12c5
+SIZE (unit-0.2.tar.gz) = 366853

Added: head/www/unit/files/unitd.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/unit/files/unitd.in	Thu Nov 16 00:19:13 2017	(r454295)
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+# PROVIDE: unitd
+# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable nginx:
+# unitd_enable (bool):          Set to "NO" by default.
+#                               Set it to "YES" to enable unit
+# unitd_sockfile (str):         Set to "" by default.
+#                               Set it to "127.0.0.1:8443" to enable the unit control
+#                               socket on the network address
+
+. /etc/rc.subr
+
+name="unitd"
+rcvar=unitd_enable
+
+command="%%PREFIX%%/sbin/unitd"
+start_precmd=start_precmd
+
+start_precmd()
+{
+    rm -f %%UNIT_SOCK%%
+}
+
+load_rc_config $name
+
+# Default value
+: ${unitd_sockfile=""}
+
+pidfile=${unit_pidfile:-"%%UNIT_PIDFILE%%"}
+unitd_enable=${unitd_enable:-"NO"}
+sockfile=${unitd_sockfile}
+
+if [ x${sockfile} != "x" ]
+then
+    command_args="--control ${sockfile}"
+fi
+
+run_rc_command "$1"

Added: head/www/unit/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/unit/pkg-descr	Thu Nov 16 00:19:13 2017	(r454295)
@@ -0,0 +1,6 @@
+NGINX Unit is a dynamic web application server, designed to run applications
+in multiple languages. Unit is lightweight, polyglot, and dynamically
+configured via API. The design of the server allows reconfiguration of
+specific application parameters as needed by the engineering or operations.
+
+WWW: http://unit.nginx.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711160019.vAG0JEIw048524>