head	1.10;
access;
symbols
	pkgsrc-2026Q2:1.9.0.2
	pkgsrc-2026Q2-base:1.9
	pkgsrc-2026Q1:1.2.0.2
	pkgsrc-2026Q1-base:1.2;
locks; strict;
comment	@# @;


1.10
date	2026.07.08.19.19.00;	author osa;	state Exp;
branches;
next	1.9;
commitid	if3WeiPckpsLTSMG;

1.9
date	2026.06.03.13.46.38;	author osa;	state Exp;
branches;
next	1.8;
commitid	opE2sfYzgWmLbmIG;

1.8
date	2026.05.21.10.37.15;	author osa;	state Exp;
branches;
next	1.7;
commitid	wn3whcLw7H8syFGG;

1.7
date	2026.05.21.10.27.50;	author osa;	state Exp;
branches;
next	1.6;
commitid	w2oisVFAfpgwvFGG;

1.6
date	2026.05.10.12.02.49;	author osa;	state Exp;
branches;
next	1.5;
commitid	ZgIvAvJvZN73ogFG;

1.5
date	2026.04.23.15.38.10;	author osa;	state Exp;
branches;
next	1.4;
commitid	r5PXHLNtEjjA76DG;

1.4
date	2026.04.14.14.42.57;	author osa;	state Exp;
branches;
next	1.3;
commitid	CVobKfMib67w6WBG;

1.3
date	2026.04.14.14.38.09;	author osa;	state Exp;
branches;
next	1.2;
commitid	SeehnLCVxzUB4WBG;

1.2
date	2026.01.07.08.49.18;	author wiz;	state Exp;
branches;
next	1.1;
commitid	1wQ3ICD8eebefrpG;

1.1
date	2025.12.25.18.57.20;	author osa;	state Exp;
branches;
next	;
commitid	Pml9OrlYISR13PnG;


desc
@@


1.10
log
@www/freenginx: third-party modules management (+)

Update cache_purge module and njs modules to their recent versions (merge
changes from www/freenginx-devel).

Bump PKGREVISION.

Sponsored by:	tipi.work
@
text
@# $NetBSD: Makefile,v 1.9 2026/06/03 13:46:38 osa Exp $

DISTNAME=	freenginx-1.30.1
PKGREVISION=	1
CATEGORIES=	www
MASTER_SITES=	https://freenginx.org/download/
DISTFILES=	${DEFAULT_DISTFILES}

MAINTAINER=	osa@@NetBSD.org
HOMEPAGE=	https://freenginx.org/
COMMENT=	Lightweight HTTP server and mail proxy server
LICENSE=	2-clause-bsd

CONFLICTS=	freenginx-devel-[0-9]* nginx-[0-9]* nginx-devel-[0-9]*

.include "../../mk/bsd.prefs.mk"

NGINX_USER?=		nginx
NGINX_GROUP?=		nginx
NGINX_DATADIR?=		${VARBASE}/db/nginx
NGINX_LOGDIR?=		${VARBASE}/log/nginx
NGINX_PIDDIR?=		${VARBASE}/run

BUILD_DEFS+=		NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE

PKG_USERS_VARS+=	NGINX_USER
PKG_GROUPS_VARS+=	NGINX_GROUP
PKG_GROUPS=		${NGINX_GROUP}
PKG_USERS=		${NGINX_USER}:${NGINX_GROUP}

PKG_GECOS.${NGINX_USER}=	NGINX server user
PKG_HOME.${NGINX_USER}=		${NGINX_DATADIR}
PKG_SHELL.${NGINX_USER}=	${NOLOGIN}

