| @@ -1,124 +1,123 @@ | | | @@ -1,124 +1,123 @@ |
1 | # $NetBSD: Makefile.common,v 1.12 2017/10/28 10:57:29 adam Exp $ | | 1 | # $NetBSD: Makefile.common,v 1.13 2018/01/26 14:47:47 fhajny Exp $ |
2 | # used by www/nginx/Makefile | | 2 | # used by www/nginx/Makefile |
3 | # used by www/nginx-devel/Makefile | | 3 | # used by www/nginx-devel/Makefile |
4 | | | 4 | |
5 | # Used by both www/nginx and www/nginx-devel | | 5 | # Used by both www/nginx and www/nginx-devel |
6 | # Do *not* add any version-specific data here, any change | | 6 | # Do *not* add any version-specific data here, any change |
7 | # in this file will affect both packages | | 7 | # in this file will affect both packages |
8 | | | 8 | |
9 | CATEGORIES= www | | 9 | CATEGORIES= www |
10 | MASTER_SITES= http://nginx.org/download/ | | 10 | MASTER_SITES= http://nginx.org/download/ |
11 | DISTFILES= ${DEFAULT_DISTFILES} | | 11 | DISTFILES= ${DEFAULT_DISTFILES} |
12 | | | 12 | |
13 | HOMEPAGE= http://nginx.org/ | | 13 | HOMEPAGE= http://nginx.org/ |
14 | COMMENT= Lightweight HTTP server and mail proxy server | | 14 | COMMENT= Lightweight HTTP server and mail proxy server |
15 | LICENSE= 2-clause-bsd | | 15 | LICENSE= 2-clause-bsd |
16 | | | 16 | |
17 | .include "../../mk/bsd.prefs.mk" | | 17 | .include "../../mk/bsd.prefs.mk" |
18 | | | 18 | |
19 | NGINX_USER?= nginx | | 19 | NGINX_USER?= nginx |
20 | NGINX_GROUP?= nginx | | 20 | NGINX_GROUP?= nginx |
21 | NGINX_DATADIR?= ${VARBASE}/db/nginx | | 21 | NGINX_DATADIR?= ${VARBASE}/db/nginx |
22 | NGINX_LOGDIR?= ${VARBASE}/log/nginx | | 22 | NGINX_LOGDIR?= ${VARBASE}/log/nginx |
23 | NGINX_PIDDIR?= ${VARBASE}/run | | 23 | NGINX_PIDDIR?= ${VARBASE}/run |
24 | | | 24 | |
25 | BUILD_DEFS+= NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE | | 25 | BUILD_DEFS+= NGINX_DATADIR NGINX_LOGDIR NGINX_PIDDIR VARBASE |
26 | | | 26 | |
27 | PKG_USERS_VARS+= NGINX_USER | | 27 | PKG_USERS_VARS+= NGINX_USER |
28 | PKG_GROUPS_VARS+= NGINX_GROUP | | 28 | PKG_GROUPS_VARS+= NGINX_GROUP |
29 | PKG_GROUPS= ${NGINX_GROUP} | | 29 | PKG_GROUPS= ${NGINX_GROUP} |
30 | PKG_USERS= ${NGINX_USER}:${NGINX_GROUP} | | 30 | PKG_USERS= ${NGINX_USER}:${NGINX_GROUP} |
31 | | | 31 | |
32 | PKG_GECOS.${NGINX_USER}=NGINX server user | | 32 | PKG_GECOS.${NGINX_USER}=NGINX server user |
33 | PKG_HOME.${NGINX_USER}= ${NGINX_DATADIR} | | 33 | PKG_HOME.${NGINX_USER}= ${NGINX_DATADIR} |
34 | PKG_SHELL.${NGINX_USER}=${NOLOGIN} | | 34 | PKG_SHELL.${NGINX_USER}=${NOLOGIN} |
35 | | | 35 | |
36 | USE_PKGLOCALEDIR= yes | | 36 | USE_PKGLOCALEDIR= yes |
37 | HAS_CONFIGURE= yes | | 37 | HAS_CONFIGURE= yes |
38 | CONFIGURE_ARGS+= --user=${NGINX_USER} | | 38 | CONFIGURE_ARGS+= --user=${NGINX_USER} |
39 | CONFIGURE_ARGS+= --group=${NGINX_GROUP} | | 39 | CONFIGURE_ARGS+= --group=${NGINX_GROUP} |
40 | 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 |
41 | CONFIGURE_ARGS+= --prefix=${PREFIX} | | 41 | CONFIGURE_ARGS+= --prefix=${PREFIX} |
42 | CONFIGURE_ARGS+= --sbin-path=${PREFIX}/sbin | | 42 | CONFIGURE_ARGS+= --sbin-path=${PREFIX}/sbin |
43 | CONFIGURE_ARGS+= --conf-path=${PKG_SYSCONFDIR}/nginx.conf | | 43 | CONFIGURE_ARGS+= --conf-path=${PKG_SYSCONFDIR}/nginx.conf |
44 | CONFIGURE_ARGS+= --pid-path=${NGINX_PIDDIR}/nginx.pid | | 44 | CONFIGURE_ARGS+= --pid-path=${NGINX_PIDDIR}/nginx.pid |
45 | CONFIGURE_ARGS+= --lock-path=${NGINX_DATADIR}/nginx.lock | | 45 | CONFIGURE_ARGS+= --lock-path=${NGINX_DATADIR}/nginx.lock |
46 | CONFIGURE_ARGS+= --error-log-path=${NGINX_LOGDIR}/error.log | | 46 | CONFIGURE_ARGS+= --error-log-path=${NGINX_LOGDIR}/error.log |
47 | CONFIGURE_ARGS+= --http-log-path=${NGINX_LOGDIR}/access.log | | 47 | CONFIGURE_ARGS+= --http-log-path=${NGINX_LOGDIR}/access.log |
48 | 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 |
49 | CONFIGURE_ARGS+= --http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp | | 49 | CONFIGURE_ARGS+= --http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp |
50 | CONFIGURE_ARGS+= --http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp | | 50 | CONFIGURE_ARGS+= --http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp |
51 | | | 51 | |
52 | PKG_SYSCONFSUBDIR= nginx | | 52 | PKG_SYSCONFSUBDIR= nginx |
53 | | | 53 | |
54 | .include "../../www/nginx/options.mk" | | 54 | .include "../../www/nginx/options.mk" |
55 | | | 55 | |
56 | EGDIR= ${PREFIX}/share/examples/nginx | | 56 | EGDIR= ${PREFIX}/share/examples/nginx |
57 | EGFILES+= fastcgi.conf fastcgi_params koi-utf koi-win \ | | 57 | EGFILES+= fastcgi.conf fastcgi_params koi-utf koi-win \ |
58 | mime.types nginx.conf win-utf | | 58 | mime.types nginx.conf win-utf |
59 | | | 59 | |
60 | .for file in ${EGFILES} | | 60 | .for file in ${EGFILES} |
61 | CONF_FILES+= ${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file} | | 61 | CONF_FILES+= ${EGDIR}/conf/${file} ${PKG_SYSCONFDIR}/${file} |
62 | . if !empty(PKG_OPTIONS:Mnaxsi) | | 62 | . if !empty(PKG_OPTIONS:Mnaxsi) |
63 | CONF_FILES+= ${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules | | 63 | CONF_FILES+= ${EGDIR}/conf/naxsi_core.rules ${PKG_SYSCONFDIR}/naxsi_core.rules |
64 | . endif | | 64 | . endif |
65 | .endfor | | 65 | .endfor |
66 | | | 66 | |
67 | RCD_SCRIPTS= nginx | | 67 | RCD_SCRIPTS= nginx |
68 | | | 68 | |
69 | INSTALLATION_DIRS+= ${PKGMANDIR}/man8 sbin share/examples/nginx/conf \ | | 69 | INSTALLATION_DIRS+= ${PKGMANDIR}/man8 sbin share/examples/nginx/conf \ |
70 | share/examples/nginx/html | | 70 | share/examples/nginx/html |
71 | MAKE_DIRS+= ${NGINX_PIDDIR} | | 71 | MAKE_DIRS+= ${NGINX_PIDDIR} |
72 | OWN_DIRS= ${NGINX_LOGDIR} | | 72 | OWN_DIRS= ${NGINX_LOGDIR} |
73 | OWN_DIRS_PERMS+= ${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700 | | 73 | OWN_DIRS_PERMS+= ${NGINX_DATADIR} ${NGINX_USER} ${NGINX_GROUP} 0700 |
74 | | | 74 | |
75 | BUILD_TARGET= build | | 75 | BUILD_TARGET= build |
76 | | | 76 | |
77 | SUBST_CLASSES+= prefix | | 77 | SUBST_CLASSES+= prefix |
78 | SUBST_STAGE.prefix= pre-configure | | 78 | SUBST_STAGE.prefix= pre-configure |
79 | SUBST_FILES.prefix= auto/lib/pcre/conf | | 79 | SUBST_FILES.prefix= auto/lib/pcre/conf |
80 | SUBST_SED.prefix= -e 's,@PREFIX@,${PREFIX},g' | | 80 | SUBST_SED.prefix= -e 's,@PREFIX@,${PREFIX},g' |
81 | | | 81 | |
82 | SUBST_CLASSES+= paths | | 82 | SUBST_CLASSES+= paths |
83 | SUBST_STAGE.paths= pre-configure | | 83 | SUBST_STAGE.paths= pre-configure |
84 | SUBST_FILES.paths= conf/nginx.conf | | 84 | SUBST_FILES.paths= conf/nginx.conf |
85 | SUBST_SED.paths= -e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g' | | 85 | SUBST_SED.paths= -e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g' |
86 | SUBST_SED.paths+= -e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g' | | 86 | SUBST_SED.paths+= -e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g' |
87 | SUBST_SED.paths+= -e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g' | | 87 | SUBST_SED.paths+= -e 's,%%NGINX_PIDDIR%%,${NGINX_PIDDIR},g' |
88 | SUBST_SED.paths+= -e 's,%%NGINX_USER%%,${NGINX_USER},g' | | 88 | SUBST_SED.paths+= -e 's,%%NGINX_USER%%,${NGINX_USER},g' |
89 | SUBST_SED.paths+= -e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g' | | 89 | SUBST_SED.paths+= -e 's,%%NGINX_GROUP%%,${NGINX_GROUP},g' |
90 | | | 90 | |
91 | MESSAGE_SUBST+= NGINX_LOGDIR=${NGINX_LOGDIR} | | 91 | MESSAGE_SUBST+= NGINX_LOGDIR=${NGINX_LOGDIR} |
92 | MESSAGE_SUBST+= NGINX_PIDDIR=${NGINX_PIDDIR} | | 92 | MESSAGE_SUBST+= NGINX_PIDDIR=${NGINX_PIDDIR} |
93 | MESSAGE_SUBST+= NGINX_USER=${NGINX_USER} | | 93 | MESSAGE_SUBST+= NGINX_USER=${NGINX_USER} |
94 | MESSAGE_SUBST+= NGINX_GROUP=${NGINX_GROUP} | | 94 | MESSAGE_SUBST+= NGINX_GROUP=${NGINX_GROUP} |
95 | | | 95 | |
96 | .if ${OPSYS} == "Darwin" | | 96 | .if ${OPSYS} == "Darwin" |
97 | SOEXT= bundle | | 97 | SOEXT= bundle |
98 | .else | | 98 | .else |
99 | SOEXT= so | | 99 | SOEXT= so |
100 | .endif | | 100 | .endif |
101 | PLIST_SUBST+= SOEXT=${SOEXT} | | 101 | PLIST_SUBST+= SOEXT=${SOEXT} |
102 | | | 102 | |
103 | do-install: | | 103 | do-install: |
104 | ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx | | 104 | ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${DESTDIR}${PREFIX}/sbin/nginx |
105 | .for file in ${EGFILES} | | 105 | .for file in ${EGFILES} |
106 | ${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file} | | 106 | ${INSTALL_DATA} ${WRKSRC}/conf/${file} ${DESTDIR}${EGDIR}/conf/${file} |
107 | .endfor | | 107 | .endfor |
108 | ${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html | | 108 | ${INSTALL_DATA} ${WRKSRC}/html/50x.html ${DESTDIR}${EGDIR}/html/50x.html |
109 | ${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html | | 109 | ${INSTALL_DATA} ${WRKSRC}/html/index.html ${DESTDIR}${EGDIR}/html/index.html |
110 | ${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 | | 110 | ${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8 |
111 | .if !empty(PKG_OPTIONS:Mnaxsi) | | 111 | .if !empty(PKG_OPTIONS:Mnaxsi) |
112 | ${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf | | 112 | ${INSTALL_DATA} ${WRKDIR}/${NAXSI_DISTNAME}/naxsi_config/naxsi_core.rules ${DESTDIR}${EGDIR}/conf |
113 | .endif | | 113 | .endif |
114 | .if !empty(PKG_OPTIONS:Mperl) | | 114 | .if !empty(PKG_OPTIONS:Mperl) |
115 | ${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx | | 115 | ${INSTALL_LIB_DIR} ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx |
116 | ${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \ | | 116 | ${INSTALL_LIB} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.${SOEXT} \ |
117 | ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx | | 117 | ${DESTDIR}${PERL5_INSTALLVENDORARCH}/auto/nginx |
118 | ${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \ | | 118 | ${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \ |
119 | ${DESTDIR}${PERL5_INSTALLVENDORARCH} | | 119 | ${DESTDIR}${PERL5_INSTALLVENDORARCH} |
120 | .endif | | 120 | .endif |
121 | | | 121 | |
122 | .include "../../devel/zlib/buildlink3.mk" | | 122 | .include "../../devel/zlib/buildlink3.mk" |
123 | .include "../../mk/bsd.pkg.mk" | | 123 | .include "../../mk/bsd.pkg.mk" |
124 | .include "../../www/nginx/Makefile.cflags" | | | |