pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/nginx-devel www/nginx-devel: decouple from www/nginx



details:   https://anonhg.NetBSD.org/pkgsrc/rev/53b822cca4d8
branches:  trunk
changeset: 375596:53b822cca4d8
user:      osa <osa%pkgsrc.org@localhost>
date:      Thu Mar 17 03:03:14 2022 +0000

description:
www/nginx-devel: decouple from www/nginx

It's not a typical practice in pkgsrc to share options.mk.  Also, it's
not easy to build both www/nginx and www/nginx-devel with a different
set of options.  So, let's decouple www/nginx-devel from www/nginx.

>From now the following option needs to be specified to build
www/nginx-devel with a specific options: PKG_OPTIONS.nginx-devel.

While I'm here add support to build package with devel/pcre2. Please
note: some third-party modules, such as naxsi and luajit, are not
compatible yet with devel/pcre2, so let's keep pcre option as a
suggested one.

Bump PKGREVISION.

diffstat:

 www/nginx-devel/Makefile        |    6 +-
 www/nginx-devel/Makefile.common |  123 ++++++++++++++
 www/nginx-devel/options.mk      |  345 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 471 insertions(+), 3 deletions(-)

diffs (truncated from 492 to 300 lines):

diff -r 3b210177a86f -r 53b822cca4d8 www/nginx-devel/Makefile
--- a/www/nginx-devel/Makefile  Thu Mar 17 02:37:49 2022 +0000
+++ b/www/nginx-devel/Makefile  Thu Mar 17 03:03:14 2022 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.74 2022/03/14 02:49:09 osa Exp $
+# $NetBSD: Makefile,v 1.75 2022/03/17 03:03:14 osa Exp $
 
 DISTNAME=      nginx-1.21.6
 
 MAINTAINER=    osa%NetBSD.org@localhost
 
-PKGREVISION=   4 
-.include "../../www/nginx/Makefile.common"
+PKGREVISION=   5 
+.include "../../www/nginx-devel/Makefile.common"
 .include "../../mk/bsd.pkg.mk"
