1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

New port: sysutils/clsync

clsync is a utility that initatiates automatic rsync transfers after
detection of filesystem changes

Caution: port may have rough edges. Its FreeBSD support is very new.
This commit is contained in:
Mark Felder 2014-06-09 19:31:27 +00:00
parent facdcbbf1e
commit 3f9fd6b9dc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=357197
7 changed files with 149 additions and 0 deletions

View File

@ -119,6 +119,7 @@
SUBDIR += clone
SUBDIR += clonehdd
SUBDIR += cloop-utils
SUBDIR += clsync
SUBDIR += cmdwatch
SUBDIR += cmogstored
SUBDIR += cmospwd

75
sysutils/clsync/Makefile Normal file
View File

@ -0,0 +1,75 @@
# Created by: Dmitry Yu Okunev dyokunev@ut.mephi.ru
# $FreeBSD$
PORTNAME= clsync
DISTVERSION= 0.4~rc2
CATEGORIES= sysutils
MAINTAINER= dyokunev@ut.mephi.ru
COMMENT= Live file sync daemon based on inotify, written in GNU C
LICENSE= GPLv3
LIB_DEPENDS= libinotify.so:${PORTSDIR}/devel/libinotify
GNU_CONFIGURE= yes
USES= gmake libtool pkgconfig
USE_GNOME= glib20
USE_RC_SUBR= clsync
SUB_FILES= pkg-message
USE_GITHUB= yes
GH_ACCOUNT= xaionaro
GH_PROJECT= clsync
GH_COMMIT= 15501e4
GH_TAGNAME= ${GH_COMMIT}
USE_AUTOTOOLS= autoconf aclocal automake libtoolize
OPTIONS_DEFINE= PARANOID VERYPARANOID SOCKET DEBUG LIBCLSYNC
PARANOID_DESC= Enable paranoid secure routines
VERYPARANOID_DESC=Enable extra paranoid secure routines and disable some extra features
SOCKET_DESC= Enable control socket support
LIBCLSYNC_DESC= Build libclsync.so for control socket clients
OPTIONS_DEFAULT=PARANOID
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MVERYPARANOID}
CONFIGURE_ARGS+= --enable-paranoid=2
.else
.if ${PORT_OPTIONS:MPARANOID}
CONFIGURE_ARGS+= --enable-paranoid=1
.else
CONFIGURE_ARGS+= --enable-paranoid=0
.endif
.endif
.if ${PORT_OPTIONS:MSOCKET}
CONFIGURE_ARGS+= --enable-socket
.endif
.if ${PORT_OPTIONS:MDEBUG}
CONFIGURE_ARGS+= --enable-debug
.endif
.if ${PORT_OPTIONS:MLIBCLSYNC}
CONFIGURE_ARGS+= --enable-libclsync
.endif
.include <bsd.port.pre.mk>
pre-configure:
cd "${WRKSRC}" && ${AUTORECONF} -fi
do-install:
@${INSTALL_SCRIPT} ${WRKSRC}/clsync ${STAGEDIR}/${PREFIX}/sbin/clsync
${INSTALL_DATA} ${WRKSRC}/man/man1/clsync.1 ${STAGEDIR}/${PREFIX}/man/man1/clsync.1
${MKDIR} ${STAGEDIR}/${ETCDIR}
${INSTALL_DATA} ${WRKSRC}/freebsd/usr/local/etc/clsync/${PORTNAME}.conf ${STAGEDIR}/${ETCDIR}/${PORTNAME}.conf
.include <bsd.port.post.mk>

2
sysutils/clsync/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (clsync-0.4~rc2.tar.gz) = 86adce37978d4e69525b729943b62a4a0e74196832fb812ad50cc8a58d35dccb
SIZE (clsync-0.4~rc2.tar.gz) = 142026

View File

@ -0,0 +1,56 @@
#!/bin/sh
# $FreeBSD:
# PROVIDE: clsync
# REQUIRE: FILESYSTEMS
# KEYWORD: shutdown
. /etc/rc.subr
name=clsync
rcvar=clsync_enable
load_rc_config $name
start_cmd=clsync_start
start_precmd=clsync_prestart
stop_cmd=clsync_stop
restart_cmd=clsync_restart
clsync_program="%%PREFIX%%/sbin/clsync"
clsync_prestart()
{
if [ "$clsync_config" = "" ]; then
clsync_config=/usr/local/etc/clsync/clsync.conf
fi
if [ "$clsync_config_groups" = "" ]; then
clsync_config_groups=default
fi
}
clsync_start()
{
for config_group in $clsync_config_groups; do
echo "Running clsync (group ${config_group})."
"${clsync_program}" -f "$clsync_config" -K "$config_block" -b \
--pid-file=/var/run/clsync-"${config_group}".pid
done
}
clsync_stop()
{
for config_group in $clsync_config_groups; do
echo "Stopping clsync (group ${config_group})."
pkill -F /var/run/clsync-"${config_group}".pid
done
}
clsync_restart()
{
clsync_stop
clsync_start
}
run_rc_command "$1"

View File

@ -0,0 +1,8 @@
------------------------------------------------------------------------------
Author: Dmtiry Yu Okunev; e-mail: dyokunev@ut.mephi.ru; PGP: 0x8E30679C
What's left:
1. Edit %%PREFIX%%/etc/clsync/clsync.conf
2. Set clsync_enable="YES" in /etc/rc.conf
Start the program: %%PREFIX%%/etc/rc.d/clsync start
------------------------------------------------------------------------------

View File

@ -0,0 +1,3 @@
file live sync daemon based on inotify, written in GNU C
WWW: https://github.com/xaionaro/clsync

View File

@ -0,0 +1,4 @@
sbin/clsync
man/man1/clsync.1.gz
@sample etc/clsync/clsync.conf
@dirrmtry %%ETCDIR%%