# -*- 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
# $Id: Portfile 78632 2011-05-14 22:50:58Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           xcode 1.0

name                PsyncX
version             2.2.2
categories          aqua sysutils
maintainers         ryandesign
homepage            http://psyncx.sourceforge.net/

description         Mac OS X wrapper around psync and crontab

long_description    ${name} is a ${description}. That means that PsyncX \
                    uses an existing free Unix application, psync, and the \
                    ability to schedule jobs (known as cron in Unix) to \
                    allow you to schedule backups whenever you want.

fetch.type          svn
svn.url             http://psyncx.svn.sourceforge.net/svnroot/psyncx/trunk
svn.revision        29
worksrcdir          trunk

depends_lib         port:p5-macosx-file

# I don't know why these files aren't in the psyncx subversion repository.
# I copied them from the installer package on the psyncx 2.2.2 disk image.
post-extract {
    xinstall -W ${filespath} psyncwriter runpsync ${worksrcpath}
}

patchfiles          patch-AuthorizedTasks.m.diff \
                    patch-CronController.m.diff \
                    patch-CronJob.m.diff \
                    patch-psyncapplescript.diff \
                    patch-psyncwriter.diff \
                    patch-runpsync.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" \
                    ${worksrcpath}/AuthorizedTasks.m \
                    ${worksrcpath}/CronController.m \
                    ${worksrcpath}/CronJob.m \
                    ${worksrcpath}/psyncapplescript \
                    ${worksrcpath}/psyncwriter \
                    ${worksrcpath}/runpsync
}

post-destroot {
    xinstall -W ${worksrcpath} psyncwriter runpsync ${destroot}${prefix}/bin
}

livecheck.type      regex
livecheck.url       http://sourceforge.net/projects/psyncx/files/PsyncX/
livecheck.regex     {/PsyncX ([0-9.]+)"}
