source: trunk/dports/www/nginx/Portfile @ 92300

Last change on this file since 92300 was 92300, checked in by cal@…, 5 years ago

nginx: Make sure all config files are moved to $name.example, fix build with +perl5, #31004, #34188

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 92300 2012-04-24 19:35:57Z cal@macports.org $
3
4PortSystem          1.0
5
6name                nginx
7version             1.2.0
8revision            1
9categories          www mail
10platforms           darwin
11license             BSD
12maintainers         cal openmaintainer
13
14description         High-performance HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
15long_description    \
16    Nginx ("engine x") is a high-performance HTTP(S) server and reverse proxy, \
17    as well as an IMAP/POP3 proxy server. Nginx was written by Igor Sysoev for \
18    Rambler.ru, Russia's second-most visited website, where it has been running \
19    in production for over two and a half years. Igor has released the source \
20    code under a BSD-like license. Although still in beta, Nginx is known for \
21    its stability, rich feature set, simple configuration, and low resource \
22    consumption.
23
24homepage            http://nginx.org/
25master_sites        http://nginx.org/download:nginx \
26                    http://www.grid.net.ru/nginx/download/:upload_module \
27                    googlecode:mod-zip:zip_module \
28                    http://people.freebsd.org/~osa/:redis_module
29
30distfiles           ${name}-${version}${extract.suffix}:nginx
31checksums           ${name}-${version}${extract.suffix} \
32                    rmd160  b2dc5e6cd7f436e56d1bab7cfcde64955f38c11f \
33                    sha256  ac06b3aa55bf4f634b7e779272685536607183e8669809ce497151e47e518f2d \
34
35depends_lib         port:pcre \
36                    port:zlib
37
38patchfiles          patch-auto__install.diff \
39                    patch-conf__nginx.conf.diff
40
41set nginx_confdir   ${prefix}/etc/${name}
42set nginx_logdir    ${prefix}/var/log/${name}
43set nginx_rundir    ${prefix}/var/run/${name}
44set nginx_pidfile   ${nginx_rundir}/${name}.pid
45set nginx_all_confs {fastcgi.conf fastcgi_params mime.types nginx.conf scgi_params uwsgi_params}
46
47configure.args-append \
48                    --with-cc-opt=\"${configure.cppflags} ${configure.cflags}\" \
49                    --with-ld-opt=\"${configure.ldflags}\" \
50                    --conf-path=${nginx_confdir}/${name}.conf \
51                    --error-log-path=${nginx_logdir}/error.log \
52                    --http-log-path=${nginx_logdir}/access.log \
53                    --pid-path=${nginx_pidfile} \
54                    --lock-path=${nginx_rundir}/${name}.lock \
55                    --http-client-body-temp-path=${nginx_rundir}/client_body_temp \
56                    --http-proxy-temp-path=${nginx_rundir}/proxy_temp \
57                    --http-fastcgi-temp-path=${nginx_rundir}/fastcgi_temp \
58                    --http-uwsgi-temp-path=${nginx_rundir}/uwsgi_temp \
59                    --with-ipv6
60
61# remove --disable-dependency-tracking
62configure.universal_args
63
64build.target        build
65destroot.keepdirs   ${destroot}${nginx_logdir} \
66                    ${destroot}${nginx_rundir}
67
68post-destroot {
69    foreach conf ${nginx_all_confs} {
70        set conf_target "${destroot}${nginx_confdir}/${conf}.example"
71        if {![file exists "${conf_target}"]} {
72            file rename "${destroot}${nginx_confdir}/${conf}" "${destroot}${nginx_confdir}/${conf}.example"
73        } else {
74            file delete "${destroot}${nginx_confdir}/${conf}"
75        }
76    }
77    file mkdir ${destroot}${prefix}/share/nginx
78    file rename ${destroot}${prefix}/html ${destroot}${prefix}/share/nginx
79}
80
81startupitem.create      yes
82startupitem.pidfile     auto ${nginx_pidfile}
83startupitem.executable  ${prefix}/sbin/nginx
84
85variant addition description {Append text to pages} {
86    configure.args-append   --with-http_addition_module
87}
88
89variant dav description {Add WebDAV support to server} {
90    configure.args-append   --with-http_dav_module
91}
92
93variant degradation description {Allow to return 204 or 444 code for some locations on low memory condition} {
94    configure.args-append   --with-http_degradation_module
95}
96
97variant flv description {Add FLV (Flash Video) streaming support to server} {
98    configure.args-append   --with-http_flv_module
99}
100
101variant geoip description {Enable Ngx http GeoIP module (http://wiki.nginx.org/HttpGeoIPModule)} {
102    configure.args-append   --with-http_geoip_module
103    depends_lib-append      port:libgeoip
104}
105
106variant google_perftools description {Enable Google Performance Tools profiling for workers} {
107    configure.args-append   --with-google_perftools_module
108    depends_lib-append      port:google-perftools
109}
110
111variant gzip_static description {Avoids compressing the same file each time it is requested} {
112    configure.args-append   --with-http_gzip_static_module
113}
114
115variant image_filter description {Transform images with libgd} {
116    configure.args-append   --with-http_image_filter_module
117    depends_lib-append      port:gd2
118}
119
120variant mail description {Add IMAP4/POP3 mail proxy support} {
121    configure.args-append   --with-mail
122    if {[variant_isset ssl]} {
123        configure.args-append   --with-mail_ssl_module
124    }
125}
126
127variant mp4 description {Enables mp4 streaming with seeking ability} {
128    configure.args-append   --with-http_mp4_module
129}
130
131variant perl5 description {Add perl support to the server directly within nginx and call perl via SSI} {
132    depends_run-append      path:bin/perl:perl5
133    patchfiles-append       patch-perl_bool.diff
134    configure.args-append   --with-http_perl_module \
135                            --with-perl=${prefix}/bin/perl
136}
137
138variant random_index description {Randomize directory indexes} {
139    configure.args-append   --with-http_random_index_module
140}
141
142variant realip description {For using nginx as backend} {
143    configure.args-append   --with-http_realip_module
144}
145
146variant secure_link description {Protect pages with a secret key} {
147    configure.args-append   --with-http_secure_link_module
148}
149
150variant ssl description {Add SSL (HTTPS) support to the server, and also to the mail proxy if that is enabled} {
151    configure.args-append   --with-http_ssl_module
152    depends_lib-append      port:openssl
153}
154
155variant status description {Add /nginx_status support to the server} {
156    configure.args-append   --with-http_stub_status_module
157}
158
159variant substitution description {Replace text in pages} {
160    configure.args-append   --with-http_sub_module
161}
162
163variant upload description {Enable Valery Kholodkov's upload module (http://grid.net.ru/nginx/upload.en.html)} {
164    set upload_filename     nginx_upload_module
165    set upload_version      2.2.0
166    set upload_distname     ${upload_filename}-${upload_version}
167    distfiles-append        ${upload_distname}.tar.gz:upload_module
168    checksums-append        ${upload_distname}.tar.gz \
169                            rmd160  5734af837be3fe8ec444a7e5e7f6707118594098 \
170                            sha256  b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805
171    configure.args-append   --add-module=${workpath}/${upload_distname}
172}
173
174variant xslt description {Post-process pages with XSLT} {
175    configure.args-append   --with-http_xslt_module
176}
177
178variant zip description {Enable Ngx zip download module \
179        (http://code.google.com/p/mod-zip/)} {
180
181    set zip_distname        mod_zip-1.1.6
182    distfiles-append        ${zip_distname}.tar.gz:zip_module
183    checksums-append        ${zip_distname}.tar.gz \
184                            rmd160  17a465d87b8e1ba71bdd6ad40e20d21cc7dcd434 \
185                            sha256  d30546b4be8308c721df0240ebc38c474c6b577381a110321eded6dbed5104b1
186    configure.args-append   --add-module=${workpath}/${zip_distname}
187}
188
189variant redis description {Enable Ngx HTTP Redis module} {
190    set redis_filename      ngx_http_redis
191    set redis_version       0.3.6
192    set redis_distname      ${redis_filename}-${redis_version}
193    distfiles-append        ${redis_distname}.tar.gz:redis_module
194    checksums-append        ${redis_distname}.tar.gz \
195                            rmd160  0d1de19ce1ae8b9b7fcd9693908403e613f5391d \
196                            sha256  9e5d8c0f1317a6910710c94d27f9aca4968c48ee1de271e5034525a1e9b6c70e
197    configure.args-append   --add-module=${workpath}/${redis_distname}
198}
199
200livecheck.type      regex
201livecheck.url       http://trac.nginx.org/nginx/browser/nginx_org/xml/versions.xml?format=txt
202livecheck.regex     "<stable> *(\\d+(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.