USE_PKGLOCALEDIR=	yes
HAS_CONFIGURE=		yes
CONFIGURE_ARGS+=	--user=${NGINX_USER}
CONFIGURE_ARGS+=	--group=${NGINX_GROUP}
CONFIGURE_ARGS+=	--with-ld-opt=-L${PREFIX}/lib\ ${COMPILER_RPATH_FLAG}${PREFIX}/lib
CONFIGURE_ARGS+=	--prefix=${PREFIX}
CONFIGURE_ARGS+=	--sbin-path=${PREFIX}/sbin
CONFIGURE_ARGS+=	--conf-path=${PKG_SYSCONFDIR}/nginx.conf
CONFIGURE_ARGS+=	--pid-path=${NGINX_PIDDIR}/nginx.pid
CONFIGURE_ARGS+=	--lock-path=${NGINX_DATADIR}/nginx.lock
CONFIGURE_ARGS+=	--error-log-path=${NGINX_LOGDIR}/error.log
CONFIGURE_ARGS+=	--http-log-path=${NGINX_LOGDIR}/access.log
CONFIGURE_ARGS+=	--http-client-body-temp-path=${NGINX_DATADIR}/client_body_temp
CONFIGURE_ARGS+=	--http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp
CONFIGURE_ARGS+=	--http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp
CONFIGURE_ARGS+=	--http-scgi-temp-path=${NGINX_DATADIR}/scgi_temp
CONFIGURE_ARGS+=	--with-pcre

SUBST_CLASSES+=			fix-pcre2
SUBST_STAGE.fix-pcre2=		pre-configure
SUBST_FILES.fix-pcre2=		auto/lib/pcre/conf
SUBST_SED.fix-pcre2=		-e 's,/usr/pkg,${BUILDLINK_PREFIX.pcre2},g'
SUBST_NOOP_OK.fix-pcre2=	yes

PKG_SYSCONFSUBDIR=	nginx

.include "options.mk"

EGDIR=			${PREFIX}/share/examples/freenginx
EGFILES+=		fastcgi.conf fastcgi_params koi-utf koi-win \
			mime.types nginx.conf win-utf

.for file in ${EGFILES}
CONF_FILES+=	${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file}
.  if !empty(PKG_OPTIONS:Mnginx-naxsi)
CONF_FILES+=	${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules
.  endif
.endfor

RCD_SCRIPTS=		nginx

INSTALLATION_DIRS+=	${PKGMANDIR}/man8 sbin share/examples/freenginx/conf \
			share/examples/freenginx/html
MAKE_DIRS+=		${NGINX_PIDDIR}
OWN_DIRS=		${NGINX_LOGDIR}
OWN_DIRS_PERMS+=	${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700

BUILD_TARGET=		build

SUBST_CLASSES+=		paths
SUBST_STAGE.paths=	pre-configure
SUBST_FILES.paths=	conf/nginx.conf
SUBST_SED.paths=	-e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g'
SUBST_SED.paths+=	-e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g'
SUBST_SED.paths+=	-e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g'
SUBST_SED.paths+=	-e 's,%%NGINX_USER%%,${NGINX_USER},g'
SUBST_SED.paths+=	-e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g'

MESSAGE_SUBST+=		NGINX_LOGDIR=${NGINX_LOGDIR}
MESSAGE_SUBST+=		NGINX_PIDDIR=${NGINX_PIDDIR}
MESSAGE_SUBST+=		NGINX_USER=${NGINX_USER}
MESSAGE_SUBST+=		NGINX_GROUP=${NGINX_GROUP}

.if ${OPSYS} == "Darwin"
SOEXT=		bundle
.else
SOEXT=		so
.endif
PLIST_SUBST+=	SOEXT=${SOEXT}

post-patch:
.if !empty(PKG_OPTIONS:Mnginx-brotli)
	cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-ngx_brotli_filter_config
.endif
.if !empty(PKG_OPTIONS:Mnginx-gssapi)
	${SED} -i.bak '4d;5d;6d' ${WRKDIR}/${GSSAPI_DISTNAME}/config
.endif
.if !empty(PKG_OPTIONS:Mnginx-naxsi)
	${SED} -i.bak '308,309s/MSIZE/NAXSI_MSIZE/g' \
		${WRKSRC}/..${NAXSI_SUBDIR}/libinjection/src/libinjection_sqli.c
.endif
.if !empty(PKG_OPTIONS:Mnginx-njs)
	cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-njs-quickjs
.endif
.if !empty(PKG_OPTIONS:Mnginx-upload)
	cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-ngx_http_upload_module.c
.endif

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx
.for file in ${EGFILES}
	${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file}
.endfor
	${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html
	${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html
	${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
.if !empty(PKG_OPTIONS:Mnginx-naxsi)
	${INSTALL_DATA} ${WRKDIR}/naxsi_rules/naxsi_core.rules ${DESTDIR}${EGDIR}/conf
.endif
.if !empty(PKG_OPTIONS:Mnginx-perl)
	${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx
	${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \
		${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx
	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
		${DESTDIR}${PERL5_INSTALLVENDORARCH}
.endif
.if !empty(PKG_OPTIONS:Mnginx-dso)
	${INSTALL_LIB_DIR} ${DESTDIR}${PREFIX}/libexec/freenginx
	(cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
		-exec ${INSTALL_PROGRAM} {} ${DESTDIR}${PREFIX}/libexec/freenginx \;)
.endif

.include "../../devel/pcre2/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@


1.9
log
@www/freenginx: update: 1.30.0 -> 1.30.1

Sponsored by:	tipi.work

<ChangeLog>

*) Change: the logging level of the "invalid ccs message", "not on
   record boundary", "required compression algorithm missing", and some
   "record layer failure" SSL errors has been lowered from "crit" to
   "info".

*) Bugfix: a segmentation fault might occur in a worker process if the
   "rewrite" directive was used to change request arguments and other
   directives of the ngx_http_rewrite_module were executed afterwards.

*) Bugfix: a segmentation fault might occur in a worker process if
   nested captures were used in the "rewrite" directive.

*) Bugfix: a segmentation fault might occur in a worker process if the
   ngx_http_charset_module was used to convert responses from UTF-8.

*) Bugfix: a segmentation fault might occur in a worker process if the
   "ssl_ocsp" directive was used.

*) Bugfix: a segmentation fault might occur in a worker process if the
   "scgi_pass" or "uwsgi_pass" directives were used.

*) Bugfix: in HTTP/3.

</ChangeLog>
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2026/05/21 10:37:15 osa Exp $
d4 1
d117 1
a117 1
	cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-auto-quickjs
@


1.8
log
@www/freenginx*: update third-party nchan module to 1.3.8

Bump PKGREVISIONs.

ChangeLog:	https://github.com/slact/nchan/compare/v1.3.7...v1.3.8

Sponsored by:	tipi.work
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2026/05/21 10:27:50 osa Exp $
d3 1
a3 2
DISTNAME=	freenginx-1.30.0
PKGREVISION=	4
@


1.7
log
@www/freenginx: update njs 0.9.8 -> 0.9.9

Bump PKGREVISION.

Sponsored by:	tipi.work

<ChangeLog>

nginx modules:

*) Security: a heap buffer overflow might occur in a worker process
   when the "js_fetch_proxy" directive value contains nginx
   variables derived from the client request ($http_*, $arg_*,
   $cookie_*, etc.) and the location's JS handler invokes
   ngx.fetch(). The issue was introduced in dea83189 (0.9.4).

