lsyncd/lsyncd.spec
2023-05-04 16:53:42 +08:00

81 lines
2.6 KiB
RPMSpec

%global _hardened_build 1
%global gittag0 v2.3.1
%global commit0 6d59f16140468242fe157b4a5adf36d6a93cf6a4
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Name: lsyncd
Version: 2.3.1
Release: 1
Summary: File change monitoring and synchronization daemon
License: GPLv2+
URL: https://github.com/axkibe/lsyncd/
Source0: https://github.com/axkibe/%{name}/archive/%{gittag0}/%{name}-%{version}.tar.gz
Patch0: cmake-DOCDIR.patch
Source1: lsyncd.sysconfig
Source2: lsyncd.logrotate
Source3: lsyncd.conf
Source4: lsyncd.service
Source5: lsyncd.sysctl
BuildRequires: asciidoc cmake gcc gcc-c++ lua lua-devel >= 5.2 systemd rsync
Requires: lua rsync
%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
%autosetup -p1
%build
%cmake -DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}
%make_build
%install
%make_install
install -p -d -m 0755 %{buildroot}%{_var}/log/%{name}
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/lsyncd
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/lsyncd
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/lsyncd.conf
install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/lsyncd.service
install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysctldir}/50-lsyncd.conf
%check
%cmake
make
%post
%sysctl_apply 50-lsyncd.conf
%systemd_post lsyncd.service
%preun
%systemd_preun lsyncd.service
%postun
%systemd_postun_with_restart lsyncd.service
%files
%license COPYING
%doc ChangeLog examples README.md
%doc %{_mandir}/man1/lsyncd.1.*
%config(noreplace) %{_sysconfdir}/lsyncd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/lsyncd
%config(noreplace) %{_sysconfdir}/logrotate.d/lsyncd
%{_sysctldir}/50-lsyncd.conf
%{_bindir}/lsyncd
%dir %{_var}/log/%{name}
%{_unitdir}/lsyncd.service
%changelog
* Thu May 4 2023 liyanan <thistleslyn@163.com> - 2.3.1-1
- update to 2.3.1
* Sat Jun 05 2021 maminjie <maminjie1@huawei.com> - 2.2.3-2
- Repair status failure after stopping service
* Wed Jan 20 2021 chengzihan <chengzihan2@huawei.com> - 2.2.3-1
- Package init