# -*- 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

PortSystem          1.0
PortGroup           deprecated 1.0

deprecated.upstream_support no

name                aiccu
version             20070115
revision            6
categories          net
platforms           darwin
maintainers         {danchr @danchr} openmaintainer

description         Automatic IPv6 Connectivity Configuration Utility
long_description    AICCU makes it very easy for SixXS users to get IPv6 connectivity \
                    everywhere they want. It uses the TIC (Tunnel Information & Control) \
                    protocol to request the information needed to setup a tunnel through \
                    which the connectivity is created. \
                    It supports 6in4 static (RFC 2893), 6in4 heartbeat (RFC 2893 + \
                    draft-massar-v6ops-heartbeat) and AYIYA (draft-massar-v6ops-ayiya) \
                    tunnel protocols.
homepage            https://www.sixxs.net/tools/aiccu/
license             BSD

master_sites        http://www.sixxs.net/archive/sixxs/aiccu/unix/
distname            aiccu_${version}

checksums           rmd160 9415899c98c1f7e84b9711017b82a3a0ea2ae9de \
                    sha256 2260f426c13471169ccff8cb4a3908dc5f79fda18ddb6a55363e7824e6c4c760 \
                    size 70056

depends_lib         port:tuntaposx

set kext_dir        ${prefix}/Library/Extensions
set pid_file        ${prefix}/var/run/${name}.pidfile
set conf_file       ${prefix}/etc/aiccu.conf

worksrcdir          aiccu
patchfiles          Makefile.patch aiccu_conf.patch ayiya-reconnect.diff

pre-configure {
        reinplace "s|#pidfile /var/run/aiccu.pid|pidfile ${pid_file}|" \
          ${worksrcpath}/doc/aiccu.conf
}
use_configure       no

build.args-append   MPPREFIX=${prefix}

destroot.args       DESTDIR=${destroot}${prefix}
destroot.destdir    ${destroot}${prefix}

# Do not re-enable the startupitem without correcting the problem that the
# default configuration results in account suspension (#22872)
#startupitem.create      yes
#startupitem.pidfile     clean ${pid_file}
#startupitem.start       "kextstat -kl | grep -q 'foo\.tun' || kextload  ${kext_dir}/tun.kext ; \
#                         ${prefix}/sbin/aiccu start ${conf_file}"
#startupitem.stop        "${prefix}/sbin/aiccu stop ${conf_file}"
#startupitem.netchange   yes

variant gnutls description {TIC server transport encryption} {
    depends_lib-append  path:lib/pkgconfig/gnutls.pc:gnutls
    patchfiles-append   gnutls.patch
}

livecheck.type      none

notes "
**********************************************************************
* Warning: The SixXS service is no longer available; as a result,    *
* this port has little but historical value.                         *
**********************************************************************
"
