SHA256
1
0
forked from pool/rsync

Accepting request 95218 from home:elvigia:branches:network

- Add systemd unit
- Do not BuildRequire textlive

OBS-URL: https://build.opensuse.org/request/show/95218
OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=18
This commit is contained in:
Vítězslav Čížek 2011-12-06 16:29:22 +00:00 committed by Git OBS Bridge
parent 2cb3837a14
commit 182acd71ce
3 changed files with 43 additions and 11 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 25 01:38:07 UTC 2011 - crrodriguez@opensuse.org
- Add systemd unit
- Do not BuildRequire textlive
-------------------------------------------------------------------
Wed Oct 12 03:40:40 UTC 2011 - crrodriguez@opensuse.org

View File

@ -36,9 +36,9 @@ Source4: rsyncd.rc
Source5: rsyncd.conf
Source6: rsyncd.secrets
Source7: rsync-server.firewall
Source8: rsyncd.service
Patch3: system-zlib.diff
BuildRequires: libacl-devel
BuildRequires: libpng
BuildRequires: openslp-devel
BuildRequires: popt-devel
BuildRequires: zlib-devel
@ -47,15 +47,14 @@ PreReq: %insserv_prereq
PreReq: grep
PreReq: sed
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1020
BuildRequires: texlive-latex
%else
BuildRequires: te_ams
BuildRequires: te_latex
%endif
%if 0%{?suse_version} > 1010
Recommends: logrotate
%endif
%if 0%{?suse_version} > 1140
BuildRequires: systemd
%{?systemd_requires}
%define has_systemd 1
%endif
%description
Rsync is a fast and extraordinarily versatile file copying tool. It can copy
@ -87,9 +86,6 @@ autoconf
--enable-acl-support \
--enable-xattr-support
make %{?_smp_mflags}
latex tech_report
latex tech_report
dvips tech_report -o tech_report.ps
%install
%if 0%{?suse_version} < 1120
@ -112,25 +108,45 @@ install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets
ln -sf ../../etc/init.d/rsyncd %{buildroot}%{_sbindir}/rcrsyncd
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/rsync-server
%if 0%{?has_systemd}
install -D -m 0644 %SOURCE8 %{buildroot}%{_unitdir}/rsyncd.service
%endif
%pre
%if 0%{?has_systemd}
%service_add_pre rsyncd.service
%endif
%preun
%stop_on_removal rsyncd
%if 0%{?has_systemd}
%service_del_preun rsyncd.service
%endif
%post
%fillup_and_insserv rsyncd
if ! grep -q "^pid file" /etc/rsyncd.conf ; then
sed -i -e "/^log file/{;p;s@\(.*\)@pid file = /var/run/rsyncd.pid@;}" /etc/rsyncd.conf
fi
%if 0%{?has_systemd}
%service_add_post rsyncd.service
%endif
%postun
%restart_on_update rsyncd
%insserv_cleanup
%if 0%{?has_systemd}
%service_del_postun rsyncd.service
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%if 0%{?has_systemd}
%{_unitdir}/rsyncd.service
%endif
%config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/rsyncd.secrets
%config(noreplace) %{_sysconfdir}/logrotate.d/rsync
@ -143,6 +159,6 @@ rm -rf %{buildroot}
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/*
%doc %{_mandir}/man1/rsync.1.gz
%doc %{_mandir}/man5/rsyncd.conf.5.gz
%doc COPYING NEWS README tech_report.ps tech_report.tex
%doc COPYING NEWS README tech_report.tex
%changelog

10
rsyncd.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Start the rsync server daemon
After=network.target
[Service]
ExecStart=/usr/sbin/rsyncd --daemon --no-detach
IOSchedulingClass=idle
CPUSchedulingPolicy=batch
[Install]
WantedBy=multi-user.target