Ticket #26445: Portfile

File Portfile, 8.0 KB (added by rambiusparkisanius@…, 14 years ago)

nginx-devel;s portfile

Line 
1# $Id: Portfile 68367 2010-06-02 05:41:28Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name            nginx-devel
6version         0.8.50
7categories      www mail
8platforms       darwin
9maintainers     boeyms openmaintainer
10description     High-performance HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
11long_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.
20homepage        http://nginx.net/
21master_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
26distfiles       nginx-${version}${extract.suffix}:nginx
27checksums       nginx-${version}${extract.suffix} \
28                md5     c730e35c9b14c6a19ff502c9082d1567 \
29                sha1    6c293943fca334d78572ccacdab5d170ba2e18b3 \
30                rmd160  b65ecc1a5a09e7897fcb6628272a8fb6fc2c2b18
31worksrcdir      nginx-${version}
32
33depends_lib     port:pcre port:zlib
34
35patchfiles      patch-auto__install.diff patch-conf__nginx.conf.diff
36
37set nginx_confdir       ${prefix}/etc/${name}
38set nginx_logdir        ${prefix}/var/log/${name}
39set nginx_rundir        ${prefix}/var/run/${name}
40
41set nginx_pidfile       ${nginx_rundir}/${name}.pid
42
43configure.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
55universal_variant   no
56
57build.target        build
58destroot.keepdirs   ${destroot}${nginx_logdir} \
59                    ${destroot}${nginx_rundir}
60
61post-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
87startupitem.create      yes
88startupitem.executable  ${prefix}/sbin/nginx
89startupitem.pidfile     auto ${nginx_pidfile}
90
91variant dav description {Add WebDAV support to server} {
92    configure.args-append   --with-http_dav_module
93}
94
95variant flv description {Add FLV (Flash Video) streaming support to server} {
96    configure.args-append   --with-http_flv_module
97}
98
99variant mail description {Add IMAP4/POP3 mail proxy support} {
100    configure.args-append   --with-mail
101}
102
103variant 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
112variant 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.
119variant 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
126variant realip description {Using nginx as a backend} {
127    configure.args-append   --with-http_realip_module
128}
129
130variant addition description {Append text to pages} {
131    configure.args-append   --with-http_addition_module
132}
133
134variant substitution description {Replace text in pages} {
135    configure.args-append   --with-http_sub_module
136}
137
138variant 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
143variant 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
149variant 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
162variant 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
173variant 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
183variant 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}