1 Summary: Lsyncd - Live Syncing (Mirror) Daemon
6 Group: Networking/Daemons
7 Source0: https://github.com/axkibe/lsyncd/archive/release-%{version}/%{name}-%{version}.tar.gz
8 # Source0-md5: 25d36b73946bec822d5c7f258262d9f3
11 Source2: %{name}.sysconfig
12 Source3: %{name}.logrotate
13 URL: https://github.com/axkibe/lsyncd
15 BuildRequires: libstdc++-devel
16 BuildRequires: libxml2-devel
17 BuildRequires: lua53-devel
19 Requires: rsync >= 3.1
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 Lsyncd uses rsync to synchronize local directories with a remote
24 machine running rsyncd. Lsyncd watches multiple directories trees
25 through inotify. The first step after adding the watches is to rsync
26 all directories with the remote host, and then sync single file by
27 collecting the inotify events. So lsyncd is a light-weight live mirror
28 solution that should be easy to install and use while blending well
32 %setup -q -n %{name}-release-%{version}
43 rm -rf $RPM_BUILD_ROOT
44 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,logrotate.d,sysconfig},/var/log,%{_mandir}/man1}
45 %{__make} -C build install \
46 DESTDIR=$RPM_BUILD_ROOT
48 touch $RPM_BUILD_ROOT/var/log/%{name}
49 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
50 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
51 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
54 rm -rf $RPM_BUILD_ROOT
57 /sbin/chkconfig --add lsyncd
58 %service lsyncd restart "lsync server"
61 if [ "$1" = "0" ]; then
63 /sbin/chkconfig --del lsyncd
67 %defattr(644,root,root,755)
69 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
70 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
71 %attr(755,root,root) %{_bindir}/%{name}
72 %{_mandir}/man1/lsyncd.1*
73 %attr(640,root,root) %ghost /var/log/%{name}
74 %attr(754,root,root) /etc/rc.d/init.d/lsyncd