Bug 228714 - [NEW PORT] sysutils/lsyncd: Live Syncing (Mirror) Daemon
Summary: [NEW PORT] sysutils/lsyncd: Live Syncing (Mirror) Daemon
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL:
Keywords: feature, patch
Depends on:
Blocks:
 
Reported: 2018-06-03 01:22 UTC by Junichi Satoh
Modified: 2018-06-10 10:31 UTC (History)
2 users (show)

See Also:


Attachments
shar file for sysutils/lsyncd port (7.29 KB, text/plain)
2018-06-03 01:22 UTC, Junichi Satoh
no flags Details
fixed shar file for sysutils/lsyncd port (6.75 KB, text/plain)
2018-06-03 05:31 UTC, Junichi Satoh
no flags Details
re-corrected shar file for sysutils/lsyncd port (6.08 KB, text/plain)
2018-06-09 22:09 UTC, Junichi Satoh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Junichi Satoh 2018-06-03 01:22:14 UTC
Created attachment 193956 [details]
shar file for sysutils/lsyncd port

Lsyncd is designed to synchronize a local directory tree with low profile of expected changes to a remote mirror.

Details are here:
https://axkibe.github.io/lsyncd/
Comment 1 Mateusz Piotrowski freebsd_committer 2018-06-03 01:49:45 UTC
Hello :)

I've got a couple suggestions:
 * Replace the current MASTER_SITES with USE_GITHUB.[1]
 * Define LICENSE_FILE if it's available.
 * Remove the "Created by..." line. It should not be included in new ports.

[1]: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#makefile-master_sites-github-description
Comment 2 Junichi Satoh 2018-06-03 05:31:47 UTC
Created attachment 193960 [details]
fixed shar file for sysutils/lsyncd port
Comment 3 Junichi Satoh 2018-06-03 05:33:47 UTC
(In reply to Mateusz Piotrowski from comment #1)

Thanks for suggestions.
I've fixed them and also updated some codes.

I attached the fixed shar file.
Comment 4 Tobias Kortkamp freebsd_committer 2018-06-03 06:35:54 UTC
X+#ifdef __FreeBSD__
X+#include </usr/local/include/sys/inotify.h>
X+#else

This is incorrect on many levels.  Why can't it find sys/inotify.h
without this?  Maybe you need to add USES=localbase or
USES=localbase:ldflags to the port.

X+	// daemonize should be done before open_inofity with FreeBSD.

Hmm, why?

X: ${lsyncd_configfile:=/usr/local/etc/$name.conf}

Replace /usr/local with %%PREFIX%%.

XUSES=		cmake lua

cmake:outsource is preferred.

X.include <bsd.port.pre.mk>

Not necessary here.

XPLIST_FILES=	sbin/lsyncd man/man1/lsyncd.1.gz etc/lsyncd.conf.sample

lsyncd.conf.sample should probably have an @sample keyword.

XLICENSE=	GPLv2

This should be GPLv2+ as they allow later version of the GPL.

X+#ifdef __FreeBSD__
X+#define DT_UNKNOWN 0
X+#define DT_DIR 4
X+#endif

Why is this needed?  These should be defined in sys/dirent.h on
FreeBSD.  If lsyncd defines _XOPEN_SOURCE (or similar things that
may hide some definitions) maybe try removing that instead.

XLIB_DEPENDS+=	libinotify.so:devel/libinotify

This needs to go after BUILD_DEPENDS. Use = not +=.
Comment 5 Junichi Satoh 2018-06-09 22:09:26 UTC
Created attachment 194120 [details]
re-corrected shar file for sysutils/lsyncd port
Comment 6 Junichi Satoh 2018-06-09 22:27:57 UTC
(In reply to Tobias Kortkamp from comment #4)

I've fixed them except daemonize.

About daemonize, if it's done after open_inotify() like original source, lsyncd doesn't work correctly on FreeBSD even if it's compiled without errors.
The lsyncd which is compiled with original source can't receive events for file updating. So, pselect() in mail loop waits events forever.

Because, I don't know details of differences between Linux's inotify and libinotify, I don't know that exact reason.
Comment 7 commit-hook freebsd_committer 2018-06-10 10:30:30 UTC
A commit references this bug:

Author: tobik
Date: Sun Jun 10 10:30:16 UTC 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 <junichi@junichi.org>

Changes:
  head/sysutils/Makefile
  head/sysutils/lsyncd/
  head/sysutils/lsyncd/Makefile
  head/sysutils/lsyncd/distinfo
  head/sysutils/lsyncd/files/
  head/sysutils/lsyncd/files/lsyncd.conf.sample
  head/sysutils/lsyncd/files/lsyncd.in
  head/sysutils/lsyncd/files/patch-CMakeLists.txt
  head/sysutils/lsyncd/files/patch-default-rsync.lua
  head/sysutils/lsyncd/files/patch-lsyncd.c
  head/sysutils/lsyncd/pkg-descr