1 | # $Id: Portfile 68367 2010-06-02 05:41:28Z ryandesign@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name nginx-devel |
---|
6 | version 0.8.50 |
---|
7 | categories www mail |
---|
8 | platforms darwin |
---|
9 | maintainers boeyms openmaintainer |
---|
10 | description High-performance HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server |
---|
11 | long_description Nginx ("engine x") is a high-performance HTTP(S) server \ |
---|
12 | and reverse proxy, as well as an IMAP/POP3 proxy server. \ |
---|
13 | Nginx was written by Igor Sysoev for Rambler.ru, Russia's \ |
---|
14 | second-most visited website, where it has been running in \ |
---|
15 | production for over two and a half years. Igor has \ |
---|
16 | released the source code under a BSD-like license. \ |
---|
17 | Although still in beta, Nginx is known for its stability, \ |
---|
18 | rich feature set, simple configuration, and low resource \ |
---|
19 | consumption. |
---|
20 | homepage http://nginx.net/ |
---|
21 | master_sites http://sysoev.ru/nginx:nginx \ |
---|
22 | http://www.grid.net.ru/nginx/download/:upload_module \ |
---|
23 | http://wiki.nginx.org/images/1/10/:secure_download_module \ |
---|
24 | http://wiki.nginx.org/images/b/bb/:zip_module \ |
---|
25 | http://people.freebsd.org/~osa/:redis_module |
---|
26 | distfiles nginx-${version}${extract.suffix}:nginx |
---|
27 | checksums nginx-${version}${extract.suffix} \ |
---|
28 | md5 c730e35c9b14c6a19ff502c9082d1567 \ |
---|
29 | sha1 6c293943fca334d78572ccacdab5d170ba2e18b3 \ |
---|
30 | rmd160 b65ecc1a5a09e7897fcb6628272a8fb6fc2c2b18 |
---|
31 | worksrcdir nginx-${version} |
---|
32 | |
---|
33 | depends_lib port:pcre port:zlib |
---|
34 | |
---|
35 | patchfiles patch-auto__install.diff patch-conf__nginx.conf.diff |
---|
36 | |
---|
37 | set nginx_confdir ${prefix}/etc/${name} |
---|
38 | set nginx_logdir ${prefix}/var/log/${name} |
---|
39 | set nginx_rundir ${prefix}/var/run/${name} |
---|
40 | |
---|
41 | set nginx_pidfile ${nginx_rundir}/${name}.pid |
---|
42 | |
---|
43 | configure.args-append \ |
---|
44 | --with-cc-opt=\"${configure.cppflags} ${configure.cflags}\" \ |
---|
45 | --with-ld-opt=\"${configure.ldflags}\" \ |
---|
46 | --conf-path=${nginx_confdir}/${name}.conf \ |
---|
47 | --error-log-path=${nginx_logdir}/error.log \ |
---|
48 | --http-log-path=${nginx_logdir}/access.log \ |
---|
49 | --pid-path=${nginx_pidfile} \ |
---|
50 | --lock-path=${nginx_rundir}/${name}.lock \ |
---|
51 | --http-client-body-temp-path=${nginx_rundir}/client_body_temp \ |
---|
52 | --http-proxy-temp-path=${nginx_rundir}/proxy_temp \ |
---|
53 | --http-fastcgi-temp-path=${nginx_rundir}/fastcgi_temp |
---|
54 | |
---|
55 | universal_variant no |
---|
56 | |
---|
57 | build.target build |
---|
58 | destroot.keepdirs ${destroot}${nginx_logdir} \ |
---|
59 | ${destroot}${nginx_rundir} |
---|
60 | |
---|
61 | post-destroot { |
---|
62 | set nginx_conf ${prefix}/etc/${name}/${name}.conf |
---|
63 | # Try to cover for the fact that, in earlier revisions of this port, the |
---|
64 | # configuration file was installed live instead of an example, in which |
---|
65 | # case an upgrade will clobber any customisations that a user might have |
---|
66 | # made :( |
---|
67 | catch "exec port provides ${nginx_conf}" provides_output |
---|
68 | set nginx_conf_is_registered_to_nginx \ |
---|
69 | [regexp "${nginx_conf} is provided by: ${name}" ${provides_output}] |
---|
70 | set nginx_conf_differs \ |
---|
71 | [catch {exec cmp ${nginx_conf} ${worksrcpath}/conf/${name}.conf}] |
---|
72 | if { ${nginx_conf_is_registered_to_nginx} && ${nginx_conf_differs} } { |
---|
73 | copy ${nginx_conf} ${nginx_conf}.altered |
---|
74 | ui_msg "" |
---|
75 | ui_msg "###############################################################" |
---|
76 | ui_msg "# It appears that you have altered ${nginx_conf}," |
---|
77 | ui_msg "# and that upgrading or uninstalling your previous installation" |
---|
78 | ui_msg "# of ${name} will clobber your copy. It has been copied to" |
---|
79 | ui_msg "# ${nginx_conf}.altered for preservation when you upgrade or" |
---|
80 | ui_msg "# uninstall ${name}. This problem should not occur with future" |
---|
81 | ui_msg "# upgrades or installations of this port.\n" |
---|
82 | ui_msg "###############################################################" |
---|
83 | ui_msg "" |
---|
84 | } |
---|
85 | } |
---|
86 | |
---|
87 | startupitem.create yes |
---|
88 | startupitem.executable ${prefix}/sbin/nginx |
---|
89 | startupitem.pidfile auto ${nginx_pidfile} |
---|
90 | |
---|
91 | variant dav description {Add WebDAV support to server} { |
---|
92 | configure.args-append --with-http_dav_module |
---|
93 | } |
---|
94 | |
---|
95 | variant flv description {Add FLV (Flash Video) streaming support to server} { |
---|
96 | configure.args-append --with-http_flv_module |
---|
97 | } |
---|
98 | |
---|
99 | variant mail description {Add IMAP4/POP3 mail proxy support} { |
---|
100 | configure.args-append --with-mail |
---|
101 | } |
---|
102 | |
---|
103 | variant ssl description {Add SSL (HTTPS) support to the server, and\ |
---|
104 | also to the mail proxy if that is enabled} { |
---|
105 | depends_lib-append port:openssl |
---|
106 | configure.args-append --with-http_ssl_module |
---|
107 | if [variant_isset mail] { |
---|
108 | configure.args-append --with-mail_ssl_module |
---|
109 | } |
---|
110 | } |
---|
111 | |
---|
112 | variant status description {Add /nginx_status support to the server} { |
---|
113 | configure.args-append --with-http_stub_status_module |
---|
114 | } |
---|
115 | |
---|
116 | # This variant has been labelled "perl5" so as to allow users to easily stick |
---|
117 | # with perl 5.x once perl 6.x is released; a "perl6" variant will also be added |
---|
118 | # at that time. |
---|
119 | variant perl5 description {Add perl support to the server directly within\ |
---|
120 | nginx and call perl via SSI} { |
---|
121 | depends_run-append path:bin/perl:perl5 |
---|
122 | configure.args-append --with-http_perl_module \ |
---|
123 | --with-perl=${prefix}/bin/perl |
---|
124 | } |
---|
125 | |
---|
126 | variant realip description {Using nginx as a backend} { |
---|
127 | configure.args-append --with-http_realip_module |
---|
128 | } |
---|
129 | |
---|
130 | variant addition description {Append text to pages} { |
---|
131 | configure.args-append --with-http_addition_module |
---|
132 | } |
---|
133 | |
---|
134 | variant substitution description {Replace text in pages} { |
---|
135 | configure.args-append --with-http_sub_module |
---|
136 | } |
---|
137 | |
---|
138 | variant gzip_static description {Avoids compressing the same file each\ |
---|
139 | time it is requested} { |
---|
140 | configure.args-append --with-http_gzip_static_module |
---|
141 | } |
---|
142 | |
---|
143 | variant google_perftools description {Enable Google Performance Tools\ |
---|
144 | profiling for workers} { |
---|
145 | depends_lib-append port:google-perftools |
---|
146 | configure.args-append --with-google_perftools_module |
---|
147 | } |
---|
148 | |
---|
149 | variant upload description {Enable Valery Kholodkov's upload module\ |
---|
150 | (http://grid.net.ru/nginx/upload.en.html)} { |
---|
151 | set upload_filename nginx_upload_module |
---|
152 | set upload_version 2.0.9 |
---|
153 | set upload_distname ${upload_filename}-${upload_version} |
---|
154 | distfiles-append ${upload_distname}.tar.gz:upload_module |
---|
155 | checksums-append ${upload_distname}.tar.gz \ |
---|
156 | md5 bd8ee6011e3e24805c8ead617211a04b \ |
---|
157 | sha1 4dd932eba456a5370db806d15e8cc97acd104d55 \ |
---|
158 | rmd160 60b4107d8d4891944c78506b9b659a916b7e528f |
---|
159 | configure.args-append --add-module=${workpath}/${upload_distname} |
---|
160 | } |
---|
161 | |
---|
162 | variant secure_download description {Enable Ngx http secure download \ |
---|
163 | (http://wiki.nginx.org/NginxHttpSecureDownload)} { |
---|
164 | |
---|
165 | set secure_download_distname Ngx_http_secure_download |
---|
166 | distfiles-append ${secure_download_distname}.tar.gz:secure_download_module |
---|
167 | checksums-append ${secure_download_distname}.tar.gz \ |
---|
168 | md5 ae35f1355fd9f1aa6d54ea15eb413163 |
---|
169 | configure.args-append --add-module=${workpath}/${secure_download_distname} |
---|
170 | depends_lib-append port:mhash |
---|
171 | } |
---|
172 | |
---|
173 | variant zip description {Enable Ngx zip download module \ |
---|
174 | (http://wiki.nginx.org/NginxNgxZip)} { |
---|
175 | |
---|
176 | set zip_distname Mod_zip-1.1.4 |
---|
177 | distfiles-append ${zip_distname}.tar.gz:zip_module |
---|
178 | checksums-append ${zip_distname}.tar.gz \ |
---|
179 | md5 be934138446793ca783ebfcc1a74883d |
---|
180 | configure.args-append --add-module=${workpath}/${zip_distname} |
---|
181 | } |
---|
182 | |
---|
183 | variant redis description {Enable Ngx HTTP Redis module} { |
---|
184 | set redis_filename ngx_http_redis |
---|
185 | set redis_version 0.3.1 |
---|
186 | set redis_distname ${redis_filename}-${redis_version} |
---|
187 | distfiles-append ${redis_distname}.tar.gz:redis_module |
---|
188 | checksums-append ${redis_distname}.tar.gz \ |
---|
189 | md5 c731d6ac14b4c8a99fda2c7e89356a8f |
---|
190 | configure.args-append --add-module=${workpath}/${redis_distname} |
---|
191 | } |
---|