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 153914 2016-10-15 20:13:13Z jmr@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name squid3 |
---|
7 | version 3.5.22 |
---|
8 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
9 | categories net |
---|
10 | platforms darwin |
---|
11 | license GPL-2+ |
---|
12 | maintainers jmr openmaintainer |
---|
13 | description advanced proxy caching server for http, https, ftp, gopher |
---|
14 | long_description Squid is a high-performance proxy caching server for \ |
---|
15 | web clients, supporting FTP, gopher, and HTTP data \ |
---|
16 | objects. Unlike traditional caching software, Squid \ |
---|
17 | handles all requests in a single, non-blocking, \ |
---|
18 | I/O-driven process. Squid keeps meta data and \ |
---|
19 | especially hot objects cached in RAM, caches DNS \ |
---|
20 | lookups, supports non-blocking DNS lookups, and \ |
---|
21 | implements negative caching of failed requests. |
---|
22 | |
---|
23 | homepage http://www.squid-cache.org/ |
---|
24 | master_sites http://mirror.aarnet.edu.au/pub/squid/squid/ \ |
---|
25 | http://www.mirrorservice.org/sites/ftp.squid-cache.org/pub/squid/ \ |
---|
26 | http://ftp.ring.gr.jp/archives/net/www/squid/ \ |
---|
27 | ftp://ftp.is.co.za/pub/squid/ \ |
---|
28 | ftp://ftp1.cl.squid-cache.org/pub/squid/ \ |
---|
29 | http://www.squid-cache.org/Versions/v3/${branch}/ \ |
---|
30 | ftp://ftp.squid-cache.org/pub/squid/ |
---|
31 | |
---|
32 | distname squid-${version} |
---|
33 | use_xz yes |
---|
34 | checksums md5 afb82d2748c06c95815c171463b4aa14 \ |
---|
35 | sha1 73e9199dd9d2a7f107f78d03454830713a4a571d \ |
---|
36 | rmd160 0a9e5545ae8fa20c5d9f97cfc3548c0e07c86ee4 |
---|
37 | |
---|
38 | patchfiles patch-cf.data.pre.diff \ |
---|
39 | patch-compat_types.h.diff \ |
---|
40 | patch-basic_pam_auth.cc.diff |
---|
41 | |
---|
42 | platform darwin 10 { |
---|
43 | # ticket #37102, /usr/include/rpcsvc/yp_prot.h tries to redefine bool |
---|
44 | patchfiles-append snowleopard-bool.diff |
---|
45 | } |
---|
46 | |
---|
47 | depends_lib port:zlib |
---|
48 | |
---|
49 | conflicts squid |
---|
50 | |
---|
51 | set pidfile ${prefix}/var/run/squid/squid.pid |
---|
52 | |
---|
53 | configure.args --mandir=${prefix}/share/man \ |
---|
54 | --sysconfdir=${prefix}/etc/squid \ |
---|
55 | --datadir=${prefix}/share/squid \ |
---|
56 | --localstatedir=${prefix}/var/squid \ |
---|
57 | --libexecdir=${prefix}/libexec/squid \ |
---|
58 | --with-swapdir=${prefix}/var/squid/cache \ |
---|
59 | --with-pidfile=${pidfile} \ |
---|
60 | --disable-strict-error-checking \ |
---|
61 | --disable-loadable-modules \ |
---|
62 | --disable-arch-native \ |
---|
63 | --without-gnutls \ |
---|
64 | --without-mit-krb5 \ |
---|
65 | --without-heimdal-krb5 \ |
---|
66 | --without-gnugss \ |
---|
67 | --enable-delay-pools \ |
---|
68 | --enable-zph-qos \ |
---|
69 | --enable-removal-policies \ |
---|
70 | --enable-storeio=ufs,aufs,diskd,rock \ |
---|
71 | --enable-disk-io=AIO,Blocking,DiskDaemon,DiskThreads,Mmapped \ |
---|
72 | --enable-log-daemon-helpers \ |
---|
73 | --with-default-user=squid \ |
---|
74 | --enable-auth \ |
---|
75 | --enable-auth-basic \ |
---|
76 | --enable-auth-digest \ |
---|
77 | --enable-auth-negotiate="wrapper" \ |
---|
78 | --enable-auth-ntlm \ |
---|
79 | --enable-external-acl-helpers="SQL_session eDirectory_userip file_userip time_quota unix_group wbinfo_group" |
---|
80 | post-configure { |
---|
81 | if {[variant_isset universal]} { |
---|
82 | system -W ${worksrcpath} "ed - include/autoconf.h < ${filespath}/include_autoconf.h.ed && touch include/stamp-h1" |
---|
83 | } |
---|
84 | } |
---|
85 | |
---|
86 | startupitem.create yes |
---|
87 | startupitem.name Squid |
---|
88 | startupitem.netchange yes |
---|
89 | startupitem.pidfile auto ${pidfile} |
---|
90 | startupitem.start \ |
---|
91 | "cd ${prefix}/var/squid" \ |
---|
92 | "if \[ ! -d \"${prefix}/var/squid/cache/00\" \]; then" \ |
---|
93 | " ${prefix}/sbin/squid -s -z" \ |
---|
94 | "fi" \ |
---|
95 | "${prefix}/sbin/squid -s" |
---|
96 | startupitem.stop \ |
---|
97 | "cd ${prefix}/var/squid" \ |
---|
98 | "${prefix}/sbin/squid -k shutdown" \ |
---|
99 | "while ${prefix}/sbin/squid -k check; do" \ |
---|
100 | " sleep 1" \ |
---|
101 | "done" |
---|
102 | |
---|
103 | add_users squid group=squid home=${prefix}/var/squid |
---|
104 | |
---|
105 | post-destroot { |
---|
106 | xinstall -o squid -g squid -m 755 -d \ |
---|
107 | ${destroot}${prefix}/var/run/squid ${destroot}${prefix}/var/squid \ |
---|
108 | ${destroot}${prefix}/var/squid/cache ${destroot}${prefix}/var/squid/logs |
---|
109 | file delete -force ${destroot}${prefix}/etc/squid/squid.conf \ |
---|
110 | ${destroot}${prefix}/etc/squid/mime.conf \ |
---|
111 | ${destroot}${prefix}/etc/squid/cachemgr.conf \ |
---|
112 | ${destroot}${prefix}/etc/squid/errorpage.css |
---|
113 | } |
---|
114 | destroot.keepdirs ${destroot}${prefix}/var/run/squid \ |
---|
115 | ${destroot}${prefix}/var/squid/cache \ |
---|
116 | ${destroot}${prefix}/var/squid/logs |
---|
117 | |
---|
118 | post-activate { |
---|
119 | # Make sure initial conf files are present and setup correctly |
---|
120 | foreach f { squid.conf mime.conf cachemgr.conf errorpage.css } { |
---|
121 | if {![file exists ${prefix}/etc/squid/${f}]} { |
---|
122 | file copy ${prefix}/etc/squid/${f}.default \ |
---|
123 | ${prefix}/etc/squid/${f} |
---|
124 | } |
---|
125 | } |
---|
126 | } |
---|
127 | |
---|
128 | variant openssl description "Enable SSL/TLS support using OpenSSL" { |
---|
129 | depends_lib-append path:lib/libssl.dylib:openssl |
---|
130 | configure.args-append --with-openssl=${prefix} |
---|
131 | } |
---|
132 | |
---|
133 | default_variants +openssl |
---|
134 | |
---|
135 | variant ipfw_transparent description "Enable transparent proxy support using IPFW" { |
---|
136 | configure.args-append --enable-ipfw-transparent |
---|
137 | } |
---|
138 | |
---|
139 | variant kerberos description "Enable MIT kerberos support" { |
---|
140 | depends_lib-append port:kerberos5 |
---|
141 | configure.args-delete --enable-auth-negotiate="wrapper" \ |
---|
142 | --without-mit-krb5 |
---|
143 | configure.args-append --enable-auth-negotiate |
---|
144 | } |
---|
145 | |
---|
146 | livecheck.type regex |
---|
147 | livecheck.url http://www.squid-cache.org/Versions/v3/${branch}/ |
---|
148 | livecheck.regex "squid-(\[0-9.\]+)-RELEASENOTES\\.html" |
---|