File rsync.spec of Package rsync

#
# spec file for package rsync (Version 3.0.4)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           rsync
BuildRequires:  libacl-devel libpng openslp-devel
%if 0%{?suse_version} > 1020
BuildRequires:  texlive-latex
%else
BuildRequires:  te_ams te_latex
%endif
BuildRequires:  popt-devel zlib-devel
Recommends:     logrotate
License:        GPL v3 or later
Group:          Productivity/Networking/Other
PreReq:         %fillup_prereq %insserv_prereq sed grep
AutoReqProv:    on
Version:        3.0.4
Release:        2.<RELEASE26>
Summary:        Replacement for RCP/mirror that has Many More Features
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}-patches-%{version}.tar.bz2
Source2:        logrotate.rsync
Source3:        rsync.xinetd
Source4:        rsyncd.rc
Source5:        rsyncd.conf
Source6:        rsyncd.secrets
Source7:        NEWS-rsync-3.0.3
Patch3:         system-zlib.diff
Patch4:         rsync-CVE-2011-1097.patch
Url:            http://rsync.samba.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define with_system_zlib 0

%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.



Authors:
--------
    Andrew Tridgell <tridge@samba.org>
    Paul Mackerras <Paul.Mackerras@cs.anu.edu.au>

%prep
%setup -q -b 1
%if %with_system_zlib
rm -f zlib/*.h
%patch3
%endif
%patch4
patch -p1 < patches/acls.diff
patch -p1 < patches/xattrs.diff
patch -p1 < patches/slp.diff
cp %{SOURCE7} .

%build
autoheader
autoconf
%configure \
  --disable-debug \
  --enable-slp \
  --enable-acl-support \
  --enable-xattr-support
make %{?jobs:-j %jobs}
latex tech_report
latex tech_report
dvips tech_report -o tech_report.ps

%install
%makeinstall
rm -f $RPM_BUILD_ROOT/usr/sbin/rsyncd
install -d $RPM_BUILD_ROOT/etc/logrotate.d
install -d $RPM_BUILD_ROOT/etc/init.d
install -d $RPM_BUILD_ROOT/etc/xinetd.d
install -d $RPM_BUILD_ROOT/usr/sbin
ln -sf ../bin/rsync $RPM_BUILD_ROOT/usr/sbin/rsyncd
install -m 755 support/rsyncstats   $RPM_BUILD_ROOT/usr/bin
install -m 644 %{SOURCE2}     $RPM_BUILD_ROOT/etc/logrotate.d/rsync
install -m 644 %{SOURCE3}     $RPM_BUILD_ROOT/etc/xinetd.d/rsync
install -m 755 %{SOURCE4}     $RPM_BUILD_ROOT/etc/init.d/rsyncd
install -m 644 %{SOURCE5}     $RPM_BUILD_ROOT/etc/rsyncd.conf
install -m 600 %{SOURCE6}     $RPM_BUILD_ROOT/etc/rsyncd.secrets
ln -sf ../../etc/init.d/rsyncd                $RPM_BUILD_ROOT/usr/sbin/rcrsyncd

%preun
%stop_on_removal rsyncd

%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

%postun
%restart_on_update rsyncd
%insserv_cleanup

%files
%defattr(-,root,root)
%config(noreplace) /etc/rsyncd.conf
%config(noreplace) /etc/rsyncd.secrets
%config(noreplace) /etc/logrotate.d/rsync
%config(noreplace) /etc/xinetd.d/rsync
%config /etc/init.d/rsyncd
%{_sbindir}/rcrsyncd
%{_sbindir}/rsyncd
%{_bindir}/rsyncstats
%{_bindir}/rsync
%doc %{_mandir}/man1/rsync.1.gz
%doc %{_mandir}/man5/rsyncd.conf.5.gz
%doc COPYING NEWS NEWS-rsync-3.0.3 README tech_report.ps tech_report.tex

%changelog
* Wed Oct 08 2008 puzel@suse.cz
- fix build: do not run tests as they fail in chrooted environment
* Mon Sep 22 2008 puzel@suse.cz
- update to 3.0.4
  - update to stable release
- removed rsync-3.0.4pre2-xattrs-test-fix.patch
  - fixed in upstream
* Thu Sep 04 2008 puzel@suse.cz
- update to 3.0.4pre2
  - Fixed the handling of a --partial-dir that cannot be created.
  - Fixed a couple issues in the --fake-super handling of xattrs when the
  destination files have root-level attributes (e.g. selinux values) that
  a non-root copy can't affect.
  - The --iconv option now converts the content of a symlink too, instead
  of leaving it in the wrong character-set.
  - Fixed a bug where --delete-during could delete in a directory before it
  noticed that the sending side sent an I/O error for that directory.
  - Fixed a crash bug in the hard-link code.
  - Fixed the sending of xattr directory information when the code finds a
    --link-dest or --copy-dest directory with unchanged xattrs
  - Fixed deletion handling when copying a single, empty directory (with no
  files) to a differently named, non-existent directory.
  - too many other changes and fixes - please, see NEWS and NEWS-rsync-3.0.3
  files
- specfile fixes :
  - use %%configure and %%makeinstall macros
  - use %%_bindir and %%sbindir macros
- removed lutimes-hack.diff (not needed anymore)
- removed rsync-patches-3.0.2.dif (fixed in upstream)
* Tue Aug 12 2008 puzel@suse.cz
- rsyncd.rc: use Should-Start instead of X-UnitedLinux-Should-Start
- specfile fixes:
  * added Should-Stop
  * 'make test' moved to %%check
  * recommend logrotate
* Mon Apr 14 2008 ro@suse.de
- update to version 3.0.2
  - Fixed a potential buffer overflow in the xattr code.
- update to version 3.0.1
  - Added the 'c'-flag to the itemizing of non-regular files so that the
  itemized output doesn't get hidden if there were no attribute changes,
  and also so that the itemizing of a --copy-links run will distinguish
  between copying an identical non-regular file and the creation of a
  revised version with a new value (e.g. a changed symlink referent, a
  new device number, etc.).
  - quite a lot of other bugfixes, please see OLDNEWS file
* Tue Mar 11 2008 ro@suse.de
- update to version 3.0.0 (shortened, more details see NEWS file)
  - The handling of implied directories when using --relative has changed to
  send them as directories (e.g. no implied dir is ever sent as a symlink).
  - Requesting a remote file-listing without specifying -r (--recursive) now
  sends the -d (--dirs) option to the remote rsync rather than sending -r
  along with an extra exclude of /*/*.
  - In --dry-run mode, the last line of the verbose summary text is output
  with a "(DRY RUN)" suffix to help remind you that no updates were made.
  Similarly, --only-write-batch outputs "(BATCH ONLY)".
  - A writable rsync daemon with "use chroot" disabled now defaults to a
  symlink-munging behavior designed to make symlinks safer while also
  allowing absolute symlinks to be stored and retrieved.
  - Starting up an extra copy of an rsync daemon will not clobber the pidfile
  for the running daemon -- if the pidfile exists, the new daemon will exit
  with an error.
