# # - File-Rsync - # This spec file was automatically generated by cpan2rpm [ver: 2.028] # The following arguments were used: # --keep-pipes http://search.cpan.org/CPAN/authors/id/L/LE/LEAKIN/File-Rsync-0.43.tar.gz 2>&1 # For more information on cpan2rpm please visit: http://perl.arix.com/ # %define pkgname File-Rsync %define filelist %{pkgname}-%{version}-filelist %define NVR %{pkgname}-%{version}-%{release} %define maketest 1 name: perl-File-Rsync summary: File-Rsync - Wrapper module for rsync(1) http://rsync.samba.org/ version: 0.43 release: 1 vendor: Lee Eakin packager: Arix International license: Artistic group: Applications/CPAN url: http://www.cpan.org buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n) buildarch: noarch prefix: %(echo %{_prefix}) source: http://search.cpan.org/CPAN/authors/id/L/LE/LEAKIN/File-Rsync-0.43.tar.gz %description Perl Convenience wrapper for the rsync(1) program. Written for *rsync-2.3.2* and updated for *rsync-2.6.0* but should perform properly with most recent versions. =over 4 =item File::Rsync::new $obj = *new* File::Rsync; or $obj = File::Rsync->*new*; or $obj = File::Rsync->new(@options); or $obj = File::Rsync->new(\%options); Create a *File::Rsync* object. Any options passed at creation are stored in the object as defaults for all future *exec* calls on that object. Options may be passed in the form of a hash and are the same as the long options in *rsync(1)* with the leading double-dash removed. An additional option of path-to-rsync also exists which can be used to override the hardcoded path to the rsync binary that is defined when the module is installed, and debug which causes the module methods to print some debugging information to STDERR. There are also 2 options to wrap the source and/or destination paths in double-quotes. They are quote-src and quote-dst, and may be useful in protecting the paths from shell expansion (particularly useful for paths containing spaces). The outfun and errfun options take a function reference. The function is called once for each line of output from the *rsync* program with the output line passed in as the first argument, the second arg is either 'out' or 'err' depending on the source. This makes it possible to use the same function for both and still determine where the output came from. Options may also be passed as a reference to a hash. The exclude option needs an array reference as its value, since there cannot be duplicate keys in a hash. There is an equivalent include option. Only an exclude or include option should be used, not both. Use the '+ ' or '- ' prefix trick to put includes in an exclude array, or to put excludes in an include array (see *rsync(1)* for details). Include/exclude options form an ordered list. The order must be retained for proper execution. There are also source and dest keys. The key src is also accepted as an equivalent to source, and dst or destination may be used as equivalents to dest. The source option may take a scalar or an array reference. If the source is the local system then multiple source paths are allowed. In this case an array reference should be used. There is also a method for passing multiple source paths to a remote system. This method may be triggered in this module by passing the remote hostname to the srchost key and passing an array reference to the source key. If the source host is being accessed via an Rsync server, the remote hostname should have a single trailing colon on the name. When rsync is called, the srchost value and the values in the source array will be joined with a colon resulting in the double-colon required for server access. The dest key only takes a scalar since *rsync* only accepts a single destination path. Version 2.6.0 of *rsync(1)* provides a new files-from option along with a few other supporting options (from0, no-relative, and no-implied-dirs). To support this wonderful new option at the level it deserves, this module now has an additional parameter. If files-from is set to '-' (meaning read from stdin) you can define infun to be a reference to a function that prints your file list to the default file handle. The output from the function is attached to stdin of the rsync call during exec. If infun is defined it will be called regardless of the value of files-from, so it can provide any data expected on stdin, but keep in mind that stdin will not be attached to a tty so it is not very useful for sending passwords (see the *rsync(1)* and *ssh(1)* man pages for ways to handle authentication). The *rsync(1)* man page has a more complete description of files-from. Also see the File::Find manpage for ideas to use with files-from and infun. The infun option may also be used with the include-from or exclude-from settings, but this is generally more clumsy than using the include or exclude arrays. Version 2.6.3 of *rsync(1)* provides new options partial-dir, checksum-seed, keep-dirlinks, inplace, ipv4, and ipv6. Version 2.6.4 of *rsync(1)* provides new options del, delete-before delete-during, delay-updates, dirs, filter, fuzzy, itemize-changes, list-only, omit-dir-times, remove-sent-files, max-size, and protocol. Version 0.38 of this module also adds support for the acls option that is not part of *rsync(1)* unless the patch has been applied, but people do use it. It also includes a new literal option that takes an array reference similar to include, exclude, and filter. Any arguments in the array are passed as literal arguments to rsync, and are passed first. They should have the proper single or double hyphen prefixes and the elements should be split up the way you want them passed to exec. The purpose of this option is to allow the use of arbitrary options added by patches, and/or to allow the use of new options in rsync without needing an imediate update to the module in addtition to *rsync(1)* itself. =back # # This package was generated automatically with the cpan2rpm # utility. To get this software or for more information # please visit: http://perl.arix.com/ # %prep %setup -q -n %{pkgname}-%{version} chmod -R u+w %{_builddir}/%{pkgname}-%{version} %build grep -rsl '^#!.*perl' . | grep -v '.bak$' |xargs --no-run-if-empty \ %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '` %{__make} %if %maketest %{__make} test %endif %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '` cmd=/usr/share/spec-helper/compress_files [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress [ -x $cmd ] && $cmd # SuSE Linux if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ] then %{__mkdir_p} %{buildroot}/var/adm/perl-modules %{__cat} `find %{buildroot} -name "perllocal.pod"` \ | %{__sed} -e s+%{buildroot}++g \ > %{buildroot}/var/adm/perl-modules/%{name} fi # remove special files find %{buildroot} -name "perllocal.pod" \ -o -name ".packlist" \ -o -name "*.bs" \ |xargs -i rm -f {} # no empty directories find %{buildroot}%{_prefix} \ -type d -depth \ -exec rmdir {} \; 2>/dev/null %{__perl} -MFile::Find -le ' find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}"); print "%doc TODO README"; for my $x (sort @dirs, @files) { push @ret, $x unless indirs($x); } print join "\n", sort @ret; sub wanted { return if /auto$/; local $_ = $File::Find::name; my $f = $_; s|^\Q%{buildroot}\E||; return unless length; return $files[@files] = $_ if -f $f; $d = $_; /\Q$d\E/ && return for reverse sort @INC; $d =~ /\Q$_\E/ && return for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|; $dirs[@dirs] = $_; } sub indirs { my $x = shift; $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs; } ' > %filelist [ -z %filelist ] && { echo "ERROR: empty %files listing" exit -1 } %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files -f %filelist %defattr(-,root,root) %changelog * Fri Jul 29 2011 rpm@janus.arix.com - Initial build.