| @@ -1,130 +1,132 @@ | | | @@ -1,130 +1,132 @@ |
1 | # $NetBSD: Makefile,v 1.86 2022/07/14 15:13:22 osa Exp $ | | 1 | # $NetBSD: Makefile,v 1.87 2022/07/15 00:41:45 gutteridge Exp $ |
2 | | | 2 | |
3 | DISTNAME= nginx-1.23.0 | | 3 | DISTNAME= nginx-1.23.0 |
4 | PKGNAME= ${DISTNAME:S/-/-devel-/1} | | 4 | PKGNAME= ${DISTNAME:S/-/-devel-/1} |
5 | PKGREVISION= 2 | | 5 | PKGREVISION= 2 |
6 | CATEGORIES= www | | 6 | CATEGORIES= www |
7 | MASTER_SITES= https://nginx.org/download/ | | 7 | MASTER_SITES= https://nginx.org/download/ |
8 | DISTFILES= ${DEFAULT_DISTFILES} | | 8 | DISTFILES= ${DEFAULT_DISTFILES} |
9 | | | 9 | |
10 | MAINTAINER= osa@NetBSD.org | | 10 | MAINTAINER= osa@NetBSD.org |
11 | HOMEPAGE= https://nginx.org/ | | 11 | HOMEPAGE= https://nginx.org/ |
12 | COMMENT= Lightweight HTTP server and mail proxy server | | 12 | COMMENT= Lightweight HTTP server and mail proxy server |
13 | LICENSE= 2-clause-bsd | | 13 | LICENSE= 2-clause-bsd |
14 | | | 14 | |
| | | 15 | CONFLICTS= nginx-[0-9]* |
| | | 16 | |
15 | .include "../../mk/bsd.prefs.mk" | | 17 | .include "../../mk/bsd.prefs.mk" |
16 | | | 18 | |
17 | NGINX_USER?= nginx | | 19 | NGINX_USER?= nginx |
18 | NGINX_GROUP?= nginx | | 20 | NGINX_GROUP?= nginx |
19 | NGINX_DATADIR?= ${VARBASE}/db/nginx | | 21 | NGINX_DATADIR?= ${VARBASE}/db/nginx |
20 | NGINX_LOGDIR?= ${VARBASE}/log/nginx | | 22 | NGINX_LOGDIR?= ${VARBASE}/log/nginx |
21 | NGINX_PIDDIR?= ${VARBASE}/run | | 23 | NGINX_PIDDIR?= ${VARBASE}/run |
22 | | | 24 | |
23 | BUILD_DEFS+= NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE | | 25 | BUILD_DEFS+= NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE |
24 | | | 26 | |
25 | PKG_USERS_VARS+= NGINX_USER | | 27 | PKG_USERS_VARS+= NGINX_USER |
26 | PKG_GROUPS_VARS+= NGINX_GROUP | | 28 | PKG_GROUPS_VARS+= NGINX_GROUP |
27 | PKG_GROUPS= ${NGINX_GROUP} | | 29 | PKG_GROUPS= ${NGINX_GROUP} |
28 | PKG_USERS= ${NGINX_USER}:${NGINX_GROUP} | | 30 | PKG_USERS= ${NGINX_USER}:${NGINX_GROUP} |
29 | | | 31 | |
30 | PKG_GECOS.${NGINX_USER}= NGINX server user | | 32 | PKG_GECOS.${NGINX_USER}= NGINX server user |
31 | PKG_HOME.${NGINX_USER}= ${NGINX_DATADIR} | | 33 | PKG_HOME.${NGINX_USER}= ${NGINX_DATADIR} |
32 | PKG_SHELL.${NGINX_USER}= ${NOLOGIN} | | 34 | PKG_SHELL.${NGINX_USER}= ${NOLOGIN} |
33 | | | 35 | |
34 | USE_PKGLOCALEDIR= yes | | 36 | USE_PKGLOCALEDIR= yes |
35 | HAS_CONFIGURE= yes | | 37 | HAS_CONFIGURE= yes |
36 | CONFIGURE_ARGS+= --user=${NGINX_USER} | | 38 | CONFIGURE_ARGS+= --user=${NGINX_USER} |
37 | CONFIGURE_ARGS+= --group=${NGINX_GROUP} | | 39 | CONFIGURE_ARGS+= --group=${NGINX_GROUP} |
38 | CONFIGURE_ARGS+= --with-ld-opt=-L${PREFIX}/lib\ -Wl,-R${PREFIX}/lib | | 40 | CONFIGURE_ARGS+= --with-ld-opt=-L${PREFIX}/lib\ -Wl,-R${PREFIX}/lib |
39 | CONFIGURE_ARGS+= --prefix=${PREFIX} | | 41 | CONFIGURE_ARGS+= --prefix=${PREFIX} |
40 | CONFIGURE_ARGS+= --sbin-path=${PREFIX}/sbin | | 42 | CONFIGURE_ARGS+= --sbin-path=${PREFIX}/sbin |
41 | CONFIGURE_ARGS+= --conf-path=${PKG_SYSCONFDIR}/nginx.conf | | 43 | CONFIGURE_ARGS+= --conf-path=${PKG_SYSCONFDIR}/nginx.conf |
42 | CONFIGURE_ARGS+= --pid-path=${NGINX_PIDDIR}/nginx.pid | | 44 | CONFIGURE_ARGS+= --pid-path=${NGINX_PIDDIR}/nginx.pid |
43 | CONFIGURE_ARGS+= --lock-path=${NGINX_DATADIR}/nginx.lock | | 45 | CONFIGURE_ARGS+= --lock-path=${NGINX_DATADIR}/nginx.lock |
44 | CONFIGURE_ARGS+= --error-log-path=${NGINX_LOGDIR}/error.log | | 46 | CONFIGURE_ARGS+= --error-log-path=${NGINX_LOGDIR}/error.log |
45 | CONFIGURE_ARGS+= --http-log-path=${NGINX_LOGDIR}/access.log | | 47 | CONFIGURE_ARGS+= --http-log-path=${NGINX_LOGDIR}/access.log |
46 | CONFIGURE_ARGS+= --http-client-body-temp-path=${NGINX_DATADIR}/client_body_temp | | 48 | CONFIGURE_ARGS+= --http-client-body-temp-path=${NGINX_DATADIR}/client_body_temp |
47 | CONFIGURE_ARGS+= --http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp | | 49 | CONFIGURE_ARGS+= --http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp |
48 | CONFIGURE_ARGS+= --http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp | | 50 | CONFIGURE_ARGS+= --http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp |
49 | CONFIGURE_ARGS+= --http-scgi-temp-path=${NGINX_DATADIR}/scgi_temp | | 51 | CONFIGURE_ARGS+= --http-scgi-temp-path=${NGINX_DATADIR}/scgi_temp |
50 | | | 52 | |
51 | PKG_SYSCONFSUBDIR= nginx | | 53 | PKG_SYSCONFSUBDIR= nginx |
52 | | | 54 | |
53 | .include "options.mk" | | 55 | .include "options.mk" |
54 | | | 56 | |
55 | EGDIR= ${PREFIX}/share/examples/nginx | | 57 | EGDIR= ${PREFIX}/share/examples/nginx |
56 | EGFILES+= fastcgi.conf fastcgi_params koi-utf koi-win \ | | 58 | EGFILES+= fastcgi.conf fastcgi_params koi-utf koi-win \ |
57 | mime.types nginx.conf win-utf | | 59 | mime.types nginx.conf win-utf |
58 | | | 60 | |
59 | .for file in ${EGFILES} | | 61 | .for file in ${EGFILES} |
60 | CONF_FILES+= ${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file} | | 62 | CONF_FILES+= ${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file} |
61 | . if !empty(PKG_OPTIONS:Mnaxsi) | | 63 | . if !empty(PKG_OPTIONS:Mnaxsi) |
62 | CONF_FILES+= ${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules | | 64 | CONF_FILES+= ${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules |
63 | . endif | | 65 | . endif |
64 | .endfor | | 66 | .endfor |
65 | | | 67 | |
66 | RCD_SCRIPTS= nginx | | 68 | RCD_SCRIPTS= nginx |
67 | | | 69 | |
68 | INSTALLATION_DIRS+= ${PKGMANDIR}/man8 sbin share/examples/nginx/conf \ | | 70 | INSTALLATION_DIRS+= ${PKGMANDIR}/man8 sbin share/examples/nginx/conf \ |
69 | share/examples/nginx/html | | 71 | share/examples/nginx/html |
70 | MAKE_DIRS+= ${NGINX_PIDDIR} | | 72 | MAKE_DIRS+= ${NGINX_PIDDIR} |
71 | OWN_DIRS= ${NGINX_LOGDIR} | | 73 | OWN_DIRS= ${NGINX_LOGDIR} |
72 | OWN_DIRS_PERMS+= ${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700 | | 74 | OWN_DIRS_PERMS+= ${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700 |
73 | | | 75 | |
74 | BUILD_TARGET= build | | 76 | BUILD_TARGET= build |
75 | | | 77 | |
76 | SUBST_CLASSES+= paths | | 78 | SUBST_CLASSES+= paths |
77 | SUBST_STAGE.paths= pre-configure | | 79 | SUBST_STAGE.paths= pre-configure |
78 | SUBST_FILES.paths= conf/nginx.conf | | 80 | SUBST_FILES.paths= conf/nginx.conf |
79 | SUBST_SED.paths= -e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g' | | 81 | SUBST_SED.paths= -e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g' |
80 | SUBST_SED.paths+= -e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g' | | 82 | SUBST_SED.paths+= -e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g' |
81 | SUBST_SED.paths+= -e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g' | | 83 | SUBST_SED.paths+= -e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g' |
82 | SUBST_SED.paths+= -e 's,%%NGINX_USER%%,${NGINX_USER},g' | | 84 | SUBST_SED.paths+= -e 's,%%NGINX_USER%%,${NGINX_USER},g' |
83 | SUBST_SED.paths+= -e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g' | | 85 | SUBST_SED.paths+= -e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g' |
84 | | | 86 | |
85 | MESSAGE_SUBST+= NGINX_LOGDIR=${NGINX_LOGDIR} | | 87 | MESSAGE_SUBST+= NGINX_LOGDIR=${NGINX_LOGDIR} |
86 | MESSAGE_SUBST+= NGINX_PIDDIR=${NGINX_PIDDIR} | | 88 | MESSAGE_SUBST+= NGINX_PIDDIR=${NGINX_PIDDIR} |
87 | MESSAGE_SUBST+= NGINX_USER=${NGINX_USER} | | 89 | MESSAGE_SUBST+= NGINX_USER=${NGINX_USER} |
88 | MESSAGE_SUBST+= NGINX_GROUP=${NGINX_GROUP} | | 90 | MESSAGE_SUBST+= NGINX_GROUP=${NGINX_GROUP} |
89 | | | 91 | |
90 | .if ${OPSYS} == "Darwin" | | 92 | .if ${OPSYS} == "Darwin" |
91 | SOEXT= bundle | | 93 | SOEXT= bundle |
92 | .else | | 94 | .else |
93 | SOEXT= so | | 95 | SOEXT= so |
94 | .endif | | 96 | .endif |
95 | PLIST_SUBST+= SOEXT=${SOEXT} | | 97 | PLIST_SUBST+= SOEXT=${SOEXT} |
96 | | | 98 | |
97 | post-patch: | | 99 | post-patch: |
98 | .if !empty(PKG_OPTIONS:Mluajit) | | 100 | .if !empty(PKG_OPTIONS:Mluajit) |
99 | (cd ${WRKSRC}/ && patch -p1 <${PATCHDIR}/extra-patch-lua-nginx-module) | | 101 | (cd ${WRKSRC}/ && patch -p1 <${PATCHDIR}/extra-patch-lua-nginx-module) |
100 | .endif | | 102 | .endif |
101 | .if !empty(PKG_OPTIONS:Mnaxsi) | | 103 | .if !empty(PKG_OPTIONS:Mnaxsi) |
102 | (cd ${WRKSRC}/ && patch <${PATCHDIR}/extra-patch-naxsi_runtime.c) | | 104 | (cd ${WRKSRC}/ && patch <${PATCHDIR}/extra-patch-naxsi_runtime.c) |
103 | .endif | | 105 | .endif |
104 | | | 106 | |
105 | do-install: | | 107 | do-install: |
106 | ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx | | 108 | ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx |
107 | .for file in ${EGFILES} | | 109 | .for file in ${EGFILES} |
108 | ${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file} | | 110 | ${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file} |
109 | .endfor | | 111 | .endfor |
110 | ${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html | | 112 | ${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html |
111 | ${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html | | 113 | ${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html |
112 | ${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 | | 114 | ${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 |
113 | .if !empty(PKG_OPTIONS:Mnaxsi) | | 115 | .if !empty(PKG_OPTIONS:Mnaxsi) |
114 | ${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf | | 116 | ${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf |
115 | .endif | | 117 | .endif |
116 | .if !empty(PKG_OPTIONS:Mperl) | | 118 | .if !empty(PKG_OPTIONS:Mperl) |
117 | ${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx | | 119 | ${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx |
118 | ${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \ | | 120 | ${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \ |
119 | ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx | | 121 | ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx |
120 | ${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \ | | 122 | ${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \ |
121 | ${DESTDIR}${PERL5_INSTALLVENDORARCH} | | 123 | ${DESTDIR}${PERL5_INSTALLVENDORARCH} |
122 | .endif | | 124 | .endif |
123 | .if !empty(PKG_OPTIONS:Mdso) | | 125 | .if !empty(PKG_OPTIONS:Mdso) |
124 | ${INSTALL_LIB_DIR} ${DESTDIR}${PREFIX}/libexec/nginx | | 126 | ${INSTALL_LIB_DIR} ${DESTDIR}${PREFIX}/libexec/nginx |
125 | (cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \ | | 127 | (cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \ |
126 | -exec ${INSTALL_PROGRAM} {} ${DESTDIR}${PREFIX}/libexec/nginx \;) | | 128 | -exec ${INSTALL_PROGRAM} {} ${DESTDIR}${PREFIX}/libexec/nginx \;) |
127 | .endif | | 129 | .endif |
128 | | | 130 | |
129 | .include "../../devel/zlib/buildlink3.mk" | | 131 | .include "../../devel/zlib/buildlink3.mk" |
130 | .include "../../mk/bsd.pkg.mk" | | 132 | .include "../../mk/bsd.pkg.mk" |