|
|
93e12e4 |
Name: BackupPC
|
|
|
93e12e4 |
Version: 2.1.2
|
|
|
93e12e4 |
Release: 6%{?dist}
|
|
|
93e12e4 |
Summary: BackupPC - high-performance backup system
|
|
|
93e12e4 |
|
|
|
93e12e4 |
Group: Applications/System
|
|
|
93e12e4 |
License: GPL
|
|
|
93e12e4 |
URL: http://backuppc.sourceforge.net/
|
|
|
93e12e4 |
Source0: http://dl.sourceforge.net/backuppc/%{name}-%{version}.tar.gz
|
|
|
93e12e4 |
Source1: BackupPC.htaccess
|
|
|
93e12e4 |
Source2: BackupPC.logrotate
|
|
|
93e12e4 |
Patch0: BackupPC-2.1.2pl2.diff
|
|
|
93e12e4 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
93e12e4 |
BuildArch: noarch
|
|
|
93e12e4 |
|
|
|
93e12e4 |
BuildRequires: /bin/cat /bin/df /bin/gtar %{_bindir}/nmblookup %{_bindir}/rsync %{_sbindir}/sendmail %{_bindir}/smbclient %{_bindir}/split %{_bindir}/ssh
|
|
|
93e12e4 |
Requires: httpd
|
|
|
93e12e4 |
Requires: perl-suidperl
|
|
|
93e12e4 |
Requires: perl(File::RsyncP)
|
|
|
93e12e4 |
Requires: rsync
|
|
|
93e12e4 |
Requires(pre): %{_sbindir}/useradd
|
|
|
93e12e4 |
Requires(preun): /sbin/service, /sbin/chkconfig
|
|
|
93e12e4 |
Requires(post): /sbin/chkconfig, /sbin/service, %{_sbindir}/usermod
|
|
|
93e12e4 |
Requires(postun): /sbin/service
|
|
|
93e12e4 |
|
|
|
93e12e4 |
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%description
|
|
|
93e12e4 |
BackupPC is a high-performance, enterprise-grade system for backing up Linux
|
|
|
93e12e4 |
and WinXX PCs and laptops to a server's disk. BackupPC is highly configurable
|
|
|
93e12e4 |
and easy to install and maintain.
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%prep
|
|
|
93e12e4 |
%setup -q
|
|
|
93e12e4 |
%patch0 -p0
|
|
|
93e12e4 |
sed -i s/\"backuppc\"/\"$LOGNAME\"/ configure.pl
|
|
|
93e12e4 |
|
|
|
93e12e4 |
# There is no good build method for backuppc. Instead the configure script
|
|
|
93e12e4 |
# also does installation of files.
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%install
|
|
|
93e12e4 |
rm -rf %{buildroot}
|
|
|
93e12e4 |
perl configure.pl --batch \
|
|
|
93e12e4 |
--cgi-dir %{buildroot}/%{_datadir}/%{name}/sbin/ \
|
|
|
93e12e4 |
--data-dir %{buildroot}/%{_localstatedir}/lib/%{name}/ \
|
|
|
93e12e4 |
--html-dir %{buildroot}/%{_datadir}/%{name}/html/ \
|
|
|
93e12e4 |
--html-dir-url /%{name}/images \
|
|
|
93e12e4 |
--install-dir %{buildroot}/%{_datadir}/%{name} \
|
|
|
93e12e4 |
--uid-ignore
|
|
|
93e12e4 |
for f in `find %{buildroot}`
|
|
|
93e12e4 |
do
|
|
|
93e12e4 |
if [ -f $f ]
|
|
|
93e12e4 |
then
|
|
|
93e12e4 |
sed -i s,%{buildroot},,g $f
|
|
|
93e12e4 |
sed -i s,$LOGNAME,backuppc,g $f
|
|
|
93e12e4 |
fi
|
|
|
93e12e4 |
done
|
|
|
93e12e4 |
sed -i s,%{buildroot},,g init.d/linux-backuppc
|
|
|
93e12e4 |
sed -i s,$LOGNAME,backuppc,g init.d/linux-backuppc
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%{__mkdir} -p %{buildroot}/%{_initrddir}
|
|
|
93e12e4 |
%{__mkdir} -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/
|
|
|
93e12e4 |
%{__mkdir} -p %{buildroot}/%{_sysconfdir}/logrotate.d/
|
|
|
93e12e4 |
%{__mkdir} -p %{buildroot}/%{_localstatedir}/log/%{name}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%{__cp} init.d/linux-backuppc %{buildroot}/%{_initrddir}/%{name}
|
|
|
93e12e4 |
%{__cp} %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
|
93e12e4 |
%{__cp} %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%{__chmod} 755 %{buildroot}/%{_datadir}/%{name}/bin/*
|
|
|
93e12e4 |
%{__chmod} 755 %{buildroot}/%{_initrddir}/%{name}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%{__mv} %{buildroot}/%{_localstatedir}/lib/%{name}/conf %{buildroot}/%{_sysconfdir}/%{name}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%{__rm} -f %{buildroot}/%{_datadir}/%{name}/html/CVS
|
|
|
93e12e4 |
%{__rm} -rf %{buildroot}/%{_localstatedir}/lib/%{name}/log
|
|
|
93e12e4 |
|
|
|
93e12e4 |
sed -i 's/^\$Conf{XferMethod}\ =.*/$Conf{XferMethod} = "rsync";/' %{buildroot}/%{_sysconfdir}/%{name}/config.pl
|
|
|
93e12e4 |
sed -i 's/^\$Conf{ServerHost}\ =.*/$Conf{ServerHost} = "localhost";/' %{buildroot}/%{_sysconfdir}/%{name}/config.pl
|
|
|
93e12e4 |
sed -i 's,^\$Conf{CgiURL}\ =.*,$Conf{CgiURL} = "http://localhost/cgi-bin/BackupPC_Admin";,' %{buildroot}/%{_sysconfdir}/%{name}/config.pl
|
|
|
93e12e4 |
|
|
|
93e12e4 |
ln -s %{_sysconfdir}/%{name}/ %{buildroot}/%{_localstatedir}/lib/%{name}/conf
|
|
|
93e12e4 |
ln -s ../../log/%{name}/ %{buildroot}/%{_localstatedir}/lib/%{name}/log
|
|
|
93e12e4 |
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%clean
|
|
|
93e12e4 |
rm -rf %{buildroot}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%pre
|
|
|
93e12e4 |
%{_sbindir}/useradd -d %{_localstatedir}/lib/%{name} -r -s /sbin/nologin backuppc 2> /dev/null || :
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%preun
|
|
|
93e12e4 |
if [ $1 = 0 ]; then
|
|
|
93e12e4 |
/sbin/service %{name} stop > /dev/null 2>&1 || :
|
|
|
93e12e4 |
/sbin/chkconfig --del %{name} || :
|
|
|
93e12e4 |
fi
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%post
|
|
|
93e12e4 |
/sbin/chkconfig --add %{name} || :
|
|
|
93e12e4 |
/sbin/service httpd condrestart > /dev/null 2>&1 || :
|
|
|
93e12e4 |
%{_sbindir}/usermod -a -G backuppc apache || :
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%postun
|
|
|
93e12e4 |
/sbin/service httpd condrestart > /dev/null 2>&1 || :
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%files
|
|
|
93e12e4 |
%defattr(-,root,root,-)
|
|
|
93e12e4 |
%doc README ChangeLog LICENSE doc/
|
|
|
93e12e4 |
%dir %{_datadir}/%{name}/
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%dir %attr(-,backuppc,backuppc) %{_localstatedir}/log/%{name}
|
|
|
93e12e4 |
%dir %attr(-,backuppc,backuppc) %{_sysconfdir}/%{name}/
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
|
93e12e4 |
%config(noreplace) %attr(-,backuppc,backuppc) %{_sysconfdir}/%{name}/*
|
|
|
93e12e4 |
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%{_datadir}/%{name}/[^s]*
|
|
|
93e12e4 |
%{_initrddir}/%{name}
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%attr(4750,backuppc,apache) %{_datadir}/%{name}/sbin/BackupPC_Admin
|
|
|
93e12e4 |
%attr(-,backuppc,root) %{_localstatedir}/lib/%{name}/
|
|
|
93e12e4 |
|
|
|
93e12e4 |
|
|
|
93e12e4 |
%changelog
|
|
|
93e12e4 |
* Tue Jul 25 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-6
|
|
|
93e12e4 |
- One more config change
|
|
|
93e12e4 |
|
|
|
93e12e4 |
* Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-5
|
|
|
93e12e4 |
- Added upstream patch for better support for rsync
|
|
|
93e12e4 |
|
|
|
93e12e4 |
* Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-4
|
|
|
93e12e4 |
- Properly marking config files as such
|
|
|
93e12e4 |
|
|
|
93e12e4 |
* Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-3
|
|
|
93e12e4 |
- Changes to defaults in config.pl
|
|
|
93e12e4 |
- Added Requires: rsync
|
|
|
93e12e4 |
|
|
|
93e12e4 |
* Fri Jul 21 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-2
|
|
|
93e12e4 |
- Added requires: perl(File::RsyncP)
|
|
|
93e12e4 |
|
|
|
93e12e4 |
* Tue Jul 18 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-1
|
|
|
93e12e4 |
- Initial Fedora Packaging
|