File rsync.spec of Package rsync

# This .spec file for rsync specifically and intentionally does not
# include the SLP patches that SUSE adds to the official SUSE rsync
# package. Normal rsync binaries choke on the extra config file
# options added by the SUSE package. This breaks or complicates
# some kinds of deployments.
# If/when the upstream stock rsync gets modified to gracefully
# ignore unrecognized config options instead of dying immediately
# when they are encountered, or if/when the SLP patches and the SUSE
# packaging are modified so that the SLP config file options appear
# as special comments instead of regular options, then it will be
# possible to include the SLP patches again.
# brian@aljex.com

Name:           rsync
Version:        3.1.2
Release:        1
Summary:        Replacement for RCP/mirror that has Many More Features
License:        GPL v2 or later
Group:          Productivity/Networking/Other
Source:         %{name}-%{version}.tar.gz
Source1:        logrotate.%name
Source2:        %{name}.xinetd
Source3:        %{name}d.rc
Source4:        %{name}d.conf
Source5:        %{name}d.secrets
Source6:        %{name}.firewall
Url:            http:/rsync.samba.org/
PreReq:         %insserv_prereq
AutoReqProv:    on
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libpng libacl-devel popt-devel zlib-devel

%if 0%{?suse_version} >= 1010
Recommends: logrotate
%endif

%if 0%{?suse_version} > 1020
BuildRequires:  texlive-latex
%else
BuildRequires:  te_ams te_latex
%endif

%if %{?_initddir:0}%{!?_initddir:1}
%define _initddir %_initrddir
%endif

%description
rsync uses the "rsync algorithm" which provides a very fast method for
bringing remote files into sync. It does this by sending just the
differences in the files across the link, without requiring that both
sets of files be present at one of the ends of the link beforehand. At
first glance, this may seem impossible because the calculation of diffs
between two files normally requires local access to both files.

A technical report describing the rsync algorithm is included with this
package.

%prep
%setup

%build
%configure --with-included-zlib=no
%__make %{?_smp_mflags}
%__strip %name
latex tech_report
dvips tech_report -o tech_report.ps

%check
%__make test

%install
%__make install DESTDIR=%buildroot

%__install -m 755 support/%{name}stats %{buildroot}%_bindir

%__install -d %{buildroot}%_sbindir
%__ln_s -f %{_bindir}/%name %{buildroot}%{_sbindir}/%{name}d

%__install -d %{buildroot}/%_sysconfdir
%__install -m 644 %{S:4} %{buildroot}/%{_sysconfdir}/%{name}d.conf
%__install -m 600 %{S:5} %{buildroot}/%{_sysconfdir}/%{name}d.secrets

%__install -d %{buildroot}/%{_sysconfdir}/logrotate.d
%__install -m 644 %{S:1} %{buildroot}/%{_sysconfdir}/logrotate.d/%name

%__install -d %{buildroot}/%{_sysconfdir}/xinetd.d
%__install -m 644 %{S:2} %{buildroot}/%{_sysconfdir}/xinetd.d/%name

%__install -d %{buildroot}%_initddir
%__install -m 755 %{S:3} %{buildroot}%{_initddir}/%{name}d
%__ln_s -f %{_initddir}/%{name}d %{buildroot}%{_sbindir}/rc%{name}d

%__install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
%__install -m 644 %{S:6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%name

%preun
%stop_on_removal %{name}d

%post
%fillup_and_insserv %{name}d
%__grep -q "^pid file" /etc/rsyncd.conf || %__sed -i -e "/^log file/{;p;s@\(.*\)@pid file = /var/run/rsyncd.pid@;}" /etc/rsyncd.conf

%postun
%restart_on_update %{name}d
%insserv_cleanup

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/%{name}d.conf
%config(noreplace) %{_sysconfdir}/%{name}d.secrets
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%name
%{_initddir}/%{name}d
%{_bindir}/%{name}
%{_bindir}/%{name}stats
%{_sbindir}/%{name}d
%{_sbindir}/rc%{name}d
%doc %{_mandir}/*/*
%doc COPYING NEWS README tech_report.ps tech_report.tex

%changelog