diff -r 3b210177a86f -r 53b822cca4d8 www/nginx-devel/Makefile.common
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/nginx-devel/Makefile.common   Thu Mar 17 03:03:14 2022 +0000
@@ -0,0 +1,123 @@
+# $NetBSD: Makefile.common,v 1.1 2022/03/17 03:03:14 osa Exp $
+# used by www/nginx/Makefile
+# used by www/nginx-devel/Makefile
+
+# Used by both www/nginx and www/nginx-devel
+# Do *not* add any version-specific data here, any change
+# in this file will affect both packages
+
+CATEGORIES=    www
+MASTER_SITES=  http://nginx.org/download/
+DISTFILES=     ${DEFAULT_DISTFILES}
+
+HOMEPAGE=      https://nginx.org/
+COMMENT=       Lightweight HTTP server and mail proxy server
+LICENSE=       2-clause-bsd
+
+.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\ -Wl,-R${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
+
+PKG_SYSCONFSUBDIR=     nginx
+
+.include "../../www/nginx-devel/options.mk"
+
+EGDIR=                 ${PREFIX}/share/examples/nginx
+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:Mnaxsi)
+CONF_FILES+=   ${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules
+.  endif
+.endfor
+
+RCD_SCRIPTS=           nginx
+
+INSTALLATION_DIRS+=    ${PKGMANDIR}/man8 sbin share/examples/nginx/conf \
+                       share/examples/nginx/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}
+
+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:Mnaxsi)
+       ${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf
+.endif
+.if !empty(PKG_OPTIONS:Mperl)
+       ${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:Mdso)
+       ${INSTALL_LIB_DIR} ${DESTDIR}${PREFIX}/libexec/nginx
+       (cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \
+               -exec ${INSTALL_PROGRAM} {} ${DESTDIR}${PREFIX}/libexec/nginx \;)
+.endif
+
+.include "../../devel/zlib/buildlink3.mk"
diff -r 3b210177a86f -r 53b822cca4d8 www/nginx-devel/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/nginx-devel/options.mk        Thu Mar 17 03:03:14 2022 +0000
@@ -0,0 +1,345 @@
+# $NetBSD: options.mk,v 1.1 2022/03/17 03:03:14 osa Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.nginx-devel
+PKG_SUPPORTED_OPTIONS= array-var auth-request cache-purge dav debug
+PKG_SUPPORTED_OPTIONS+=        dso echo encrypted-session flv form-input
+PKG_SUPPORTED_OPTIONS+=        geoip geoip2 gtools gzip headers-more http2
+PKG_SUPPORTED_OPTIONS+=        image-filter luajit mail-proxy memcache
+PKG_SUPPORTED_OPTIONS+=        naxsi njs pcre pcre2 perl push realip rtmp
+PKG_SUPPORTED_OPTIONS+=        secure-link set-misc slice ssl status
+PKG_SUPPORTED_OPTIONS+=        stream-ssl-preread sub uwsgi
+PKG_SUGGESTED_OPTIONS= pcre ssl
+
+PKG_OPTIONS_LEGACY_OPTS+=      v2:http2
+
+PLIST_VARS+=           arrayvar cprg dav dso echo encses forminput geoip2
+PLIST_VARS+=           headmore imagefilter lua mail naxsi nchan ndk njs
+PLIST_VARS+=           perl rtmp setmisc stream uwsgi
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mdso)
+CONFIGURE_ARGS+=       --modules-path=${PREFIX}/libexec/nginx
+_addbasemod=           =dynamic
+_addextmod=            add-dynamic-module
+PLIST.dso=             yes
+.else
+_addextmod=            add-module
+.endif
+
+# documentation says naxsi must be the first module
+.if !empty(PKG_OPTIONS:Mnaxsi) || make(makesum) || make(mdi) || make(distclean)
+NAXSI_VERSION=                 1.3
+NAXSI_DISTNAME=                        naxsi-${NAXSI_VERSION}
+NAXSI_DISTFILE=                        ${NAXSI_DISTNAME}.tar.gz
+SITES.${NAXSI_DISTFILE}=       -${MASTER_SITE_GITHUB:=nbs-system/naxsi/archive/}${NAXSI_VERSION}.tar.gz
+DISTFILES+=                    ${NAXSI_DISTFILE}
+PLIST.naxsi=                   yes
+DSO_EXTMODS+=                  naxsi
+NAXSI_SUBDIR=                  /naxsi_src
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CONFIGURE_ARGS+=       --with-debug
+.endif
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-mail_ssl_module
+CONFIGURE_ARGS+=       --with-http_ssl_module
+SUBST_CLASSES+=                fix-ssl
+SUBST_STAGE.fix-ssl=   pre-configure
+SUBST_FILES.fix-ssl=   auto/lib/openssl/conf
+SUBST_SED.fix-ssl=     -e 's,/usr/pkg,${BUILDLINK_PREFIX.openssl},g'
+SUBST_NOOP_OK.fix-ssl= yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mpcre) && empty(PKG_OPTIONS:Mpcre2)
+.include "../../devel/pcre/buildlink3.mk"
+CONFIGURE_ARGS+=       --without-pcre2
+SUBST_CLASSES+=                fix-pcre
+SUBST_STAGE.fix-pcre=  pre-configure
+SUBST_FILES.fix-pcre=  auto/lib/pcre/conf
+SUBST_SED.fix-pcre=    -e 's,/usr/pkg,${BUILDLINK_PREFIX.pcre},g'
+SUBST_NOOP_OK.fix-pcre=        yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mpcre2)
+.include "../../devel/pcre2/buildlink3.mk"
+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
+.endif
+
+.if empty(PKG_OPTIONS:Mpcre) || empty(PKG_OPTIONS:Mpcre2)
+CONFIGURE_ARGS+=       --without-pcre
+CONFIGURE_ARGS+=       --without-http_rewrite_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mdav) || make(makesum) || make(mdi) || make(distclean)
+DAV_VERSION=           3.0.0
+DAV_DISTNAME=          nginx-dav-ext-module-3.0.0
+DAV_DISTFILE=          ${DAV_DISTNAME}.tar.gz
+SITES.${DAV_DISTFILE}= -${MASTER_SITE_GITHUB:=arut/nginx-dav-ext-module/archive/}v${DAV_VERSION}.tar.gz
+DISTFILES+=            ${DAV_DISTFILE}
+CONFIGURE_ARGS+=       --with-http_dav_module
+DSO_EXTMODS+=          dav
+PLIST.dav=             yes
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+SUBST_CLASSES+=                fix-xslt
+SUBST_STAGE.fix-xslt=  pre-configure
+SUBST_FILES.fix-xslt=  auto/lib/libxslt/conf
+SUBST_SED.fix-xslt=    -e 's,/usr/pkg,${BUILDLINK_PREFIX.libxslt},g'
+SUBST_NOOP_OK.fix-xslt=        yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mflv)
+CONFIGURE_ARGS+=       --with-http_flv_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mgeoip)
+.include "../../net/GeoIP/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-http_geoip_module
+SUBST_CLASSES+=                fix-geo
+SUBST_STAGE.fix-geo=   pre-configure
+SUBST_FILES.fix-geo=   auto/lib/geoip/conf
+SUBST_SED.fix-geo=     -e 's,/usr/pkg,${BUILDLINK_PREFIX.GeoIP},g'
+SUBST_NOOP_OK.fix-geo= yes
+.endif
+
+.if !empty(PKG_OPTIONS:Mhttp2)
+CONFIGURE_ARGS+=       --with-http_v2_module
+.endif
+
+.if !empty(PKG_OPTIONS:Msub)
+CONFIGURE_ARGS+=       --with-http_sub_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mgtools)
+CONFIGURE_ARGS+=       --with-google_perftools_module
+.include "../../devel/gperftools/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mmail-proxy)
+DSO_BASEMODS+=         mail
+PLIST.mail=            yes
+.endif
+
+.if empty(PKG_OPTIONS:Mmemcache)
+CONFIGURE_ARGS+=       --without-http_memcached_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mrealip)
+CONFIGURE_ARGS+=       --with-http_realip_module
+.endif
+
+# NDK must be added once and before 3rd party modules needing it
+.for mod in luajit set-misc array-var form-input encrypted-session
+.  if !defined(NEED_NDK) && !empty(PKG_OPTIONS:M${mod}:O)
+FIRST_DSO_EXTMODS+=    ndk
+NEED_NDK=              yes
+PLIST.ndk=             yes
+.  endif
+.endfor
+.if defined(NEED_NDK) || make(makesum) || make(mdi) || make(distclean)
+NDK_VERSION=           0.3.1
+NDK_DISTNAME=          ngx_devel_kit-${NDK_VERSION}
+NDK_DISTFILE=          ${NDK_DISTNAME}.tar.gz
+SITES.${NDK_DISTFILE}= -${MASTER_SITE_GITHUB:=simpl/ngx_devel_kit/archive/}v${NDK_VERSION}.tar.gz
+DISTFILES+=            ${NDK_DISTFILE}
+.endif



Home | Main Index | Thread Index | Old Index