aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorosa <osa@FreeBSD.org>2007-08-23 18:43:49 +0800
committerosa <osa@FreeBSD.org>2007-08-23 18:43:49 +0800
commit93157bcd82f867c1b2aacd55127e17e5f63e6101 (patch)
tree0f84f7323b9faf5724f64d73d19ad9377038f2a4 /www
parent494d73766ca563356db0d90ac14361310de35d1c (diff)
downloadfreebsd-ports-graphics-93157bcd82f867c1b2aacd55127e17e5f63e6101.tar.gz
freebsd-ports-graphics-93157bcd82f867c1b2aacd55127e17e5f63e6101.tar.zst
freebsd-ports-graphics-93157bcd82f867c1b2aacd55127e17e5f63e6101.zip
OPTIONify. (*)
Add more switches for built-in modules. Submitted by: Ilya Pizik aka polzun at scar dot jinr dot ru (*) Merge to www/nginx after: 2 weeks
Diffstat (limited to 'www')
-rw-r--r--www/nginx-devel/Makefile102
1 files changed, 75 insertions, 27 deletions
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile
index ae0f2c6c277..e669c077aa6 100644
--- a/www/nginx-devel/Makefile
+++ b/www/nginx-devel/Makefile
@@ -16,16 +16,29 @@ PKGNAMESUFFIX= -devel
MAINTAINER= osa@FreeBSD.org
COMMENT= Robust and small WWW server
+OPTIONS= DEBUG "Enable nginx debugging" off \
+ HTTP_MODULE "Enable HTTP module" on \
+ HTTP_ADDITION_MODULE "Enable http_addition module" off \
+ HTTP_DAV_MODULE "Enable http_webdav module" off \
+ HTTP_FLV_MODULE "Enable http_flv module" off \
+ HTTP_PERL_MODULE "Enable http_perl module" off \
+ HTTP_REALIP_MODULE "Enable http_realip module" off \
+ HTTP_REWRITE_MODULE "Enable http_rewrite module" on \
+ HTTP_SSL_MODULE "Enable http_ssl module" off \
+ HTTP_STATUS_MODULE "Enable http_stub_status module" on \
+ HTTP_SUB_MODULE "Enable http_sub module" off \
+ MAIL_MODULE "Enable IMAP4/POP3/SMTP proxy module" off \
+ MAIL_SSL_MODULE "Enable mail_ssl module" off \
+ WWW "Enable html sample files" on
+
+.include <bsd.port.pre.mk>
+
NGINX_VARDIR?= /var
NGINX_LOGDIR?= ${NGINX_VARDIR}/log
NGINX_RUNDIR?= ${NGINX_VARDIR}/run
NGINX_TMPDIR?= ${NGINX_VARDIR}/tmp/nginx
HTTP_PORT?= 80
-.if defined(WITH_PERL_MODULE)
-USE_PERL5= yes
-.endif
-
CONFLICTS?= nginx-0.5.*
USE_RC_SUBR= nginx.sh
HAS_CONFIGURE= yes
@@ -35,36 +48,58 @@ CONFIGURE_ARGS+=--prefix=${PREFIX}/etc/nginx \
--conf-path=${PREFIX}/etc/nginx/nginx.conf \
--sbin-path=${PREFIX}/sbin/nginx \
--pid-path=${NGINX_RUNDIR}/nginx.pid \
- --http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \
- --http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \
- --http-fastcgi-temp-path=${NGINX_TMPDIR}/fastcgi_temp \
- --http-log-path=${NGINX_LOGDIR}/nginx-access.log \
--error-log-path=${NGINX_LOGDIR}/nginx-error.log \
- --with-http_stub_status_module \
--user=${WWWOWN} --group=${WWWGRP}
+.if defined(WITHOUT_HTTP_MODULE) && defined(WITHOUT_MAIL_MODULE)
+IGNORE= requires at least HTTP_MODULE or MAIL_MODULE to \
+ be defined. Please 'make config' again
+.endif
+
.if defined(WITH_DEBUG)
CFLAGS+= -g -DNGX_DEBUG_MALLOC
CONFIGURE_ARGS+=--with-debug
STRIP= #do not strip if nginx with debug information
.endif
-.if defined(WITH_OPENSSL_MODULE)
-NGINX_OPENSSL= yes
-CONFIGURE_ARGS+=--with-http_ssl_module
-.endif
+.if defined(WITH_HTTP_MODULE)
+CONFIGURE_ARGS+=--http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \
+ --http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \
+ --http-fastcgi-temp-path=${NGINX_TMPDIR}/fastcgi_temp \
+ --http-log-path=${NGINX_LOGDIR}/nginx-access.log
-.if defined(WITH_ADDITION_MODULE)
+.if defined(WITH_HTTP_ADDITION_MODULE)
CONFIGURE_ARGS+=--with-http_addition_module
.endif
-.if defined(WITH_MAIL_MODULE)
+.if defined(WITH_HTTP_DAV_MODULE)
+CONFIGURE_ARGS+=--with-http_dav_module
+.endif
+
+.if defined(WITH_HTTP_FLV_MODULE)
+CONFIGURE_ARGS+=--with-http_flv_module
+.endif
+
+.if defined(WITH_HTTP_PERL_MODULE)
+CONFIGURE_ARGS+=--with-http_perl_module
+USE_PERL5= yes
+.endif
+
+.if defined(WITH_HTTP_REALIP_MODULE)
+CONFIGURE_ARGS+=--with-http_realip_module
+.endif
+
+.if defined(WITH_HTTP_SSL_MODULE)
NGINX_OPENSSL= yes
-CONFIGURE_ARGS+=--with-mail --with-mail_ssl_module
+CONFIGURE_ARGS+=--with-http_ssl_module
.endif
-.if defined(NGINX_OPENSSL)
-USE_OPENSSL= yes
+.if defined(WITH_HTTP_STATUS_MODULE)
+CONFIGURE_ARGS+=--with-http_stub_status_module
+.endif
+
+.if defined(WITH_HTTP_SUB_MODULE)
+CONFIGURE_ARGS+=--with-http_sub_module
.endif
.if defined(WITHOUT_HTTP_REWRITE_MODULE) || defined(WITHOUT_PCRE)
@@ -75,14 +110,27 @@ CONFIGURE_ARGS+=--without-http_rewrite_module \
LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre
.endif
-.if defined(WITH_PERL_MODULE)
-CONFIGURE_ARGS+=--with-http_perl_module
+.if defined(WITH_WWW)
+PLIST_SUB+= WWWDATA=""
+.else
+PLIST_SUB+= WWWDATA="@comment "
.endif
-.if defined(WITHOUT_WWW)
-PLIST_SUB+= WWWDATA="@comment "
.else
-PLIST_SUB+= WWWDATA=""
+CONFIGURE_ARGS+=--without-http
+PLIST_SUB+= WWWDATA="@comment "
+.endif # WITH_HTTP_MODULE
+
+.if defined(WITH_MAIL_MODULE)
+CONFIGURE_ARGS+=--with-mail
+.if defined(WITH_MAIL_SSL_MODULE)
+NGINX_OPENSSL= yes
+CONFIGURE_ARGS+=--with-mail_ssl_module --with-http_ssl_module
+.endif
+.endif # WITH_MAIL_MODULE
+
+.if defined(NGINX_OPENSSL)
+.include "${PORTSDIR}/Mk/bsd.openssl.mk"
.endif
PLIST_SUB+= NGINX_TMPDIR=${NGINX_TMPDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
@@ -107,7 +155,7 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/conf/${i} ${PREFIX}/etc/nginx
${INSTALL_DATA} ${WRKSRC}/conf/${i} ${PREFIX}/etc/nginx/${i}-dist
.endfor
-.if !defined(WITHOUT_WWW)
+.if defined(WITH_HTTP_MODULE) && defined(WITH_WWW)
${MKDIR} ${PREFIX}/www/nginx-dist
.for i in index.html 50x.html
${INSTALL_DATA} ${WRKSRC}/html/${i} ${PREFIX}/www/nginx-dist
@@ -117,7 +165,7 @@ do-install:
${LN} -sf ${PREFIX}/www/nginx-dist ${PREFIX}/www/nginx
.endif
-.if defined(WITH_PERL_MODULE)
+.if defined(WITH_HTTP_MODULE) && defined(WITH_HTTP_PERL_MODULE)
${MKDIR} ${SITE_PERL}/${PERL_ARCH}/auto/nginx
${INSTALL_PROGRAM} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so \
${SITE_PERL}/${PERL_ARCH}/auto/nginx
@@ -128,11 +176,11 @@ do-install:
.endif
post-install:
-.if defined(WITH_PERL_MODULE)
+.if defined(WITH_HTTP_MODULE) && defined(WITH_HTTP_PERL_MODULE)
${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx/nginx.so >> ${TMPPLIST}
${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx/nginx.bs >> ${TMPPLIST}
${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/nginx.pm >> ${TMPPLIST}
${ECHO_CMD} @dirrm ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx >> ${TMPPLIST}
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>