NGINX Unit is a lightweight dynamic open-source server for diverse
-web applications; to install it, see here.
+web applications.
Built from scratch, Unit can run web apps in different language
versions; fully configurable in runtime with zero interruption, it
# $NetBSD$
DISTNAME= unit-1.18.0
-CATEGORIES= www
-MASTER_SITES= https://unit.nginx.org/download/
MAINTAINER= osa@FreeBSD.org
-HOMEPAGE= https://unit.nginx.org/download/
-COMMENT= Dynamic web application server
-LICENSE= apache-2.0
-.include "../../mk/bsd.prefs.mk"
-
-UNIT_USER?= unit
-UNIT_GROUP?= unit
-UNIT_DATADIR?= ${VARBASE}/db/unit
-UNIT_LOGDIR?= ${VARBASE}/log/unit
-UNIT_RUNDIR?= ${VARBASE}/run/unit
-UNIT_PIDDIR?= ${VARBASE}/run
-UNIT_TMPDIR?= ${VARBASE}/tmp
-
-BUILD_DEFS+= UNIT_DATADIR UNIT_LOGDIR UNIT_PIDDIR VARBASE
-
-PKG_USERS_VARS+= UNIT_USER
-PKG_GROUPS_VARS+= UNIT_GROUP
-PKG_GROUPS= ${UNIT_GROUP}
-PKG_USERS= ${UNIT_USER}:${UNIT_GROUP}
-
-PKG_GECOS.${UNIT_USER}= NGINX Unit server user
-PKG_HOME.${UNIT_USER}= ${UNIT_DATADIR}
-PKG_SHELL.${UNIT_USER}= ${NOLOGIN}
-
-USE_PKGLOCALEDIR= yes
-HAS_CONFIGURE= yes
-CONFIGURE_ARGS+= --prefix=${PREFIX}
-CONFIGURE_ARGS+= --ld-opt="-L${PREFIX}/lib"
-CONFIGURE_ARGS+= --log=${UNIT_LOGDIR}/unit.log
-CONFIGURE_ARGS+= --modules=libexec/unit/modules
-CONFIGURE_ARGS+= --pid=${UNIT_PIDDIR}/unit.pid
-CONFIGURE_ARGS+= --state=libexec/unit
-CONFIGURE_ARGS+= --control=unix:${UNIT_RUNDIR}/control.unit.sock
-CONFIGURE_ARGS+= --tmp=${UNIT_TMPDIR}
-CONFIGURE_ARGS+= --user=${UNIT_USER}
-CONFIGURE_ARGS+= --group=${UNIT_GROUP}
-
-INSTALLATION_DIRS+= sbin
-MAKE_DIRS+= ${UNIT_PIDDIR} ${UNIT_DATADIR} ${UNIT_RUNDIR}
-OWN_DIRS= ${UNIT_LOGDIR} ${UNIT_RUNDIR}
-OWN_DIRS_PERMS+= ${UNIT_DATADIR} ${UNIT_USER} ${UNIT_GROUP} 0700
-
-USE_LANGUAGES= c c++
-
-.include "../../mk/bsd.pkg.mk"
+.include "../../www/unit/Makefile.common"
--- /dev/null
+# $NetBSD$
+#
+# used by www/unit/Makefile
+# used by www/unit-php/Makefile
+
+# Do *not* add any version-specific data here
+
+CATEGORIES= www
+MASTER_SITES= https://unit.nginx.org/download/
+
+HOMEPAGE= https://unit.nginx.org/
+COMMENT= Dynamic web application server
+LICENSE= apache-2.0
+
+.include "../../mk/bsd.prefs.mk"
+
+UNIT_USER?= unit
+UNIT_GROUP?= unit
+UNIT_DATADIR?= ${VARBASE}/db/unit
+UNIT_LOGDIR?= ${VARBASE}/log/unit
+UNIT_RUNDIR?= ${VARBASE}/run/unit
+UNIT_PIDDIR?= ${VARBASE}/run
+UNIT_TMPDIR?= ${VARBASE}/tmp
+
+BUILD_DEFS+= UNIT_DATADIR UNIT_LOGDIR UNIT_PIDDIR VARBASE
+
+PKG_USERS_VARS+= UNIT_USER
+PKG_GROUPS_VARS+= UNIT_GROUP
+PKG_GROUPS= ${UNIT_GROUP}
+PKG_USERS= ${UNIT_USER}:${UNIT_GROUP}
+
+PKG_GECOS.${UNIT_USER}= NGINX Unit server user
+PKG_HOME.${UNIT_USER}= ${UNIT_DATADIR}
+PKG_SHELL.${UNIT_USER}= ${NOLOGIN}
+
+USE_PKGLOCALEDIR= yes
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS+= --prefix=${PREFIX}
+CONFIGURE_ARGS+= --ld-opt=-L${PREFIX}/lib
+CONFIGURE_ARGS+= --log=${UNIT_LOGDIR}/unit.log
+CONFIGURE_ARGS+= --modules=libexec/unit/modules
+CONFIGURE_ARGS+= --pid=${UNIT_PIDDIR}/unit.pid
+CONFIGURE_ARGS+= --state=libexec/unit
+CONFIGURE_ARGS+= --control=unix:${UNIT_RUNDIR}/control.unit.sock
+CONFIGURE_ARGS+= --tmp=${UNIT_TMPDIR}
+CONFIGURE_ARGS+= --user=${UNIT_USER}
+CONFIGURE_ARGS+= --group=${UNIT_GROUP}
+
+.include "../../www/unit/options.mk"
+
+RCD_SCRIPTS= unit
+
+INSTALLATION_DIRS+= sbin
+MAKE_DIRS+= ${UNIT_PIDDIR} ${UNIT_DATADIR} ${UNIT_RUNDIR}
+OWN_DIRS= ${UNIT_LOGDIR} ${UNIT_RUNDIR}
+OWN_DIRS_PERMS+= ${UNIT_DATADIR} ${UNIT_USER} ${UNIT_GROUP} 0700
+
+USE_LANGUAGES= c
+
+post-build:
+.if !empty(PKG_OPTIONS:Mdevkit)
+ @cd ${WRKSRC} && ${MAKE} build/libunit.a
+.endif
+
+post-install:
+.if !empty(PKG_OPTIONS:Mdevkit)
+ ${MAKE} -C ${WRKSRC} libunit-install DESTDIR=${DESTDIR}
+.endif
+
+.include "../../mk/bsd.pkg.mk"
@comment $NetBSD$
+${PLIST.devkit}include/nxt_unit_field.h
+${PLIST.devkit}include/nxt_unit_request.h
+${PLIST.devkit}include/nxt_unit_response.h
+${PLIST.devkit}include/nxt_unit_sptr.h
+${PLIST.devkit}include/nxt_unit_typedefs.h
+${PLIST.devkit}include/nxt_unit_websocket.h
+${PLIST.devkit}include/nxt_unit.h
+${PLIST.devkit}include/nxt_version.h
+${PLIST.devkit}include/nxt_websocket_header.h
+${PLIST.devkit}lib/libunit.a
sbin/unitd
@pkgdir libexec/unit
--- /dev/null
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: unit
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="unit"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/${name}.pid"
+start_precmd="ulimit -n 2048"
+
+load_rc_config $name
+run_rc_command "$1"
--- /dev/null
+# $NetBSD$
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.unit
+PKG_SUPPORTED_OPTIONS= debug devkit inet6 ssl
+PKG_SUGGESTED_OPTIONS= inet6 ssl
+
+PLIST_VARS+= devkit
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CONFIGURE_ARGS+= --debug
+.endif
+
+.if !empty(PKG_OPTIONS:Mdevkit)
+PLIST.devkit= yes
+.endif
+
+.if empty(PKG_OPTIONS:Minet6)
+CONFIGURE_ARGS+=--no-ipv6
+.endif
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+CONFIGURE_ARGS+= --openssl
+.endif