Name: lsyncd
-Version: 2.1.5
+Version: 2.2.2
Release: 0%{?dist}
Summary: File change monitoring and synchronization daemon
Group: Applications/Internet
License: GPLv2+
-URL: http://code.google.com/p/lsyncd/
+URL: https://github.com/axkibe/lsyncd/
-Source0: http://lsyncd.googlecode.com/files/%{name}-%{version}.tar.gz
+Source0: %{name}-%{version}.tar.gz
-# https://github.com/axkibe/lsyncd/issues/220
-Patch0: 0001-Sanitize-mv-arguments.patch
Source1: %{name}.init
Source3: %{name}.sysconfig
Source4: %{name}.logrotate
Source5: %{name}.conf
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: lua-devel >= 5.1.3
BuildRequires: asciidoc
Requires: lua
Requires: rsync, openssh-clients
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts
%description
Lsyncd watches a local directory trees event monitor interface (inotify).
It aggregates and combines events for a few seconds and then spawns one
(or more) process(es) to synchronize the changes. By default this is
rsync.
Lsyncd is thus a light-weight live mirror solution that is comparatively
easy to install not requiring new file systems or block devices and does
not hamper local file system performance.
%prep
%setup -q
-%patch0 -p1
%build
-export CFLAGS="$RPM_OPT_FLAGS -fPIE"
-export LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
-%configure
-make %{?_smp_mflags}
+cd build
+cmake ..
+make
%install
rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/bin
+install -c build/lsyncd $RPM_BUILD_ROOT/usr/bin
+mkdir -p $RPM_BUILD_ROOT/usr/share/doc/lsyncd/
+install -c -m 644 examples/lbash.lua examples/lecho.lua examples/lgforce.lua examples/limagemagic.lua examples/lpostcmd.lua examples/lrsync.lua examples/lrsyncssh.lua $RPM_BUILD_ROOT/usr/share/doc/lsyncd/
+mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
+install -c -m 644 doc/manpage/lsyncd.1 $RPM_BUILD_ROOT/usr/share/man/man1/
install -d 0755 %{buildroot}%{_initrddir}
install -p -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/lsyncd
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -d -m 0755 %{buildroot}%{_localstatedir}/run/%{name}
install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name}
install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_mandir}/man1/lsyncd.1*
%doc COPYING ChangeLog examples
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(0755,root,root) %{_initrddir}/%{name}
%dir %{_localstatedir}/run/%{name}
%dir %{_localstatedir}/log/%{name}
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_bindir}/lsyncd
%exclude %{_docdir}/lsyncd
%post
/sbin/chkconfig --add %{name}
%preun
if [ "$1" -eq 0 ]; then
/sbin/service %{name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{name}
fi
%postun
if [ "$1" -ge "1" ]; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%changelog
+* Sun Jun 18 2017 Phanx Lee <phanx#sina.com> - 2.2.2-0
+- Update to 2.2.2.