# $Id$

PortSystem      1.0

name            dnetc
version         2.9105.511b
set branch      [join [lrange [split ${version} .] 0 1] .]
set minor       [lindex [split ${version} .] end]
categories      net
maintainers     mfeiri
description     distributed.net client
long_description  distributed.net believes in the capability and potential \
                of distributed computing. Their mission consists of three \
                interdependent goals: development, deployment, and \
                advocacy, to be pursued in the advancement of distributed \
                computing. \
                They advocate distributed computing, by encouraging global \
                participation and contributions of processing power, \
                bandwidth, and expertise\; by providing a forum for \
                discussion\; and by raising awareness on the Internet and \
                in the mainstream.

homepage        http://distributed.net/
platforms       darwin

master_sites    ftp://ftp.distributed.net/pub/dcti/v${branch}/ \
                http://http.distributed.net/pub/dcti/v${branch}/

platform i386 {
    distname        ${name}${minor}-macosx-x86
    checksums       md5 ff9cd03f6b41dcb4dc1609189b8844f5 \
                    sha1 63f327ab925c1cda0ccdba66472cec8ec1c279ae \
                    rmd160 c8bf288464dca88968f39c936aa8ddf3c5a88824
    worksrcdir      ${name}511-macosx-x86
}

platform powerpc {
    distname        ${name}${minor}-macosx-ppc
    checksums       md5 d0c9f31951c9767ae83cfa2646c5eb98 \
                    sha1 7c7bf07f415d367428487b24019c1a84498f8a34 \
                    rmd160 bebfa883f3c136e45714fe8a77e4577527e8b2ab
    worksrcdir      ${name}511-macosx-ppc
}

    startupitem.create    yes
    startupitem.start "${prefix}/share/${name}/dnetc.init start"
    startupitem.stop "${prefix}/share/${name}/dnetc.init stop"

use_configure   no
build     {}
destroot  {
  xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
  xinstall -m 755 -d ${destroot}${prefix}/share/${name}
  xinstall -m 755 -d ${destroot}${prefix}/var/db/${name}
  destroot.keepdirs  ${destroot}${prefix}/var/db/${name}
  xinstall -m 755 ${worksrcpath}/dnetc ${destroot}${prefix}/bin

  eval xinstall -m 644 [glob ${worksrcpath}/docs/*] ${destroot}${prefix}/share/doc/${name}
  xinstall -m 755 ${portpath}/files/dnetc.init ${destroot}${prefix}/share/${name}

reinplace "s|__PREFIX__|${prefix}|g" \
    ${destroot}${prefix}/share/${name}/dnetc.init
}

post-install {
ui_msg "\n
=========================================================================
Please Note! Run dnetc with script ${prefix}/share/${name}/dnetc.init start.
This script places the dnetc.ini and buffer files in ${prefix}/var/db/${name}.
The first time the script runs you will be asked to set configuration parameters.
To change parameters later on, use ${prefix}/share/${name}/dnetc.init config.
dnetc is also started at system boot via the same startup script.
==========================================================================\n"
}