*) Feature: added js_access directive.

*) Feature: added r.readRequestText(), r.readRequestArrayBuffer(),
   and r.readRequestJSON() - async methods that read the request
   body, available in js_access and js_content directives.

*) Feature: added r.readRequestForm() - async method that parses
   the request body submitted from an HTML form
   (application/x-www-form-urlencoded and multipart/form-data) and
   returns a structured accessor object.  The method is available
   in js_access and js_content directives.

*) Feature: added jsVarNames() method.  The method returns the
   names of variables declared with js_var.

Core:

*) Bugfix: fixed evaluation order of call arguments with side
   effects.  Previously, an earlier argument could observe a later
   argument's mutation, e.g. f(a, a = 2) passed 2 as both
   arguments.
   The issue was introduced in fd5e523f (0.9.7).

</ChangeLog>
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2026/05/10 12:02:49 osa Exp $
d4 1
a4 1
PKGREVISION=	3
@


1.6
log
@www/freenginx: update njs 0.9.7 -> 0.9.8

Bump PKGREVISION.

Sponsored by:	tipi.work

<ChangeLog>

nginx modules:

*) Bugfix: fixed loading of the built-in "crypto" module.
   The issue was introduced in 3185ce81 (0.9.7).

</ChangeLog>
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2026/04/23 15:38:10 osa Exp $
d4 1
a4 1
PKGREVISION=	2
@


1.5
log
@www/freenginx: sync with www/freenginx-devel

- update third-party modules
- enable quickjs for njs

Bump PKGREVISION.

Sponsored by:	tipi.work
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2026/04/14 14:42:57 osa Exp $
d4 1
a4 1
PKGREVISION=	1
@


