Ignore:
Timestamp:
Mar 4, 2012, 1:52:20 AM (7 years ago)
Author:
ryandesign@…
Message:

privoxy: add modeline; adjust whitespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/www/privoxy/Portfile

    r84392 r90384  
     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
    12# $Id$
    23
    3 PortSystem                      1.0
    4 name                            privoxy
    5 version                         3.0.17
    6 revision                        0
    7 categories                      www security net
    8 license                         GPL-2
    9 maintainers                     nomaintainer
    10 description                     Advanced filtering web proxy
    11 long_description \
    12         Privoxy is a web proxy with advanced filtering capabilities for \
    13         protecting privacy, modifying web page content, managing cookies, \
    14         controlling access, and removing ads, banners, pop-ups and other \
    15         obnoxious Internet junk. Privoxy has a very flexible configuration and \
    16         can be customized to suit individual needs and tastes. Privoxy has \
    17         application for both stand-alone systems and multi-user networks.
     4PortSystem          1.0
    185
    19 platforms                       darwin
     6name                privoxy
     7version             3.0.17
     8revision            0
     9categories          www security net
     10platforms           darwin
     11license             GPL-2
     12maintainers         nomaintainer
    2013
    21 homepage                        http://www.privoxy.org/
    22 master_sites            sourceforge:ijbswa
    23 distname                        ${name}-${version}-stable-src
     14description         Advanced filtering web proxy
     15
     16long_description    Privoxy is a web proxy with advanced filtering \
     17                    capabilities for protecting privacy, modifying web page \
     18                    content, managing cookies, controlling access, and \
     19                    removing ads, banners, pop-ups and other obnoxious \
     20                    Internet junk. Privoxy has a very flexible configuration \
     21                    and can be customized to suit individual needs and tastes. \
     22                    Privoxy has application for both stand-alone systems and \
     23                    multi-user networks.
     24
     25homepage            http://www.privoxy.org/
     26master_sites        sourceforge:ijbswa
     27distname            ${name}-${version}-stable-src
    2428
    2529checksums           md5     9d363d738a3f3d73e774d6dfeafdb15f \
     
    2731                    rmd160  8e4acc60ca7e7be20a92e1aece92eecedd4d1997
    2832
    29 worksrcdir                      ${name}-${version}-stable
     33worksrcdir          ${name}-${version}-stable
    3034
    31 depends_lib                     port:pcre port:zlib
     35depends_lib         port:pcre \
     36                    port:zlib
    3237
    33 set privoxyGroup        privoxy
    34 set privoxyUser         privoxy
     38set privoxyGroup    privoxy
     39set privoxyUser     privoxy
    3540
    3641if {[tbool portarchivemode]} {
    3742    pre-unarchive {
    38         addgroup        ${privoxyGroup}
    39         adduser         ${privoxyUser} gid=[existsgroup ${privoxyGroup}]
     43        addgroup    ${privoxyGroup}
     44        adduser     ${privoxyUser} gid=[existsgroup ${privoxyGroup}]
    4045    }
    4146}
    4247pre-configure {
    4348    if {![tbool portarchivemode]} {
    44         addgroup        ${privoxyGroup}
    45         adduser         ${privoxyUser} gid=[existsgroup ${privoxyGroup}]
     49        addgroup    ${privoxyGroup}
     50        adduser     ${privoxyUser} gid=[existsgroup ${privoxyGroup}]
    4651    }
    4752    if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
    48         configure.args-append --with-user=${privoxyUser} \
    49                                                   --with-group=${privoxyGroup}
     53        configure.args-append   --with-user=${privoxyUser} \
     54                                --with-group=${privoxyGroup}
    5055    }
    5156    system "cd ${worksrcpath} && autoheader"
    5257}
    5358
    54 use_autoconf            yes
    55 configure.args          --sysconfdir=${prefix}/etc/${name} \
    56                                         --mandir=${prefix}/share/man \
    57                                         --enable-dynamic-pcre \
    58                                         --enable-zlib
     59use_autoconf        yes
     60configure.args      --sysconfdir=${prefix}/etc/${name} \
     61                    --mandir=${prefix}/share/man \
     62                    --enable-dynamic-pcre \
     63                    --enable-zlib
    5964
    6065# work around bug 30345
     
    6368}
    6469
    65 destroot.keepdirs       ${destroot}${prefix}/var/log/privoxy \
    66                                         ${destroot}${prefix}/var/run
     70destroot.keepdirs   ${destroot}${prefix}/var/log/privoxy \
     71                    ${destroot}${prefix}/var/run
    6772
    6873post-destroot {
    69         xinstall -m 755 -d ${destroot}${prefix}/var/run
    70         # Install and fixup startup script (if non-Darwin)
    71         if {${os.platform} != "darwin"} {
    72                 xinstall -m 755 -d ${destroot}${prefix}/etc/rc.d
    73                 xinstall -m 755 -W ${worksrcpath} privoxy-generic.init \
    74                         ${destroot}${prefix}/etc/rc.d/privoxy.sh
    75 
    76                 system "cd ${destroot}${prefix}/etc/rc.d && patch -p0 < ${filespath}/patch-privoxy.sh.diff"
    77                 reinplace "s|@@PREFIX@@|${prefix}|g" \
    78                         ${destroot}${prefix}/etc/rc.d/privoxy.sh
    79                 if {[existsuser ${privoxyUser}] != 0} {
     74    xinstall -m 755 -d ${destroot}${prefix}/var/run
     75    # Install and fixup startup script (if non-Darwin)
     76    if {${os.platform} != "darwin"} {
     77        xinstall -m 755 -d ${destroot}${prefix}/etc/rc.d
     78        xinstall -m 755 -W ${worksrcpath} privoxy-generic.init \
     79            ${destroot}${prefix}/etc/rc.d/privoxy.sh
     80       
     81        system "cd ${destroot}${prefix}/etc/rc.d && patch -p0 < ${filespath}/patch-privoxy.sh.diff"
     82        reinplace "s|@@PREFIX@@|${prefix}|g" \
     83            ${destroot}${prefix}/etc/rc.d/privoxy.sh
     84        if {[existsuser ${privoxyUser}] != 0} {
    8085            reinplace "s|@@PRIVOXY_USER@@|${privoxyUser}|g" \
    8186                ${destroot}${prefix}/etc/rc.d/privoxy.sh
    82                 } else {
     87        } else {
    8388            reinplace "s|@@PRIVOXY_USER@@|$env(USER)|g" \
    8489                ${destroot}${prefix}/etc/rc.d/privoxy.sh
    85                 }
    86         }
    87         # Rename these so local modifications are not removed on uninstall.
    88         # NOTE: Always overwrite default.action and default.filter.
    89         foreach privoxyConf {config match-all.action trust user.action user.filter} {
     90        }
     91    }
     92    # Rename these so local modifications are not removed on uninstall.
     93    # NOTE: Always overwrite default.action and default.filter.
     94    foreach privoxyConf {config match-all.action trust user.action user.filter} {
    9095            if [file exists ${destroot}${prefix}/etc/privoxy/${privoxyConf}] {
    91                 file rename ${destroot}${prefix}/etc/privoxy/${privoxyConf} \
    92                         ${destroot}${prefix}/etc/privoxy/${privoxyConf}.new
     96        file rename ${destroot}${prefix}/etc/privoxy/${privoxyConf} \
     97            ${destroot}${prefix}/etc/privoxy/${privoxyConf}.new
    9398            }
    94             # backup config files before fix #23970
     99        # backup config files before fix #23970
    95100            if {[file exists ${prefix}/etc/privoxy/${privoxyConf}] \
    96             && ![file exists ${prefix}/etc/privoxy/${privoxyConf}.new]} {
    97                 file copy ${prefix}/etc/privoxy/${privoxyConf} \
    98                         ${destroot}${prefix}/etc/privoxy/${privoxyConf}.mp_backup
     101        && ![file exists ${prefix}/etc/privoxy/${privoxyConf}.new]} {
     102        file copy ${prefix}/etc/privoxy/${privoxyConf} \
     103            ${destroot}${prefix}/etc/privoxy/${privoxyConf}.mp_backup
    99104            }
    100         }
    101         # Remove the preinstalled log files as, otherwise, a rotation script
    102         # will fail when trying to rename and compress due to gzip not liking
    103         # multi-linked files (the one in ${prefix} and the one in
    104         # ${prefix}/var/db/dports/software/...)
    105         eval file delete [glob ${destroot}${prefix}/var/log/privoxy/*]
    106         if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
     105    }
     106    # Remove the preinstalled log files as, otherwise, a rotation script
     107    # will fail when trying to rename and compress due to gzip not liking
     108    # multi-linked files (the one in ${prefix} and the one in
     109    # ${prefix}/var/db/dports/software/...)
     110    eval file delete [glob ${destroot}${prefix}/var/log/privoxy/*]
     111    if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
    107112        # Make sure log directory owned by privoxy user/group
    108113        file attributes ${destroot}${prefix}/var/log/privoxy \
    109114            -group ${privoxyGroup} -owner ${privoxyUser}
    110         }
     115    }
    111116}
    112117
    113118post-activate {
    114         # Make sure initial log files are present and setup correctly
    115         foreach privoxyLog {jarfile logfile} {
    116                 touch ${prefix}/var/log/privoxy/${privoxyLog}
    117                 if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
     119    # Make sure initial log files are present and setup correctly
     120    foreach privoxyLog {jarfile logfile} {
     121        touch ${prefix}/var/log/privoxy/${privoxyLog}
     122        if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
    118123            file attributes ${prefix}/var/log/privoxy/${privoxyLog} \
    119124                -group ${privoxyGroup} -owner ${privoxyUser} \
    120125                -permissions 0660
    121                 }
    122         }
    123         foreach privoxyConf {config match-all.action trust user.action user.filter} {
    124                 if ![file exists ${prefix}/etc/privoxy/${privoxyConf}] {
    125                         # restore config files before fix #23970
    126                         if [file exists ${prefix}/etc/privoxy/${privoxyConf}.mp_backup] {
    127                             file copy ${prefix}/etc/privoxy/${privoxyConf}.mp_backup \
    128                                     ${prefix}/etc/privoxy/${privoxyConf}
    129                         } else {
    130                             file copy ${prefix}/etc/privoxy/${privoxyConf}.new \
    131                                     ${prefix}/etc/privoxy/${privoxyConf}
    132                         }
    133                         if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
     126        }
     127    }
     128    foreach privoxyConf {config match-all.action trust user.action user.filter} {
     129        if ![file exists ${prefix}/etc/privoxy/${privoxyConf}] {
     130            # restore config files before fix #23970
     131            if [file exists ${prefix}/etc/privoxy/${privoxyConf}.mp_backup] {
     132                file copy ${prefix}/etc/privoxy/${privoxyConf}.mp_backup \
     133                    ${prefix}/etc/privoxy/${privoxyConf}
     134            } else {
     135                file copy ${prefix}/etc/privoxy/${privoxyConf}.new \
     136                    ${prefix}/etc/privoxy/${privoxyConf}
     137            }
     138            if {[existsuser ${privoxyUser}] != 0 && [existsgroup ${privoxyGroup}] != 0} {
    134139                file attributes ${prefix}/etc/privoxy/${privoxyConf} \
    135140                    -group ${privoxyGroup} -owner ${privoxyUser} \
    136141                    -permissions 0660
    137                         }
    138                 }
    139         }
     142            }
     143        }
     144    }
    140145}
    141146
    142147platform darwin {
    143         startupitem.create                      yes
    144         startupitem.name                        Privoxy
    145         startupitem.start                       "\[ -f \"${prefix}/etc/privoxy/config\" \] \\"
    146         startupitem.start-append        "\t&& ${prefix}/sbin/privoxy \\"
    147         startupitem.start-append        "\t\t--pidfile ${prefix}/var/run/privoxy.pid \\"
    148         startupitem.start-append        "\t\t--user ${privoxyUser} \\"
    149         startupitem.start-append        "\t\t${prefix}/etc/privoxy/config 2>/dev/null"
    150         startupitem.stop                        "if \[ -f \"${prefix}/var/run/privoxy.pid\" \]; then"
    151         startupitem.stop-append         "\tkill `cat ${prefix}/var/run/privoxy.pid` \\"
    152         startupitem.stop-append         "\t\t&& rm -f ${prefix}/var/run/privoxy.pid"
    153         startupitem.stop-append         "else"
    154         startupitem.stop-append         "\t/usr/bin/killall -SIGUSR1 privoxy 2>/dev/null"
    155         startupitem.stop-append         "fi"
     148    startupitem.create          yes
     149    startupitem.name            Privoxy
     150    startupitem.start           "\[ -f \"${prefix}/etc/privoxy/config\" \] \\"
     151    startupitem.start-append    "\t&& ${prefix}/sbin/privoxy \\"
     152    startupitem.start-append    "\t\t--pidfile ${prefix}/var/run/privoxy.pid \\"
     153    startupitem.start-append    "\t\t--user ${privoxyUser} \\"
     154    startupitem.start-append    "\t\t${prefix}/etc/privoxy/config 2>/dev/null"
     155    startupitem.stop            "if \[ -f \"${prefix}/var/run/privoxy.pid\" \]; then"
     156    startupitem.stop-append     "\tkill `cat ${prefix}/var/run/privoxy.pid` \\"
     157    startupitem.stop-append     "\t\t&& rm -f ${prefix}/var/run/privoxy.pid"
     158    startupitem.stop-append     "else"
     159    startupitem.stop-append     "\t/usr/bin/killall -SIGUSR1 privoxy 2>/dev/null"
     160    startupitem.stop-append     "fi"
    156161}
    157162
    158 livecheck.type          regex
    159 livecheck.url           http://www.privoxy.org/announce.txt
    160 livecheck.regex         Announcing Privoxy v.(\[0-9.\]+)
     163livecheck.type      regex
     164livecheck.url       http://www.privoxy.org/announce.txt
     165livecheck.regex     Announcing Privoxy v.(\[0-9.\]+)
Note: See TracChangeset for help on using the changeset viewer.