diff --git a/BackupPC-2.1.2pl2.diff b/BackupPC-2.1.2pl2.diff deleted file mode 100644 index e98ff4f..0000000 --- a/BackupPC-2.1.2pl2.diff +++ /dev/null @@ -1,202 +0,0 @@ -# -# BackupPC-2.1.2pl2.diff: BackupPC patch file generated -# on Sun Jun 18 19:36:32 2006. -# -# This patch file should be applied to a cleanly unpacked BackupPC -# version 2.1.2. Do not apply any old patch files; each -# patch file accumulates all previous changes. -# -# Example: -# -# # fetch BackupPC-2.1.2.tar.gz -# # fetch BackupPC-2.1.2pl2.diff -# tar zxvf BackupPC-2.1.2.tar.gz -# cd BackupPC-2.1.2 -# patch -p0 < ../BackupPC-2.1.2pl2.diff -# perl configure.pl -# -# ChangeLog: -# -# - In conf/config.pl, changed --devices to -D in $Conf{RsyncArgs} -# and $Conf{RsyncRestoreArgs} to fix "fileListReceive failed" and -# "Can't open .../f%2f for empty output" errors with rsync 2.6.7+. -# Fix proposed by Justin Pessa and Vincent Ho, and confirmed by -# Dan Niles. -# -# - Added patch from Michael (mna.news) to ignore "file is unchanged" -# message from tar 1.15.x during incremental backups. -# -# - Fixed creation of .rsrc directories in bin/BackupPC_tarExtract -# when used with xtar on MacOS. Reported by Samuel Bancal and -# Matthew Radey, who helped with debugging. -# -# - Fixed bug in BackupPC_tarExtract for files >8GB in size whose -# lengths are multiples of 256. Reported by Jamie Myers and -# Marko Tukiainen, who both helped debugging the problem. -# -# - Fixed bug in lib/BackupPC/Xfer/RsyncFileIO.pm that caused -# incorrected deleted attributes to be set in directories -# where one of the files had an rsync phase 1 retry during -# an incremental. Reported by Tony Nelson. -# ---- bin/BackupPC_tarExtract 2005-09-05 16:21:21.000000000 -0700 -+++ bin/BackupPC_tarExtract 2006-06-18 19:36:31.995945464 -0700 -@@ -58,7 +58,7 @@ - exit(1); - } - my $client = $1; --if ( $ARGV[1] !~ /^([\w\s\.\/\$-]+)$/ ) { -+if ( $ARGV[1] !~ /^([\w\s.\/$(){}[\]-]+)$/ ) { - print("$0: bad share name '$ARGV[1]'\n"); - exit(1); - } -@@ -101,7 +101,7 @@ - # Copyright 1998 Stephen Zander. All rights reserved. - # - my $tar_unpack_header -- = 'Z100 A8 A8 A8 A12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12'; -+ = 'Z100 A8 A8 A8 a12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12'; - my $tar_header_length = 512; - - my $BufSize = 1048576; # 1MB or 2^20 -@@ -251,7 +251,7 @@ - $name = $longName if ( defined($longName) ); - $linkname = $longLink if ( defined($longLink) ); - $name =~ s{^\./+}{}; -- $name =~ s{/+$}{}; -+ $name =~ s{/+\.?$}{}; - $name =~ s{//+}{/}g; - return { - name => $name, -@@ -313,7 +313,7 @@ - # - my($nRead); - #print("Reading $f->{name}, $f->{size} bytes, type $f->{type}\n"); -- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f); -+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f); - my $poolWrite = BackupPC::PoolWrite->new($bpc, - "$OutDir/$ShareName/$f->{mangleName}", - $f->{size}, $Compress); -@@ -351,7 +351,7 @@ - # a plain file. - # - $f->{size} = length($f->{linkname}); -- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f); -+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f); - my $poolWrite = BackupPC::PoolWrite->new($bpc, - "$OutDir/$ShareName/$f->{mangleName}", - $f->{size}, $Compress); -@@ -369,7 +369,7 @@ - # contents. - # - $f->{size} = length($f->{linkname}); -- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f); -+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f); - my $poolWrite = BackupPC::PoolWrite->new($bpc, - "$OutDir/$ShareName/$f->{mangleName}", - $f->{size}, $Compress); -@@ -393,7 +393,7 @@ - } else { - $data = "$f->{devmajor},$f->{devminor}"; - } -- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f); -+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f); - my $poolWrite = BackupPC::PoolWrite->new($bpc, - "$OutDir/$ShareName/$f->{mangleName}", - length($data), $Compress); -@@ -487,17 +487,21 @@ - # - sub pathCreate - { -- my($dir, $fullPath, $file, $f) = @_; -+ my($dir, $fullPath, $f) = @_; - - # - # Get parent directory of each of $dir and $fullPath - # -- $dir =~ s{/[^/]*$}{}; -+ # print("pathCreate: dir = $dir, fullPath = $fullPath\n"); -+ $dir =~ s{/([^/]*)$}{}; -+ my $file = $bpc->fileNameUnmangle($1); - $fullPath =~ s{/[^/]*$}{}; -- return if ( -d $fullPath ); -+ return if ( -d $fullPath || $file eq "" ); -+ unlink($fullPath) if ( -e $fullPath ); - mkpath($fullPath, 0, 0777); - $Attrib{$dir} = BackupPC::Attrib->new({ compress => $Compress }) - if ( !defined($Attrib{$dir}) ); -+ # print("pathCreate: adding file = $file to dir = $dir\n"); - $Attrib{$dir}->set($file, { - type => BPC_FTYPE_DIR, - mode => 0755, ---- lib/BackupPC/Lib.pm 2005-09-05 16:21:21.000000000 -0700 -+++ lib/BackupPC/Lib.pm 2006-06-18 19:36:32.035939384 -0700 -@@ -59,7 +59,7 @@ - TopDir => $topDir || '__TOPDIR__', - BinDir => $installDir || '__INSTALLDIR__', - LibDir => $installDir || '__INSTALLDIR__', -- Version => '2.1.2', -+ Version => '2.1.2pl2', - BackupFields => [qw( - num type startTime endTime - nFiles size nFilesExist sizeExist nFilesNew sizeNew ---- lib/BackupPC/Xfer/RsyncFileIO.pm 2005-09-05 16:21:21.000000000 -0700 -+++ lib/BackupPC/Xfer/RsyncFileIO.pm 2006-06-18 19:36:32.120926464 -0700 -@@ -405,6 +405,11 @@ - my($fio, $d) = @_; - my($poolWrite); - -+ # -+ # Don't write attributes on 2nd phase - they're already -+ # taken care of during the first phase. -+ # -+ return if ( $fio->{phase} > 0 ); - if ( !defined($d) ) { - # - # flush all entries (in reverse order) -@@ -932,6 +937,7 @@ - - close($fio->{rxInFd}) if ( defined($fio->{rxInFd}) ); - unlink("$fio->{outDirSh}RStmp") if ( -f "$fio->{outDirSh}RStmp" ); -+ $fio->{phase} = $phase; - - # - # Check the final md4 digest ---- lib/BackupPC/Xfer/Tar.pm 2005-09-05 16:21:21.000000000 -0700 -+++ lib/BackupPC/Xfer/Tar.pm 2006-06-18 19:36:32.110927984 -0700 -@@ -221,8 +221,13 @@ - $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 ); - $t->{fileCnt}++; - } else { -- $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); -- $t->{xferErrCnt}++; -+ # -+ # Ignore annoying log message on incremental for tar 1.15.x -+ # -+ if ( !/: file is unchanged; not dumped$/ ) { -+ $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); -+ $t->{xferErrCnt}++; -+ } - # - # If tar encounters a minor error, it will exit with a non-zero - # status. We still consider that ok. Remember if tar prints ---- conf/config.pl 2005-09-05 16:21:22.000000000 -0700 -+++ conf/config.pl 2006-06-18 19:36:31.968949568 -0700 -@@ -1052,7 +1052,7 @@ - '--perms', - '--owner', - '--group', -- '--devices', -+ '-D', - '--links', - '--times', - '--block-size=2048', -@@ -1086,7 +1086,7 @@ - '--perms', - '--owner', - '--group', -- '--devices', -+ '-D', - '--links', - '--times', - '--block-size=2048', diff --git a/BackupPC.spec b/BackupPC.spec index e1186f2..99067bf 100644 --- a/BackupPC.spec +++ b/BackupPC.spec @@ -1,29 +1,51 @@ -Name: BackupPC -Version: 2.1.2 -Release: 7%{?dist} -Summary: BackupPC - high-performance backup system - -Group: Applications/System -License: GPL -URL: http://backuppc.sourceforge.net/ -Source0: http://dl.sourceforge.net/backuppc/%{name}-%{version}.tar.gz -Source1: BackupPC.htaccess -Source2: BackupPC.logrotate -Patch0: BackupPC-2.1.2pl2.diff -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch - -BuildRequires: /bin/cat /bin/df /bin/gtar %{_bindir}/nmblookup %{_bindir}/rsync %{_sbindir}/sendmail %{_bindir}/smbclient %{_bindir}/split %{_bindir}/ssh -Requires: httpd -Requires: perl-suidperl -Requires: perl(File::RsyncP) -Requires: rsync -Requires(pre): %{_sbindir}/useradd -Requires(preun): /sbin/service, /sbin/chkconfig -Requires(post): /sbin/chkconfig, /sbin/service, %{_sbindir}/usermod -Requires(postun): /sbin/service - - +%if %{?fedora}%{?rhel} >= 5 +%define useselinux 1 +%else +%define useselinux 0 +%endif + +Name: BackupPC +Version: 3.0.0 +Release: 3%{?dist} +Summary: BackupPC - high-performance backup system + +Group: Applications/System +License: GPLv2+ +URL: http://backuppc.sourceforge.net/ +Source0: http://dl.sourceforge.net/backuppc/%{name}-%{version}.tar.gz +Source1: BackupPC.htaccess +Source2: BackupPC.logrotate +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch + +BuildRequires: /bin/cat +BuildRequires: /bin/df +BuildRequires: /bin/gtar +BuildRequires: %{_bindir}/nmblookup +BuildRequires: %{_bindir}/rsync +BuildRequires: %{_sbindir}/sendmail +BuildRequires: %{_bindir}/smbclient +BuildRequires: %{_bindir}/split +BuildRequires: %{_bindir}/ssh +BuildRequires: perl(Compress::Zlib) + +Requires: httpd +Requires: perl-suidperl +Requires: perl(File::RsyncP) +Requires: perl(Compress::Zlib) +Requires: perl(Archive::Zip) +Requires: perl-Time-modules +Requires: perl(XML::RSS) +Requires: rsync +Requires(pre): %{_sbindir}/useradd +Requires(preun): initscripts, chkconfig +Requires(post): initscripts, chkconfig, %{_sbindir}/usermod +Requires(postun): initscripts +%if %{useselinux} +Requires: policycoreutils +BuildRequires: selinux-policy-devel, checkpolicy +%endif +Provides: backuppc = %{version} %description BackupPC is a high-performance, enterprise-grade system for backing up Linux @@ -32,98 +54,179 @@ and easy to install and maintain. %prep %setup -q -%patch0 -p0 -sed -i s/\"backuppc\"/\"$LOGNAME\"/ configure.pl +sed -i "s|\"backuppc\"|\"$LOGNAME\"|g" configure.pl +iconv -f ISO-8859-1 -t UTF-8 ChangeLog > ChangeLog.utf && mv ChangeLog.utf ChangeLog +pushd doc +iconv -f ISO-8859-1 -t UTF-8 BackupPC.pod > BackupPC.pod.utf && mv BackupPC.pod.utf BackupPC.pod +iconv -f ISO-8859-1 -t UTF-8 BackupPC.html > BackupPC.html.utf && mv BackupPC.html.utf BackupPC.html +popd + +%if %{useselinux} +%{__mkdir} selinux +pushd selinux + +cat >%{name}.te <%{name}.fc < /dev/null || : +%{_sbindir}/useradd -d %{_localstatedir}/lib/%{name} -r -s %{_bindir}/nologin backuppc 2> /dev/null || : + %preun if [ $1 = 0 ]; then - /sbin/service %{name} stop > /dev/null 2>&1 || : - /sbin/chkconfig --del %{name} || : + service backuppc stop > /dev/null 2>&1 || : + chkconfig --del backuppc || : fi %post -/sbin/chkconfig --add %{name} || : -/sbin/service httpd condrestart > /dev/null 2>&1 || : +%if %{useselinux} + # Install/update Selinux policy + semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp + # files owned by RPM + fixfiles -R %{name} restore + # files created by app + restorecon -R %{_sysconfdir}/%{name} + restorecon -R %{_localstatedir}/lib/%{name} + restorecon -R %{_localstatedir}/log/%{name} +%endif +chkconfig --add backuppc || : +service httpd condrestart > /dev/null 2>&1 || : %{_sbindir}/usermod -a -G backuppc apache || : + %postun -/sbin/service httpd condrestart > /dev/null 2>&1 || : +service httpd condrestart > /dev/null 2>&1 || : +%if %{useselinux} +if [ "$1" -eq "0" ]; then + # Remove the SElinux policy. + semodule -r %{name} || : +fi +%endif + %files %defattr(-,root,root,-) %doc README ChangeLog LICENSE doc/ -%dir %{_datadir}/%{name}/ -%dir %attr(-,backuppc,backuppc) %{_localstatedir}/log/%{name} +%dir %attr(-,backuppc,backuppc) %{_localstatedir}/log/%{name} %dir %attr(-,backuppc,backuppc) %{_sysconfdir}/%{name}/ %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %config(noreplace) %attr(-,backuppc,backuppc) %{_sysconfdir}/%{name}/* %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/sbin %{_datadir}/%{name}/[^s]* -%{_initrddir}/%{name} +%{_initrddir}/backuppc %attr(4750,backuppc,apache) %{_datadir}/%{name}/sbin/BackupPC_Admin %attr(-,backuppc,root) %{_localstatedir}/lib/%{name}/ +%if %{useselinux} +%{_datadir}/selinux/packages/%{name}/%{name}.pp +%endif %changelog +* Fri Sep 21 2007 Johan Cwiklinski 3.0.0-3 +- Fixed SELinux policy module + +* Wed Sep 12 2007 Johan Cwiklinski 3.0.0-2 +- Added SELinux policy module + +* Tue Jan 30 2007 Johan Cwiklinski 3.0.0-1 +- Rebuild RPM for v 3.0.0 + * Sat Aug 16 2006 Mike McGrath 2.1.2-7 - Release bump for rebuild diff --git a/sources b/sources index 03eeb15..6edc6ab 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -72fc0f09084f44c42ba5d22451cfe29b BackupPC-2.1.2.tar.gz +dc37728c1dc9225354523f279045f3f3 BackupPC-3.0.0.tar.gz