Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c733cf083 | ||
|
|
ee6c8e82f2 | ||
|
|
736af133be | ||
|
|
19a9a07e71 | ||
|
|
07ee9b8d0f | ||
|
|
f7d00e997a |
6 changed files with 205 additions and 297 deletions
0
.cvsignore → .gitignore
vendored
0
.cvsignore → .gitignore
vendored
|
|
@ -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',
|
||||
15
BackupPC-README.fedora
Normal file
15
BackupPC-README.fedora
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
BackupPC's README file for Fedora
|
||||
|
||||
## BackupPC's user
|
||||
For security reasons, backuppc user cannot log in. If you want to start manual backup (ie for debugging), you'll need to set it a shell :
|
||||
usermod -s /bin/bash
|
||||
|
||||
Do not forget to create an SSH key (ssk-keygen) and copy it to remote computers if you plan to use tar/rsynv over SSH backup method.
|
||||
|
||||
## BackupPC's web interface
|
||||
The CGI web interface is located at :
|
||||
http://localhost/BackupPC
|
||||
|
||||
You will need to create users in /etc/BackupPC/apache.users :
|
||||
htpasswd -c /etc/BackupPC/apache.users username
|
||||
(Note that the '-c' flag is only necessary to create the file)
|
||||
254
BackupPC.spec
254
BackupPC.spec
|
|
@ -1,29 +1,53 @@
|
|||
Name: BackupPC
|
||||
Version: 2.1.2
|
||||
Release: 7%{?dist}
|
||||
Summary: BackupPC - high-performance backup system
|
||||
%if %{?fedora}%{?rhel} >= 5
|
||||
%define useselinux 1
|
||||
%else
|
||||
%define useselinux 0
|
||||
%endif
|
||||
|
||||
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
|
||||
Name: BackupPC
|
||||
Version: 3.1.0
|
||||
Release: 2%{?dist}
|
||||
Summary: BackupPC - high-performance backup system
|
||||
|
||||
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
|
||||
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
|
||||
Source3: BackupPC-README.fedora
|
||||
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: samba-client
|
||||
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 +56,190 @@ 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
|
||||
cp %{SOURCE3} README.fedora
|
||||
|
||||
%if %{useselinux}
|
||||
%{__mkdir} selinux
|
||||
pushd selinux
|
||||
|
||||
cat >%{name}.te <<EOF
|
||||
policy_module(%{name},0.0.3)
|
||||
require {
|
||||
type var_log_t;
|
||||
type httpd_t;
|
||||
class sock_file write;
|
||||
type initrc_t;
|
||||
class unix_stream_socket connectto;
|
||||
type ssh_exec_t;
|
||||
type ping_exec_t;
|
||||
type sendmail_exec_t;
|
||||
class file getattr;
|
||||
type httpd_sys_content_t;
|
||||
class sock_file getattr;
|
||||
}
|
||||
|
||||
allow httpd_t httpd_sys_content_t:sock_file write;
|
||||
allow httpd_t initrc_t:unix_stream_socket connectto;
|
||||
allow httpd_t ping_exec_t:file getattr;
|
||||
allow httpd_t sendmail_exec_t:file getattr;
|
||||
allow httpd_t ssh_exec_t:file getattr;
|
||||
allow httpd_t httpd_sys_content_t:sock_file getattr;
|
||||
EOF
|
||||
|
||||
cat >%{name}.fc <<EOF
|
||||
%{_sysconfdir}/%{name} system_u:object_r:httpd_sys_content_t:s0
|
||||
%{_sysconfdir}/%{name}/pc system_u:object_r:httpd_sys_script_rw_t:s0
|
||||
%{_sysconfdir}/%{name}/config.pl system_u:object_r:httpd_sys_content_t:s0
|
||||
%{_sysconfdir}/%{name}/hosts system_u:object_r:httpd_sys_content_t:s0
|
||||
%{_localstatedir}/log/%{name} system_u:object_r:httpd_sys_content_t:s0
|
||||
EOF
|
||||
%endif
|
||||
|
||||
%build
|
||||
%if %{useselinux}
|
||||
# SElinux
|
||||
pushd selinux
|
||||
make -f %{_datadir}/selinux/devel/Makefile
|
||||
popd
|
||||
%endif
|
||||
|
||||
|
||||
# There is no good build method for backuppc. Instead the configure script
|
||||
# also does installation of files.
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
perl configure.pl --batch \
|
||||
--cgi-dir %{buildroot}/%{_datadir}/%{name}/sbin/ \
|
||||
--data-dir %{buildroot}/%{_localstatedir}/lib/%{name}/ \
|
||||
--html-dir %{buildroot}/%{_datadir}/%{name}/html/ \
|
||||
--html-dir-url /%{name}/images \
|
||||
--install-dir %{buildroot}/%{_datadir}/%{name} \
|
||||
--uid-ignore
|
||||
for f in `find %{buildroot}`
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
perl configure.pl \
|
||||
--batch \
|
||||
--dest-dir $RPM_BUILD_ROOT \
|
||||
--config-dir %{_sysconfdir}/%{name}/ \
|
||||
--cgi-dir %{_datadir}/%{name}/sbin/ \
|
||||
--data-dir %{_localstatedir}/lib/%{name}/ \
|
||||
--html-dir %{_datadir}/%{name}/html/ \
|
||||
--html-dir-url /%{name}/images \
|
||||
--log-dir %{_localstatedir}/log/%{name} \
|
||||
--install-dir %{_datadir}/%{name} \
|
||||
--hostname localhost \
|
||||
--uid-ignore
|
||||
|
||||
for f in `find $RPM_BUILD_ROOT`
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
sed -i s,%{buildroot},,g $f
|
||||
sed -i s,$LOGNAME,backuppc,g $f
|
||||
fi
|
||||
if [ -f $f ]
|
||||
then
|
||||
sed -i s,$LOGNAME,backuppc,g $f
|
||||
fi
|
||||
done
|
||||
sed -i s,%{buildroot},,g init.d/linux-backuppc
|
||||
sed -i s,$LOGNAME,backuppc,g init.d/linux-backuppc
|
||||
|
||||
%{__mkdir} -p %{buildroot}/%{_initrddir}
|
||||
%{__mkdir} -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/
|
||||
%{__mkdir} -p %{buildroot}/%{_sysconfdir}/logrotate.d/
|
||||
%{__mkdir} -p %{buildroot}/%{_localstatedir}/log/%{name}
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir}
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
|
||||
%{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pc
|
||||
|
||||
%{__cp} init.d/linux-backuppc %{buildroot}/%{_initrddir}/%{name}
|
||||
%{__cp} %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
||||
%{__cp} init.d/linux-backuppc $RPM_BUILD_ROOT%{_initrddir}/backuppc
|
||||
%{__cp} %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
||||
%{__cp} %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
|
||||
|
||||
%{__chmod} 755 %{buildroot}/%{_datadir}/%{name}/bin/*
|
||||
%{__chmod} 755 %{buildroot}/%{_initrddir}/%{name}
|
||||
%{__chmod} 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/bin/*
|
||||
%{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/backuppc
|
||||
|
||||
%{__mv} %{buildroot}/%{_localstatedir}/lib/%{name}/conf %{buildroot}/%{_sysconfdir}/%{name}
|
||||
sed -i 's/^\$Conf{XferMethod}\ =.*/$Conf{XferMethod} = "rsync";/' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.pl
|
||||
sed -i 's|^\$Conf{CgiURL}\ =.*|$Conf{CgiURL} = "http://localhost/BackupPC";|' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.pl
|
||||
|
||||
%{__rm} -f %{buildroot}/%{_datadir}/%{name}/html/CVS
|
||||
%{__rm} -rf %{buildroot}/%{_localstatedir}/lib/%{name}/log
|
||||
|
||||
sed -i 's/^\$Conf{XferMethod}\ =.*/$Conf{XferMethod} = "rsync";/' %{buildroot}/%{_sysconfdir}/%{name}/config.pl
|
||||
sed -i 's/^\$Conf{ServerHost}\ =.*/$Conf{ServerHost} = "localhost";/' %{buildroot}/%{_sysconfdir}/%{name}/config.pl
|
||||
sed -i 's,^\$Conf{CgiURL}\ =.*,$Conf{CgiURL} = "http://localhost/cgi-bin/BackupPC_Admin";,' %{buildroot}/%{_sysconfdir}/%{name}/config.pl
|
||||
|
||||
ln -s %{_sysconfdir}/%{name}/ %{buildroot}/%{_localstatedir}/lib/%{name}/conf
|
||||
ln -s ../../log/%{name}/ %{buildroot}/%{_localstatedir}/lib/%{name}/log
|
||||
%if %{useselinux}
|
||||
# SElinux
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}
|
||||
%{__install} -m644 selinux/%{name}.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/%{name}.pp
|
||||
%endif
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%pre
|
||||
%{_sbindir}/useradd -d %{_localstatedir}/lib/%{name} -r -s /sbin/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}/
|
||||
%doc README README.fedora ChangeLog LICENSE doc/
|
||||
|
||||
%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
|
||||
* Sat Apr 05 2008 Johan Cwiklinski <johan AT x-tnd DOT be> 3.1.0-2
|
||||
- correcting nologin path
|
||||
|
||||
* Thu Nov 29 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.1.0-1
|
||||
- New upstream version
|
||||
- Added samba-client as a dependency
|
||||
- Added readme.fedora
|
||||
- Changed CGI admin path in default config file
|
||||
|
||||
* Fri Sep 21 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.0.0-3
|
||||
- Fixed SELinux policy module
|
||||
|
||||
* Wed Sep 12 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.0.0-2
|
||||
- Added SELinux policy module
|
||||
|
||||
* Tue Jan 30 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.0.0-1
|
||||
- Rebuild RPM for v 3.0.0
|
||||
|
||||
* Sat Aug 16 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-7
|
||||
- Release bump for rebuild
|
||||
|
||||
|
|
|
|||
21
Makefile
21
Makefile
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: BackupPC
|
||||
# $Id$
|
||||
NAME := BackupPC
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
72fc0f09084f44c42ba5d22451cfe29b BackupPC-2.1.2.tar.gz
|
||||
84b4471852ef910768eae9963ef932d2 BackupPC-3.1.0.tar.gz
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue