# $Id$ # Authority: vip-ire # Name: Daniel Berteaud %if %{?fedora}%{?rhel} >= 5 %define useselinux 1 %else %define useselinux 0 %endif Name: BackupPC Version: 3.1.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 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 and WinXX PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain. %prep %setup -q 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 <%{name}.fc < /dev/null || : %preun if [ $1 = 0 ]; then service backuppc stop > /dev/null 2>&1 || : chkconfig --del backuppc || : fi %post %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 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 README.fedora ChangeLog LICENSE doc/ %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}/backuppc %attr(4750,backuppc,root) %{_datadir}/%{name}/sbin/BackupPC_Admin %attr(-,backuppc,root) %{_localstatedir}/lib/%{name}/ %if %{useselinux} %{_datadir}/selinux/packages/%{name}/%{name}.pp %endif %changelog * Tue Dec 09 2008 Daniel B 3.1.0-3 - Small changes for SME Server (apache -> www) * Sat Apr 05 2008 Johan Cwiklinski 3.1.0-2 - correcting nologin path * Thu Nov 29 2007 Johan Cwiklinski 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 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 * Tue Jul 25 2006 Mike McGrath 2.1.2-6 - One more config change * Sun Jul 23 2006 Mike McGrath 2.1.2-5 - Added upstream patch for better support for rsync * Sun Jul 23 2006 Mike McGrath 2.1.2-4 - Properly marking config files as such * Sun Jul 23 2006 Mike McGrath 2.1.2-3 - Changes to defaults in config.pl - Added Requires: rsync * Fri Jul 21 2006 Mike McGrath 2.1.2-2 - Added requires: perl(File::RsyncP) * Tue Jul 18 2006 Mike McGrath 2.1.2-1 - Initial Fedora Packaging