From owner-svn-ports-head@freebsd.org Sun Jun 10 10:30:17 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDA7F1010F12; Sun, 10 Jun 2018 10:30:16 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B9A77A41E; Sun, 10 Jun 2018 10:30:16 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C881394A; Sun, 10 Jun 2018 10:30:16 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5AAUGXb028963; Sun, 10 Jun 2018 10:30:16 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5AAUE9b028954; Sun, 10 Jun 2018 10:30:14 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201806101030.w5AAUE9b028954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Sun, 10 Jun 2018 10:30:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r472128 - in head/sysutils: . lsyncd lsyncd/files X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head/sysutils: . lsyncd lsyncd/files X-SVN-Commit-Revision: 472128 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2018 10:30:17 -0000 Author: tobik Date: Sun Jun 10 10:30:14 2018 New Revision: 472128 URL: https://svnweb.freebsd.org/changeset/ports/472128 Log: New port: sysutils/lsyncd Lsyncd is designed to synchronize a local directory tree with low profile of expected changes to a remote mirror. Lsyncd is especially useful to sync data from a secure area to a not-so-secure area. WWW: https://axkibe.github.io/lsyncd/ PR: 228714 Submitted by: Junichi Satoh Added: head/sysutils/lsyncd/ head/sysutils/lsyncd/Makefile (contents, props changed) head/sysutils/lsyncd/distinfo (contents, props changed) head/sysutils/lsyncd/files/ head/sysutils/lsyncd/files/lsyncd.conf.sample (contents, props changed) head/sysutils/lsyncd/files/lsyncd.in (contents, props changed) head/sysutils/lsyncd/files/patch-CMakeLists.txt (contents, props changed) head/sysutils/lsyncd/files/patch-default-rsync.lua (contents, props changed) head/sysutils/lsyncd/files/patch-lsyncd.c (contents, props changed) head/sysutils/lsyncd/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sun Jun 10 10:28:59 2018 (r472127) +++ head/sysutils/Makefile Sun Jun 10 10:30:14 2018 (r472128) @@ -626,6 +626,7 @@ SUBDIR += lscpu SUBDIR += lsof SUBDIR += lsop + SUBDIR += lsyncd SUBDIR += ltrace SUBDIR += lttng-tools SUBDIR += lttng-ust Added: head/sysutils/lsyncd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/Makefile Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +PORTNAME= lsyncd +DISTVERSIONPREFIX= release- +DISTVERSION= 2.2.3 +CATEGORIES= sysutils + +MAINTAINER= junichi@junichi.org +COMMENT= Live Syncing (Mirror) Daemon + +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING + +LIB_DEPENDS= libinotify.so:devel/libinotify + +USES= cmake:outsource localbase lua +USE_GITHUB= yes +GH_ACCOUNT= axkibe +USE_RC_SUBR= lsyncd + +CFLAGS+= -D__BSD_VISIBLE # for DT_{UNKNOWN,DIR} +PLIST_FILES= sbin/lsyncd \ + man/man1/lsyncd.1.gz \ + "@sample etc/lsyncd.conf.sample" + +post-patch: + @${REINPLACE_CMD} 's,/usr/local,${LOCALBASE},' \ + ${WRKSRC}/CMakeLists.txt \ + ${WRKSRC}/default-rsync.lua + +post-install: + ${INSTALL_DATA} ${FILESDIR}/lsyncd.conf.sample ${STAGEDIR}${PREFIX}/etc + +.include Added: head/sysutils/lsyncd/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/distinfo Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,3 @@ +TIMESTAMP = 1528626572 +SHA256 (axkibe-lsyncd-release-2.2.3_GH0.tar.gz) = 7bcd0f4ae126040bb078c482ff856c87e61c22472c23fa3071798dcb1dc388dd +SIZE (axkibe-lsyncd-release-2.2.3_GH0.tar.gz) = 85165 Added: head/sysutils/lsyncd/files/lsyncd.conf.sample ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/files/lsyncd.conf.sample Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,19 @@ +settings { + logfile = "/var/log/lsyncd.log", + statusFile = "/var/log/lsyncd.status", + statusInterval = 1, + maxProcesses = 2, + insist = 1, +} + +sync{ + default.rsync, + delay = 0, + source = "/data/test1", + target = "some_host::test1", + rsync = { + archive = true, + compress = true + }, + delete = true +} Added: head/sysutils/lsyncd/files/lsyncd.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/files/lsyncd.in Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: lsyncd +# REQUIRE: LOGIN +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable `lsyncd': +# +# lsyncd_enable="YES" +# + +. /etc/rc.subr + +name="lsyncd" +rcvar=lsyncd_enable + +command="%%PREFIX%%/sbin/lsyncd" +pidfile="/var/run/$name.pid" + +# read configuration and set defaults +load_rc_config "$name" +: ${lsyncd_enable="NO"} +: ${lsyncd_configfile:=%%PREFIX%%/etc/$name.conf} + +required_files="${lsyncd_configfile}" + +command_args="-pidfile $pidfile ${lsyncd_configfile}" + +run_rc_command "$1" Added: head/sysutils/lsyncd/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/files/patch-CMakeLists.txt Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,14 @@ +--- CMakeLists.txt.orig 2018-03-09 12:39:11 UTC ++++ CMakeLists.txt +@@ -104,8 +104,8 @@ add_custom_target( tests + + # compiling and linking it all together + add_executable( lsyncd ${LSYNCD_SRC} ) +-target_link_libraries( lsyncd ${LUA_LIBRARIES} ) ++target_link_libraries( lsyncd ${LUA_LIBRARIES} /usr/local/lib/libinotify.so ) + +-install( TARGETS lsyncd RUNTIME DESTINATION bin ) +-install( FILES doc/manpage/lsyncd.1 DESTINATION man ) ++install( TARGETS lsyncd RUNTIME DESTINATION sbin ) ++install( FILES doc/manpage/lsyncd.1 DESTINATION man/man1 ) + Added: head/sysutils/lsyncd/files/patch-default-rsync.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/files/patch-default-rsync.lua Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,11 @@ +--- default-rsync.lua.orig 2018-03-09 12:39:11 UTC ++++ default-rsync.lua +@@ -682,7 +682,7 @@ rsync.exitcodes = default.rsyncExitCode + rsync.rsync = + { + -- The rsync binary to be called. +- binary = '/usr/bin/rsync', ++ binary = '/usr/local/bin/rsync', + links = true, + times = true, + protect_args = true Added: head/sysutils/lsyncd/files/patch-lsyncd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/files/patch-lsyncd.c Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,66 @@ +--- lsyncd.c.orig 2018-03-09 12:39:11 UTC ++++ lsyncd.c +@@ -1614,10 +1614,21 @@ l_configure( lua_State *L ) + openlog( log_ident, 0, settings.log_facility ); + } + ++#ifdef __FreeBSD__ ++ if( !settings.nodaemon ) ++ { ++ // daemonnize is already done before open_inotify with FreeBSD. ++ // just writing pidfile is needed at this time. ++ logstring( "Normal", "--- Startup, daemonizing ---" ); ++ if (settings.pidfile) ++ { ++ write_pidfile( L, settings.pidfile ); ++ } ++ } ++#endif + if( !settings.nodaemon && !is_daemon ) + { + logstring( "Normal", "--- Startup, daemonizing ---" ); +- + daemonize( L, settings.pidfile ); + } + else +@@ -2433,6 +2444,10 @@ main1( int argc, char *argv[] ) + + int argp = 1; + ++#ifdef __FreeBSD__ ++ static bool call_daemonize = true; ++#endif ++ + // load Lua + L = luaL_newstate( ); + +@@ -2482,6 +2497,14 @@ main1( int argc, char *argv[] ) + + while( i < argc ) + { ++#ifdef __FreeBSD__ ++ if (!strcmp (argv[i], "-nodaemon" )) ++ { ++ call_daemonize = false; ++ i++; ++ continue; ++ } ++#endif + if( + strcmp( argv[ i ], "-log" ) && + strcmp( argv[ i ], "--log" ) +@@ -2796,6 +2819,14 @@ main1( int argc, char *argv[] ) + } + } + ++#ifdef __FreeBSD__ ++ // daemonize should be done before open_inofity with FreeBSD. ++ if( call_daemonize ) ++ { ++ daemonize( L, NULL ); ++ } ++#endif ++ + #ifdef WITH_INOTIFY + open_inotify( L ); + #endif Added: head/sysutils/lsyncd/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsyncd/pkg-descr Sun Jun 10 10:30:14 2018 (r472128) @@ -0,0 +1,5 @@ +Lsyncd is designed to synchronize a local directory tree with low +profile of expected changes to a remote mirror. Lsyncd is especially +useful to sync data from a secure area to a not-so-secure area. + +WWW: https://axkibe.github.io/lsyncd/