Update to the recent version from GH.
authorSergey A. Osokin <osa@FreeBSD.org.ru>
Tue, 11 Aug 2020 11:04:15 +0000 (07:04 -0400)
committerSergey A. Osokin <osa@FreeBSD.org>
Tue, 11 Aug 2020 11:19:14 +0000 (07:19 -0400)
unit/DESCR
unit/Makefile
unit/Makefile.common [new file with mode: 0644]
unit/PLIST
unit/files/unit.sh [new file with mode: 0644]
unit/options.mk [new file with mode: 0644]

index b9925c0e7567dea257f4deb7ac6fc8bd59fcaf1a..3599145d9a096a96e36fa75d75e6b84510c98210 100644 (file)
@@ -1,5 +1,5 @@
 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
index 27e052dc9ac87a5e4ceab2779966f4bb3f4d666b..b4841b1c48b6e708a2724107760afa3561621cb8 100644 (file)
@@ -1,53 +1,7 @@
 # $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"
diff --git a/unit/Makefile.common b/unit/Makefile.common
new file mode 100644 (file)
index 0000000..627dda7
--- /dev/null
@@ -0,0 +1,70 @@
+# $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"
index 7f634c0d713ba1063356cb935e67022ce58ebc8b..4d3ae4a459e8d5931d426866dd701a3a2eba393a 100644 (file)
@@ -1,3 +1,13 @@
 @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
diff --git a/unit/files/unit.sh b/unit/files/unit.sh
new file mode 100644 (file)
index 0000000..c91ee80
--- /dev/null
@@ -0,0 +1,17 @@
+#!@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"
diff --git a/unit/options.mk b/unit/options.mk
new file mode 100644 (file)
index 0000000..09e30a9
--- /dev/null
@@ -0,0 +1,26 @@
+# $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