---
name: csync2
version: 1.34_14
origin: net/csync2
comment: Cluster synchronization tool
arch: freebsd:9:x86:64
www: http://oss.linbit.com/csync2/
maintainer: alexey@renatasystems.org
prefix: /usr/local
licenselogic: single
flatsize: 97054
desc: "Csync2 is a cluster synchronization tool. It can be used to keep files on \nmultiple
  hosts in a cluster in sync. Csync2 can handle complex setups with \nmuch more than
  just 2 hosts, handle file deletions and can detect \nconflicts.\n   \nIt is expedient
  for HA-clusters, HPC-clusters, COWs and server farms. If \nyou are looking for a
  tool to sync your laptop with your workstation, you \nbetter have a look at Unison
  (http://www.cis.upenn.edu/~bcpierce/unison/) \ntoo.\n\nWWW: http://oss.linbit.com/csync2/\n"
deps:
  p11-kit: {origin: security/p11-kit, version: 0.16.3}
  nettle: {origin: security/nettle, version: 2.7.1}
  libtasn1: {origin: security/libtasn1, version: 2.14}
  libgpg-error: {origin: security/libgpg-error, version: 1.12}
  libgcrypt: {origin: security/libgcrypt, version: 1.5.3}
  gnutls: {origin: security/gnutls, version: 2.12.23_1}
  ca_root_nss: {origin: security/ca_root_nss, version: 3.15.1}
  librsync: {origin: net/librsync, version: 0.9.7_2}
  gmp: {origin: math/gmp, version: 5.1.2}
  popt: {origin: devel/popt, version: 1.16}
  pkgconf: {origin: devel/pkgconf, version: 0.9.2_1}
  gettext: {origin: devel/gettext, version: 0.18.3}
  sqlite: {origin: databases/sqlite2, version: 2.8.17_1}
  libiconv: {origin: converters/libiconv, version: 1.14_1}
categories:
- net
shlibs_required:
- libgnutls-openssl.so.27
- libsqlite.so.2
- librsync.so.1
- libgnutls.so.26
- libtasn1.so.5
options: {CSYNC2_COMPARE: off}
files:
  /usr/local/etc/csync2.cfg-dist: 144b5292600dea153266652eacbcdb5a85a07c37fe27c1d5ad43cc52f7d653fa
  /usr/local/etc/rc.d/csync2: be76398aa5d903dc88fd7b0f367ad9c0335f4930b0c2e39e7a45aa1212b2ab5e
  /usr/local/man/man1/csync2.1.gz: 6ca28e3074fc20957150180e3047b66463938f38e93acc744103df8152eca0ef
  /usr/local/sbin/csync2: d4f7fc820b3c1ce627c82bf74b1b7b9e72483c8f65ce5b94571ebaa2bdf8ad0c
scripts:
  post-install: |
    cd /usr/local
  pre-deinstall: |
    cd /usr/local
  post-deinstall: |
    cd /usr/local
  install: "#!/bin/sh\n\n: ${PREFIX:=\"/usr/local\"}\n: ${CSYNC2_DBDIR:=\"/var/db/csync2\"}\n:
    ${CSYNC2_BACKUPDIR:=\"/var/backups/csync2\"}\n\ncreate_cert() {\n\n\t_errlog=`mktemp
    /tmp/.${0##*/}.XXXXX`\n\tcode=0\n\n\texec 3>&2 2>${_errlog}\n\n\topenssl genrsa
    -out ${PREFIX}/etc/csync2_ssl_key.pem 1024 || code=1\n\tyes '' | openssl req -new
    -key ${PREFIX}/etc/csync2_ssl_key.pem \\\n\t\t-out /tmp/csync2_ssl_cert.csr ||
    code=1\n\topenssl x509 -req -days 600 -in /tmp/csync2_ssl_cert.csr \\\n\t\t-signkey
    ${PREFIX}/etc/csync2_ssl_key.pem \\\n\t\t-out ${PREFIX}/etc/csync2_ssl_cert.pem
    || code=1\n\n\trm -f /tmp/csync2_ssl_cert.csr\n\n\tif [ ${code} -ne 0 ]; then\n\t\techo
    \"csync2: OpenSSL error occurred:\"\n\t\techo\n\t\tcat ${_errlog}\n\t\techo\n\t\trm
    -f ${_errlog}\n\t\treturn 1\n\tfi\n\n\texec 2>&3\n\n\trm -f ${_errlog}\n\n\tchmod
    600 ${PREFIX}/etc/csync2_ssl_key.pem \\\n\t\t${PREFIX}/etc/csync2_ssl_cert.pem\n\n\techo
    \"csync2: RSA certificate-key pair installed.\"\n\n\treturn 0\n}\n\npre_install()
    {\n\treturn 0\n}\n\npost_install() {\n\n\t[ -n \"${PACKAGE_BUILDING}\" ] && return
    0\n\n\tfor _dir in ${CSYNC2_DBDIR} ${CSYNC2_BACKUPDIR}; do\n\t\t[ ! -d ${_dir}
    ] && mkdir -p -m 700 ${_dir}\n\tdone\n\n\tif [ ! -f ${PREFIX}/etc/csync2_ssl_cert.pem
    ]; then\n\t\tcreate_cert || return $?\n\tfi\n\n\treturn 0\n}\n\n[ $# -eq 2 ] ||
    exit 0\n\ncase $2 in\n\t\"PRE-INSTALL\") pre_install ;;\n\t\"POST-INSTALL\") post_install
    ;;\nesac\n"