1.4
log
@www/freenginx: update: 1.28.0 -> 1.30.0

Sponsored by:	tipi.work

<ChangeLog>

*) 1.30.x stable branch.

</ChangeLog>
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2026/04/14 14:38:09 osa Exp $
d4 1
d116 3
@


1.3
log
@www/freenginx: update third-party njs module: 0.9.4 -> 0.9.6

Bump PKGREVISION.

Sponsored by:	tipi.work

<ChangeLog>
Changes with njs 0.9.6                                       03 Mar 2026

nginx modules:

*) Bugfix: fixed expire field truncation in shared dict state files.
   Millisecond timestamps were silently truncated to 10 digits,
   making restored entries appear expired on restart.
   The issue has been present since eca03622 (0.9.1).

*) Bugfix: suppressed slab log_nomem for evict shared dict zones.
   When evict is enabled, memory allocation failures are expected
   and handled by evicting old entries.

*) Bugfix: fixed stack trace for native fetch exceptions for QuickJS
   engine.

Core:

*) Feature: added optional chaining support.

*) Feature: added nullish coalescing assignment operator (??=).

*) Feature: added logical assignment operators (||= and &&=).

*) Improvement: aligned SyntaxError reporting with other JS engines.
   Previously, file name was a part of the error message.  Now it is
   reported as "stack" property.

*) Improvement: improved Error.stack traces.
   Stack traces are now attached in error constructors.  Performance
   of Error.stack is improved by ~100 times.

*) Bugfix: fixed string offset map corruption in scope values hash.
   The issue caused SEGV/SIGBUS crashes for multi-byte UTF-8 string
   constants with more than 32 characters when accessing a character
   at index >= 32 (e.g. via .replace() or bracket notation).
   The issue was introduced in e7caa46d (0.9.5).

*) Bugfix: fixed heap-buffer-overflow in atom hash caused by
   Symbol().

*) Bugfix: fixed WebCrypto importKey() crash with mismatched JWK key
   type.

*) Bugfix: fixed interactive mode detection for piped stdin.
   The issue was introduced in 4988565c (0.8.0).

*) Bugfix: fixed build on MacOS.

*) Bugfix: fixed PTR macro compatibility with newer BFD library.

*) Bugfix: auto/cc: use portable 'command -v' instead of 'which'.
   Thanks to Zurab Kvachadze.

Changes with njs 0.9.5                                       13 Jan 2026

nginx modules:

*) Feature: added native module support for QuickJS engine.
   The following directives were added: js_load_http_native_module,
   js_load_stream_native_module.

*) Bugfix: fixed js_body_filter with multiple chunks for QuickJS
   engine.

*) Bugfix: fixed buffer_type inheritance in if blocks for js_body_filter.
   Previously, when js_body_filter was used inside an if block,
   the data parameter received Buffer type instead of the expected
   String type.

*) Bugfix: fixed js_body_filter when data is not in memory.
   Previously, when upstream data was delivered from nginx cache,
   js_body_filter was not able to process it correctly.

*) Bugfix: improved r.subrequest() error handling.
   Fixed a problem of a lost write event when the njs handler
   making r.subrequest() is called from a lua handler as a
   subrequest.

Core:

*) Bugfix: fixed XMLAttr object.
   Pointer to xmlAttr could become invalid when the parent XMLNode
   was modified.

*) Bugfix: fixed XMLNode update.

*) Bugfix: fixed ArrayBuffer with detached buffers.

*) Bugfix: added missing detached array checks.

*) Bugfix: fixed fs.mkdir() and friends.

*) Bugfix: fixed path restoration in fs.mkdir() and friends on
   error.

*) Bugfix: fixed missed allocation check in promise code.

</ChangeLog>
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2026/01/07 08:49:18 wiz Exp $
d3 1
a3 2
DISTNAME=	freenginx-1.28.0
PKGREVISION=	2
@


1.2
log
@*: recursive bump for icu 78.1
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2025/12/25 18:57:20 osa Exp $
d4 1
a4 1
PKGREVISION=	1
@


1.1
log
@www/freenginx: add new port, freenginx stable version 1.28.0
@
text
@d1 1
a1 1
# $NetBSD$
d4 1
@