- re-applied patches from upstream kit:
  - acls.diff,xattrs.diff,slp.diff
- removed patches:
  - rsync-overlong.patch (upstream code cleaned up)
  - lutimes-hack.diff (should not be needed any more)
  - rsync-fix_fuzzy.patch (fixed upstream)
  - rsync-hlink_crash.patch (upstream cleaned up)
  - munge-symlinks-2.6.9.diff (integrated upstream)
* Tue Dec 04 2007 ro@suse.de
- added munge-symlinks patch (#345507) CVE-2007-6199
* Thu Nov 08 2007 ro@suse.de
- fix uninitialized struct sx in hlink.c:hard_link_cluster
  to prevent crash when using acls (#338358)
* Fri Sep 14 2007 ro@suse.de
- fix (#300526) restart will start standalone rsync if running
  under xinetd
  - use a pid file for rsyncd in init script so that rcrsyncd
  will not show status running for an rsync started by xinetd
  - insert "pid file" entry into rsyncd.conf if not present
* Wed Sep 12 2007 dmueller@suse.de
- build parallel
- fix hardlinks accross partition
* Mon Sep 10 2007 ro@suse.de
- fix abort in rsync when acls and fuzzy are used together
  (#306263)
* Fri Aug 17 2007 cthiel@suse.de
- added lutimes-hack.diff to work around a glibc bug in lutimes.c
* Thu Aug 02 2007 ro@suse.de
- protect from overlong filenames (#294073) CVE-2007-4091
* Mon May 14 2007 mrueckert@suse.de
- make build work on older distros again.
* Tue May 08 2007 dmueller@suse.de
- use builtin zlib copy again
* Tue May 08 2007 dmueller@suse.de
- update to 2.6.9:
  * several important bugfixes
  * new features, see included NEWS file
- build against system zlib instead of own zlib copy
- build against system popt instead of own popt copy
* Thu Apr 19 2007 aj@suse.de
- Use texlive for building.
* Tue Sep 12 2006 ro@suse.de
- apply fix for xattr.diff from rsync mailing list
* Tue Aug 22 2006 ro@suse.de
- apply patches/xattr.diff as well (fate#300565)
* Thu Aug 10 2006 dmueller@suse.de
- fix rc script error code when there's an error in the config
  file (#198406)
* Wed Jun 21 2006 ro@suse.de
- added tag-3 patch from cvs (will be in 2.6.9)
  to avoid aborts with "unexpected tag 3"
* Mon Jun 12 2006 ro@suse.de
- update to version 2.6.8
  - use slp patch as included upstream
  - several bugfixes
  - errors now include version number
  - special files as pipes now printed as "S", no longer "D"
  - escaping of unreadable chars has changed
  - new --append, --min-size and --prune-empty-dirs options
* Tue Apr 18 2006 ro@suse.de
- ignore testsuite failure on s390x (filesystem mtimes)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Jan 19 2006 schwab@suse.de
- Don't strip binaries.
* Fri Oct 14 2005 ro@suse.de
- fix problem in configure to re-enable ACLs (#128323)
* Tue Aug 02 2005 ro@suse.de
- added acl-fix.patch from wayne to make testsuite pass with acls
* Fri Jul 29 2005 ro@suse.de
- update to 2.6.6
* Mon Jun 06 2005 ro@suse.de
- update to 2.6.5
- use acl patch as shipped in rsync/patches directory
* Fri Feb 18 2005 mmj@suse.de
- Glibc doesn't cache the timezone as much as it used to, so export
  the TZ variable after doing chroot. [#49878]
* Thu Feb 10 2005 ro@suse.de
- added libpng to neededforbuild (for tetex)
* Wed Dec 01 2004 ro@suse.de
- re-register before SLP really times out
* Wed Dec 01 2004 ro@suse.de
- re-worked slp.diff
  do not use a timer but hook into central select call
* Thu Nov 11 2004 ro@suse.de
- update to 2.6.3 final
* Mon Aug 16 2004 bk@suse.de
- updated to 2.6.3-pre1, which is currently in release-testing
  (and includes a security fix)
* Fri Jul 23 2004 ro@suse.de
- fixing problems apparently introduced with the update to 2.6.2:
- fix from cvs to not abort trying to create already created
  backup directories (#42780)
- fix from cvs to avoid crash on large trees (#42933)
* Mon May 10 2004 ro@suse.de
- update to 2.6.2 / ported patches
- fixes a problem with non-chroot modules
* Thu Apr 01 2004 mls@suse.de
- fix hostname calculation in slp registration code
* Tue Mar 16 2004 ro@suse.de
- add -4 and -6 options to manpage (#36144)
* Tue Jan 13 2004 ro@suse.de
- update to version 2.6.0
* Thu Dec 04 2003 ro@suse.de
- update to real 2.5.7
* Thu Dec 04 2003 okir@suse.de
- fix heap overflow (#33478)
* Sun Nov 23 2003 adrian@suse.de
- add patch for SLP support, based on Brad Hards demo implementation
* Thu Nov 06 2003 schwab@suse.de
- Fix quoting in configure script.
* Fri Oct 24 2003 ro@suse.de
- added make test
- added acl patch, build with acl support
* Fri Oct 17 2003 ro@suse.de
- don't build as root
* Mon Aug 18 2003 ro@suse.de
- added stop_on_removal and restart_on_update macro calls
* Tue May 13 2003 ro@suse.de
- use defattr
* Wed Mar 05 2003 ro@suse.de
- add xinetd-config to filelist
* Tue Jan 28 2003 ro@suse.de
- update to 2.5.6
- can combine ssh and daemon access
- supports URL like syntax rsync://
- IPv6 support in hosts.allow/deny
- recursive hang fixed upstream
* Fri Jan 24 2003 ro@suse.de
- added xinetd-config snippet
* Wed Jan 15 2003 ro@suse.de
- added logrotate config
* Tue Oct 08 2002 ro@suse.de
- fix recursive hangup in server process on broken pipe
* Wed Aug 14 2002 poeml@suse.de
- fix comment in init script
* Thu Aug 01 2002 ro@suse.de
- use BuildRoot
- added PreReqs
* Mon Jul 22 2002 kukuk@suse.de
- Don't source /etc/rc.config in init script [Bug 17123]
* Mon Jun 17 2002 ro@suse.de
- update to 2.5.5
  setgroups patch removed, has been integrated
  zfree patch removed, rsync has current zlib fixes
  unsigned patch removed, has been integrated
* Wed Mar 06 2002 okir@suse.de
- applied setgroups security fix
* Fri Feb 08 2002 okir@suse.de
- applied zlib security fix
* Wed Feb 06 2002 ro@suse.de
- make rsyncd a hardlink (#13041)
* Fri Feb 01 2002 ro@suse.de
- added patch for segmentation fault
* Mon Jan 21 2002 draht@suse.de
- corrected diff for log.c
* Mon Jan 21 2002 ro@suse.de
- applied security patch for various signed/unsigned fixes
* Fri Dec 14 2001 ro@suse.de
- removed START_RSYNCD
* Tue Aug 28 2001 ro@suse.de
- on uninstall, call insserv to cleanup
* Tue Aug 28 2001 ro@suse.de
- added rc-script and rc-config variable START_RSYNCD
  if someone wants to run rsyncd standalone (w/o inetd) (#9496)
* Mon Sep 25 2000 ro@suse.de
- sorted
* Wed Sep 13 2000 aj@suse.de
- Work with LFS; fix spec file to not print while building.
* Mon Sep 11 2000 ro@suse.de
- update to 2.4.6
* Fri Aug 18 2000 ro@suse.de
- update to 2.4.4
* Thu Jan 20 2000 aj@suse.de
- rsync 2.3.2, install man pages -> /usr/share/man.
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Aug 13 1999 fehr@suse.de
- update to 2.3.1
- added rsyncstats shell script
* Thu Dec 17 1998 ro@suse.de
- update to 2.2.1
* Sun Nov 29 1998 bs@suse.de
- added symlink /usr/sbin/rsyncd (to let it work with tcpd)
- added example configs
* Tue Nov 24 1998 ro@suse.de
- update to 2.2.0
* Sat Sep 19 1998 ro@suse.de
- defined _GNU_SOURCE where getopt_long is needed
* Mon Aug 24 1998 ro@suse.de
- update to 2.1.0
  added manpage for rsyncd.conf
* Tue May 12 1998 ro@suse.de
- update to 1.7.4
  generate tech_report.ps from tex-src
* Tue Nov 11 1997 kfr@suse.de
- first version for S.u.S.E. (1.6.3)