%if %{?fedora}%{?rhel} >= 5 %define useselinux 1 %else %define useselinux 0 %endif Name: BackupPC Version: 3.1.0 Release: 13%{?dist} Summary: High-performance backup system Group: Applications/System License: GPLv2+ URL: http://backuppc.sourceforge.net/ Source0: http://downloads.sourceforge.net/backuppc/%{name}-%{version}.tar.gz Source1: BackupPC.htaccess Source2: BackupPC.logrotate Source3: BackupPC-README.fedora Patch0: BackupPC-TopDir_change.patch 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 %patch0 -p1 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 < 1,|ClientNameAlias => 0,|' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.pl %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 $RPM_BUILD_ROOT %pre %{_sbindir}/useradd -d %{_localstatedir}/lib/%{name} -r -s /sbin/nologin backuppc 2> /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 created by app restorecon -R %{_sysconfdir}/%{name} restorecon -R %{_localstatedir}/log/%{name} ) &>/dev/null %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} || : )&>/dev/null 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,apache) %{_datadir}/%{name}/sbin/BackupPC_Admin %attr(-,backuppc,root) %{_localstatedir}/lib/%{name}/ %if %{useselinux} %{_datadir}/selinux/packages/%{name}/%{name}.pp %endif %changelog * Mon May 17 2010 Johan Cwiklinski 3.1.0-13 - Fix for bug #592762 * Sun Feb 28 2010 Johan Cwiklinski 3.1.0-12 - Add "::1" to the apache config file for default allowed adresses - Fix a typo in the apache config file * Sun Jan 17 2010 Johan Cwiklinski 3.1.0-11 - Really fix selinux labelling backup directory (bug #525948) * Fri Jan 15 2010 Johan Cwiklinski 3.1.0-10 - Fix selinux labelling backup directory (bug #525948) * Fri Sep 25 2009 Johan Cwiklinski 3.1.0-9 - Fix security bug (bug #518412) * Wed Sep 23 2009 Johan Cwiklinski 3.1.0-8 - Rebuild with latest SELinux policy (bug #524630) * Fri Sep 18 2009 Johan Cwiklinski 3.1.0-7 - Fix SELinux policy module for UserEmailInfo.pl file * Fri Jul 24 2009 Fedora Release Engineering - 3.1.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri Apr 10 2009 Johan Cwiklinski 3.1.0-5 - Fix TopDir change (bug #473944) * Mon Feb 23 2009 Fedora Release Engineering - 3.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Mon Aug 11 2008 Johan Cwiklinski 3.1.0-3 - using /dev/null with SELinux policy to avoid broken pipe errors (bug #432149) * 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