pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
(www/unit) New package by Sergey Osokin as found: PR/55553
Module Name: pkgsrc-wip
Committed By: Makoto Fujiwara <makoto%ki.nu@localhost>
Pushed By: mef
Date: Tue Aug 11 11:37:02 2020 +0900
Changeset: 8800a8bfbb44e8ac0ead4249f8619a1752e8e927
Added Files:
unit/DESCR
unit/Makefile
unit/PLIST
unit/distinfo
unit/patches/patch-aa
unit/patches/patch-ab
unit/patches/patch-ac
Log Message:
(www/unit) New package by Sergey Osokin as found: PR/55553
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8800a8bfbb44e8ac0ead4249f8619a1752e8e927
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
unit/DESCR | 6 ++++++
unit/Makefile | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
unit/PLIST | 3 +++
unit/distinfo | 9 +++++++++
unit/patches/patch-aa | 27 ++++++++++++++++++++++++++
unit/patches/patch-ab | 48 ++++++++++++++++++++++++++++++++++++++++++++++
unit/patches/patch-ac | 33 ++++++++++++++++++++++++++++++++
7 files changed, 179 insertions(+)
diffs:
diff --git a/unit/DESCR b/unit/DESCR
new file mode 100644
index 0000000000..b9925c0e75
--- /dev/null
+++ b/unit/DESCR
@@ -0,0 +1,6 @@
+NGINX Unit is a lightweight dynamic open-source server for diverse
+web applications; to install it, see here.
+
+Built from scratch, Unit can run web apps in different language
+versions; fully configurable in runtime with zero interruption, it
+enables on-the-fly granular management for engineering and operations.
diff --git a/unit/Makefile b/unit/Makefile
new file mode 100644
index 0000000000..27e052dc9a
--- /dev/null
+++ b/unit/Makefile
@@ -0,0 +1,53 @@
+# $NetBSD$
+
+DISTNAME= unit-1.18.0
+CATEGORIES= www
+MASTER_SITES= https://unit.nginx.org/download/
+
+MAINTAINER= osa%FreeBSD.org@localhost
+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"
diff --git a/unit/PLIST b/unit/PLIST
new file mode 100644
index 0000000000..7f634c0d71
--- /dev/null
+++ b/unit/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+sbin/unitd
+@pkgdir libexec/unit
diff --git a/unit/distinfo b/unit/distinfo
new file mode 100644
index 0000000000..cc029d7090
--- /dev/null
+++ b/unit/distinfo
@@ -0,0 +1,9 @@
+$NetBSD$
+
+SHA1 (unit-1.18.0.tar.gz) = ef7edf05201ea9b52b2c92e5c9dce3b9fa00cd98
+RMD160 (unit-1.18.0.tar.gz) = fa25a9e7556fcc34b9d243669a15ae2848d2054e
+SHA512 (unit-1.18.0.tar.gz) = 2beac69caeb09278a6c2cdafe20a8040e589f9ad6e302c896cd396ae7d576f563dd6a480f815b4a26d22e15592b5abcd927a8ba436517bd9b9bbb78bff3176ff
+Size (unit-1.18.0.tar.gz) = 742273 bytes
+SHA1 (patch-aa) = ef3193bbb3afc12a247e64ffa79db940e04a94d3
+SHA1 (patch-ab) = 48817385ee41e7d6bd990889236c4c29e9929d2a
+SHA1 (patch-ac) = 9dc38526ffe483b50712c27d9c63b8d481eddf5a
diff --git a/unit/patches/patch-aa b/unit/patches/patch-aa
new file mode 100644
index 0000000000..1e7a807de8
--- /dev/null
+++ b/unit/patches/patch-aa
@@ -0,0 +1,27 @@
+$NetBSD$
+
+
+--- src/nxt_conn_write.c.orig 2020-05-28 12:04:00.000000000 -0400
++++ src/nxt_conn_write.c 2020-08-08 16:49:50.752693316 -0400
+@@ -266,6 +266,21 @@
+ res = sendfile(s, fd, &pos, size);
+ #endif
+
++#ifdef NXT_HAVE_NETBSD_SENDFILE
++ struct stat fileinfo;
++ void *fmem = NULL;
++ res = fstat(fd, &fileinfo);
++ if (res == 0) {
++ fmem = mmap(NULL, fileinfo.st_size, PROT_READ, MAP_FILE | MAP_SHARED, fd, 0);
++ }
++ if (fmem != NULL) {
++ res = write(s, fmem, fileinfo.st_size);
++ munmap(fmem, fileinfo.st_size);
++ } else {
++ res = -1;
++ }
++#endif
++
+ return res;
+ }
+
diff --git a/unit/patches/patch-ab b/unit/patches/patch-ab
new file mode 100644
index 0000000000..9267f73642
--- /dev/null
+++ b/unit/patches/patch-ab
@@ -0,0 +1,48 @@
+$NetBSD$
+
+
+--- auto/sendfile.orig 2020-08-08 16:00:55.378410575 -0400
++++ auto/sendfile 2020-08-08 16:16:14.270362755 -0400
+@@ -5,6 +5,7 @@
+
+ NXT_HAVE_LINUX_SENDFILE=NO
+ NXT_HAVE_FREEBSD_SENDFILE=NO
++NXT_HAVE_NETBSD_SENDFILE=NO
+ NXT_HAVE_MACOSX_SENDFILE=NO
+ NXT_HAVE_SOLARIS_SENDFILEV=NO
+ NXT_HAVE_AIX_SEND_FILE=NO
+@@ -82,6 +83,34 @@
+ fi
+ fi
+
++if [ $nxt_found = no ]; then
++
++ # NetBSD has no sendfile().
++
++ nxt_feature="NetBSD mmap()/write()"
++ nxt_feature_name=NXT_HAVE_NETBSD_SENDFILE
++ nxt_feature_libs=
++ nxt_feature_test="#include <sys/types.h>
++ #include <sys/mman.h>
++ #include <sys/stat.h>
++ #include <fcntl.h>
++ #include <unistd.h>
++
++ int main() {
++ struct stat f;
++ void *m = NULL;
++
++ fstat(-1, &f);
++ m = mmap(NULL, f.st_size, PROT_READ, MAP_FILE | MAP_SHARED, -1, 0);
++ write(-1, m, f.st_size);
++ munmap(m, f.st_size);
++ }"
++ . auto/feature
++
++ if [ $nxt_found = yes ]; then
++ NXT_HAVE_NETBSD_SENDFILE=YES
++ fi
++fi
+
+ if [ $nxt_found = no ]; then
+ $echo
diff --git a/unit/patches/patch-ac b/unit/patches/patch-ac
new file mode 100644
index 0000000000..415ab87dfe
--- /dev/null
+++ b/unit/patches/patch-ac
@@ -0,0 +1,33 @@
+$NetBSD$
+
+
+--- src/nxt_application.c.orig 2020-08-08 16:28:19.771768606 -0400
++++ src/nxt_application.c 2020-08-08 16:33:14.070404193 -0400
+@@ -474,20 +474,24 @@
+ static nxt_int_t
+ nxt_app_prefork(nxt_task_t *task, nxt_process_t *process, nxt_mp_t *mp)
+ {
+- nxt_int_t cap_setid, cap_chroot;
++ nxt_int_t cap_setid;
+ nxt_int_t ret;
+ nxt_runtime_t *rt;
+ nxt_common_app_conf_t *app_conf;
+- nxt_app_lang_module_t *lang;
+
+ rt = task->thread->runtime;
+ app_conf = process->data.app;
+ cap_setid = rt->capabilities.setid;
+- cap_chroot = rt->capabilities.chroot;
+
++#if (NXT_HAVE_ISOLATION_ROOTFS)
++ nxt_int_t cap_chroot;
++ nxt_app_lang_module_t *lang;
++
++ cap_chroot = rt->capabilities.chroot;
+ lang = nxt_app_lang_module(rt, &app_conf->type);
+
+ nxt_assert(lang != NULL);
++#endif
+
+ if (app_conf->isolation != NULL) {
+ ret = nxt_app_set_isolation(task, app_conf->isolation, process);
Home |
Main Index |
Thread Index |
Old Index