# $Id$

PortSystem 1.0

name             cvsync
version          0.24.18
revision         2
categories       net
license          BSD
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      path:lib/libssl.dylib: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
}

notes "You must create two configuration files:
  ${prefix}/etc/cvsync.conf
  ${prefix}/etc/cvsyncd.conf

For examples, see ${prefix}/share/doc/${name}/"