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

Last change on this file since 87969 was 86786, checked in by boeyms@…, 8 years ago

Relinquish port maintenance.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.9 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 86786 2011-11-04 05:20:35Z boeyms@macports.org $
3
4PortSystem          1.0
5
6name                nginx
7version             1.0.8
8categories          www mail
9platforms           darwin
10license             BSD
11maintainers         nomaintainer
12
13description         High-performance HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
14long_description    Nginx ("engine x") is a high-performance HTTP(S) server \
15                    and reverse proxy, as well as an IMAP/POP3 proxy server. \
16                    Nginx was written by Igor Sysoev for Rambler.ru, Russia's \
17                    second-most visited website, where it has been running in \
18                    production for over two and a half years. Igor has \
19                    released the source code under a BSD-like license. \
20                    Although still in beta, Nginx is known for its stability, \
21                    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                    http://wiki.nginx.org/images/1/10/:secure_download_module \
28                    http://wiki.nginx.org/images/b/bb/:zip_module \
29                    http://people.freebsd.org/~osa/:redis_module
30
31distfiles           ${name}-${version}${extract.suffix}:nginx
32checksums           ${name}-${version}${extract.suffix} \
33                    rmd160  45d0e0d2c21a18fb2b0a69321e55526fb26ba22e \
34                    sha256  9bde8d054dcdcc6aedcbd87b456049b39ba930bfee284edb15817ab64ec72ba7
35
36depends_lib         \
37                    port:pcre \
38                    port:zlib
39
40patchfiles          patch-auto__install.diff \
41                    patch-conf__nginx.conf.diff
42
43set nginx_confdir   ${prefix}/etc/${name}
44set nginx_logdir    ${prefix}/var/log/${name}
45set nginx_rundir    ${prefix}/var/run/${name}
46set nginx_pidfile   ${nginx_rundir}/${name}.pid
47
48configure.args-append \
49                    --with-cc-opt=\"${configure.cppflags} ${configure.cflags}\" \
50                    --with-ld-opt=\"${configure.ldflags}\" \
51                    --conf-path=${nginx_confdir}/${name}.conf \
52                    --error-log-path=${nginx_logdir}/error.log \
53                    --http-log-path=${nginx_logdir}/access.log \
54                    --pid-path=${nginx_pidfile} \
55                    --lock-path=${nginx_rundir}/${name}.lock \
56                    --http-client-body-temp-path=${nginx_rundir}/client_body_temp \
57                    --http-proxy-temp-path=${nginx_rundir}/proxy_temp \
58                    --http-fastcgi-temp-path=${nginx_rundir}/fastcgi_temp \
59                    --http-uwsgi-temp-path=${nginx_rundir}/uwsgi_temp
60
61default_variants    +ipv6
62universal_variant   no
63
64build.target        build
65destroot.keepdirs   ${destroot}${nginx_logdir} \
66                    ${destroot}${nginx_rundir}
67
68set nginx_conf ${prefix}/etc/${name}/${name}.conf
69post-destroot {
70    delete ${destroot}${nginx_conf}
71}
72pre-activate {
73    # Try to cover for the fact that, in earlier revisions of this port, the
74    # configuration file was installed live instead of an example, in which
75    # case an upgrade will clobber any customisations that a user might have
76    # made :(
77    set nginx_conf_is_registered_to_nginx \
78        [expr {[registry_file_registered ${nginx_conf}] == "${name}"}]
79    set nginx_conf_differs \
80        [catch {exec cmp ${nginx_conf} ${nginx_conf}.example}]
81    if { ${nginx_conf_is_registered_to_nginx} && ${nginx_conf_differs} } {
82        copy ${nginx_conf} ${nginx_conf}.altered
83        ui_msg ""
84        ui_msg "###############################################################"
85        ui_msg "# It appears that you have altered ${nginx_conf},"
86        ui_msg "# and that upgrading or uninstalling your previous installation"
87        ui_msg "# of ${name} will clobber your copy.  It has been copied to"
88        ui_msg "# ${nginx_conf}.altered for preservation when you upgrade or"
89        ui_msg "# uninstall ${name}.  This problem should not occur with future"
90        ui_msg "# upgrades or installations of this port.\n"
91        ui_msg "###############################################################"
92        ui_msg ""
93    }
94}
95
96startupitem.create      yes
97startupitem.executable  ${prefix}/sbin/nginx
98startupitem.pidfile     auto ${nginx_pidfile}
99
100variant dav description {Add WebDAV support to server} {
101    configure.args-append   --with-http_dav_module
102}
103
104variant flv description {Add FLV (Flash Video) streaming support to server} {
105    configure.args-append   --with-http_flv_module
106}
107
108variant mail description {Add IMAP4/POP3 mail proxy support} {
109    configure.args-append   --with-mail
110}
111
112variant ssl description {Add SSL (HTTPS) support to the server, and\
113        also to the mail proxy if that is enabled} {
114    depends_lib-append      port:openssl
115    configure.args-append   --with-http_ssl_module
116    if [variant_isset mail] {
117        configure.args-append   --with-mail_ssl_module
118    }
119}
120
121variant status description {Add /nginx_status support to the server} {
122    configure.args-append   --with-http_stub_status_module
123}
124
125variant ipv6 description {Add support for ipv6} {
126    configure.args-append   --with-ipv6
127}
128
129# This variant has been labelled "perl5" so as to allow users to easily stick
130# with perl 5.x once perl 6.x is released; a "perl6" variant will also be added
131# at that time.
132variant perl5 description {Add perl support to the server directly within\
133        nginx and call perl via SSI} {
134    depends_run-append      path:bin/perl:perl5
135    configure.args-append   --with-http_perl_module \
136                            --with-perl=${prefix}/bin/perl
137}
138
139variant realip description {Using nginx as a backend} {
140    configure.args-append   --with-http_realip_module
141}
142
143variant addition description {Append text to pages} {
144    configure.args-append   --with-http_addition_module
145}
146
147variant substitution description {Replace text in pages} {
148    configure.args-append   --with-http_sub_module
149}
150
151variant gzip_static description {Avoids compressing the same file each\
152        time it is requested} {
153    configure.args-append   --with-http_gzip_static_module
154}
155
156variant google_perftools description {Enable Google Performance Tools\
157        profiling for workers} {
158    depends_lib-append      port:google-perftools
159    configure.args-append   --with-google_perftools_module
160}
161
162variant upload description {Enable Valery Kholodkov's upload module\
163        (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                        md5     2681a6167551830a23336fa41bc539a1 \
170                        sha1    93d6e83e613a0ce2ed057a434b344fa1b6609b47 \
171                        rmd160  5734af837be3fe8ec444a7e5e7f6707118594098
172    configure.args-append   --add-module=${workpath}/${upload_distname}
173}
174
175variant secure_download description {Enable Ngx http secure download \
176        (http://wiki.nginx.org/HttpSecureDownload)} {
177
178    set secure_download_distname Ngx_http_secure_download
179    distfiles-append    ${secure_download_distname}.tar.gz:secure_download_module
180    checksums-append    ${secure_download_distname}.tar.gz \
181                            md5     8d83bfb4853ed76eb22453712c394519
182    configure.args-append   --add-module=${workpath}/${secure_download_distname}
183    depends_lib-append  port:mhash
184}
185
186variant zip description {Enable Ngx zip download module \
187        (http://wiki.nginx.org/NginxNgxZip)} {
188
189    set zip_distname Mod_zip-1.1.4
190    distfiles-append    ${zip_distname}.tar.gz:zip_module
191    checksums-append    ${zip_distname}.tar.gz \
192                            md5     be934138446793ca783ebfcc1a74883d
193    configure.args-append   --add-module=${workpath}/${zip_distname}
194}
195
196variant redis description {Enable Ngx HTTP Redis module} {
197    set redis_filename  ngx_http_redis
198    set redis_version   0.3.1
199    set redis_distname  ${redis_filename}-${redis_version}
200    distfiles-append    ${redis_distname}.tar.gz:redis_module
201    checksums-append    ${redis_distname}.tar.gz \
202                            md5     c731d6ac14b4c8a99fda2c7e89356a8f
203    configure.args-append   --add-module=${workpath}/${redis_distname}
204}
205
206variant geoip description {Enable Ngx http GeoIP module \
207        (http://wiki.nginx.org/HttpGeoIPModule)} {
208
209    configure.args-append  --with-http_geoip_module
210    depends_lib-append  port:libgeoip
211}
212
213variant debug description {Enable debug mode} {
214    configure.args-append   --with-debug
215}
216
217livecheck.type      regex
218livecheck.url       http://trac.nginx.org/nginx/browser/nginx_org/xml/versions.xml?format=txt
219livecheck.regex     "<stable> *(\\d+(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.