# $Id: Portfile 30239 2007-10-23 01:55:09Z jmpp@macports.org $

PortSystem 1.0
name             cvsync
version          0.24.18
categories       net
maintainers      nomaintainer
description      cvsync is a portable CVS repository synchronization utility 
long_description \
    cvsync is a portable CVS repository synchronization utility. \
    cvsync is freely available under the BSD license and is a \
    compelling, if not raw, replacement for CVSup written in C.
homepage         http://www.cvsync.org/
platforms        darwin
master_sites     ftp://ftp.cvsync.org/pub/cvsync/
checksums        md5 cdabce7d2b21cc5de41e711c3f7ea7be

depends_lib      port:openssl port:zlib

patchfiles       patch-common__updater_list.c \
                 patch-cvsyncd__main.c \
                 patch-mk__base.mk \
                 patch-mk__network.mk

post-patch {
	reinplace s|/var/run|$prefix/var/run| \
		$worksrcpath/cvsyncd/cvsyncd.1 \
		$worksrcpath/cvsyncd/main.c
}

configure.cmd    make
configure.pre_args configure
configure.args   HASH_TYPE=openssl \
                 PREFIX=${prefix}
build.args       CVSYNC_DEFAULT_CONFIG=${prefix}/etc/cvsync.conf \
                 CVSYNCD_DEFAULT_CONFIG=${prefix}/etc/cvsyncd.conf
destroot.args    ${build.args}
destroot.destdir PREFIX=${destroot}${prefix} \
                 MANDIR=${destroot}${prefix}/share/man

post-destroot {
    file mkdir ${destroot}${prefix}/share/doc/${name}
    file copy ${worksrcpath}/samples ${destroot}${prefix}/share/doc/${name}
    destroot.keepdirs ${destroot}${prefix}/var/run
}

post-install {
    ui_msg ""
    ui_msg "You must create two configuration files:"
    ui_msg "  ${prefix}/etc/cvsync.conf"
    ui_msg "  ${prefix}/etc/cvsyncd.conf"
    ui_msg ""
    ui_msg "For examples, see ${prefix}/share/doc/${name}/"
    ui_msg ""
}
