X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=BackupPC.spec;h=07faacdf04520e97093582125f2b3a759c692e32;hb=15c8941728e2b954062f1d43aad9427147fc97b6;hp=d095537260cb8a2432c8a3ed5460ee23a3bf4b6a;hpb=e53e588a8c61854da7fad5c2452c3b9aeeafed70;p=packages%2FBackupPC.git diff --git a/BackupPC.spec b/BackupPC.spec index d095537..07faacd 100644 --- a/BackupPC.spec +++ b/BackupPC.spec @@ -1,82 +1,272 @@ + +# - now path in browser is http://localhost/cgi/BackupPC/BackupPC_Admin +# TODO: +# - polish translation in SOURCE/backuppc-pl.pm +# - patch for service user - now is static backuppc +# - patch at user and gid/uid user - http://sourceforge.net/mailarchive/forum.php?thread_id=6201024&forum_id=17540 +# - compliant to FHS - http://sourceforge.net/mailarchive/forum.php?thread_id=5602342&forum_id=17540 - directory /var/log/backuppc +# - change or/and add Requires for --bin-path sendmail=%{_sbindir}/sendmail +# - correct config file + +%define BPCuser http +%define BPCgroup http %include /usr/lib/rpm/macros.perl -Summary: A high-performance, enterprise-grade system for backing up PCs + +Summary: A high-performance, enterprise-grade system for backing up +Summary(pl): Wysoko wydajny, profesjonalnej klasy system do kopii zapasowych Name: backuppc -Version: 2.0.2 -Release: 1 +Version: 2.1.2 +Release: 3 License: GPL Group: Networking/Utilities Source0: http://dl.sourceforge.net/backuppc/BackupPC-%{version}.tar.gz -# Source0-md5: d60aacbf46eb83a7e4ffbbe9e4f72c11 -Patch0: %{name}-debian.patch +# Source0-md5: 72fc0f09084f44c42ba5d22451cfe29b +Source1: %{name}_apache.conf +Source2: %{name}-pl.pm +Patch0: %{name}-%{version}pl0.patch +Patch1: %{name}-usernotexist.patch +Patch2: %{name}-pathtodocs.patch URL: http://backuppc.sourceforge.net/ -BuildRequires: perl >= 5.6.0 -BuildRequires: perl-devel -BuildRequires: perl-Digest-MD5 BuildRequires: perl-Compress-Zlib -BuildRequires: fakeroot -Requires: tar > 1.13 -Requires: samba-clients -Requires: webserver +BuildRequires: perl-Digest-MD5 +BuildRequires: perl-devel >= 1:5.6.0 +BuildRequires: rpm-perlprov +BuildRequires: rpmbuild(macros) >= 1.268 +BuildRequires: sed >= 4.0 +Requires: apache(mod_auth) +Requires: apache(mod_perl) +Requires: par2cmdline +Requires: perl-Archive-Zip +Requires: perl-Compress-Bzip2 +Requires: perl-Compress-Zlib +Requires: perl-File-RsyncP >= 0.52 +Requires: rsync +Requires: samba-client Requires: sperl -BuildArch: noarch +Requires: tar > 1.13 +Requires: webapps +Provides: group(%{BPCgroup}) +Provides: user(%{BPCuser}) Obsoletes: BackupPC +BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +%define _webapps /etc/webapps +%define _webapp %{name} + %description BackupPC is disk based and not tape based. This particularity allows features not found in any other backup solution: - * Clever pooling scheme minimizes disk storage and disk I/O. - Identical files across multiple backups of the same or different PC are - stored only once (using hard links), resulting in substantial savings - in disk storage and disk writes. - * Optional compression provides additional reductions in storage. - CPU impact of compression is low since only new files (those not already - in the pool) need to be compressed. - * A powerful http/cgi user interface allows administrators to view log files, - configuration, current status and allows users to initiate and cancel - backups and browse and restore files from backups very quickly. - * No client-side software is needed. On WinXX the smb protocol is used. - On linux or unix clients, rsync or tar (over ssh/rsh/nfs) can be used - * Flexible restore options. Single files can be downloaded from any backup - directly from the CGI interface. Zip or Tar archives for selected files - or directories can also be downloaded from the CGI interface. - * BackupPC supports mobile environments where laptops are only intermittently - connected to the network and have dynamic IP addresses (DHCP). - * Flexible configuration parameters allow multiple backups to be performed - in parallel. - * and more to discover in the manual... +- Clever pooling scheme minimizes disk storage and disk I/O. Identical + files across multiple backups of the same or different PC are stored + only once (using hard links), resulting in substantial savings in disk + storage and disk writes. +- Optional compression provides additional reductions in storage. CPU + impact of compression is low since only new files (those not already + in the pool) need to be compressed. +- A powerful http/cgi user interface allows administrators to view log + files, configuration, current status and allows users to initiate and + cancel backups and browse and restore files from backups very quickly. +- No client-side software is needed. On WinXX the SMB protocol is + used. On Linux or unix clients, rsync or tar (over ssh/rsh/NFS) can be + used. +- Flexible restore options. Single files can be downloaded from any + backup directly from the CGI interface. Zip or Tar archives for + selected files or directories can also be downloaded from the CGI + interface. +- BackupPC supports mobile environments where laptops are only + intermittently connected to the network and have dynamic IP addresses + (DHCP). +- Flexible configuration parameters allow multiple backups to be + performed in parallel. +- and more to discover in the manual... + +%description -l pl +BackupPC jest oparty na dyskach, a nie ta¶mach. Ta osobliwo¶æ daje +mo¿liwo¶ci, których nie maj± inne rozwi±zania problemu kopii +zapasowych: +- Inteligentny schemat ¶ci±gania minimalizuje zajmowane miejsce i + ilo¶æ operacji wej¶cia/wyj¶cia na dysku. Takie same pliki s± + przechowywane tylko raz (przy u¿yciu twardych dowi±zañ), co daje + znacz±c± oszczêdno¶æ w miejscu na dysku i czasie zapisu. +- Opcjonalna kompresja pozwala na dalsze ograniczenie rozmiaru. + Obci±¿enie procesora jest ma³e, poniewa¿ tylko nowe pliki musz± byæ + kompresowane. +- Potê¿ny interfejs u¿ytkownika HTTP/CGI pozwala administratorom + przegl±daæ pliki logów, konfiguracjê i aktualny stan oraz u¿ytkownikom + rozpoczynaæ lub przerywaæ tworzenie kopii oraz szybko przegl±daæ i + odtwarzaæ pliki z kopii zapasowych. +- Nie jest wymagane oprogramowanie po stronie klienta. Na WinXX + u¿ywany jest protokó³ SMB lub rsync (specjalnie przygotowana wersja + pod cygwinem). Na klientach linuksowych lub uniksowych mo¿na u¿ywaæ + rsynca lub tara (po ssh/rsh/NFS). +- Dostêpne s± elastyczne opcje odzyskiwania. Mo¿na ¶ci±gaæ pojedyncze + pliki z kopii bezpo¶rednio z interfejsu CGI. Tak¿e archiwa zip lub tar + z wybranymi plikami lub katalogami mog± byæ ¶ci±gane z poziomu + interfejsu CGI. +- BackupPC obs³uguje ¶rodowiska przeno¶ne, gdzie laptopy s± pod³±czane + do sieci tylko z przerwami i maj± dynamiczne adresy IP (z DHCP). +- Elastyczna konfiguracja parametrów pozwala na wykonywanie wielu + kopii równolegle. +- Istnieje mo¿liwo¶æ nagrywania backupu na inne no¶niki (tasmy, + DVD-R/RW, CD-R/RW i inne) +- Wiele wiêcej mo¿na odkryæ w manualu... %prep %setup -q -n BackupPC-%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +sed -i -e 's#!/bin/perl#!%{__perl}#' configure.pl +sed -i -e 's#!/bin/perl#!%{__perl}#' {bin,cgi-bin,doc}/* +sed -i -e 's#!/bin/perl#!%{__perl}#' */src/* +sed -i -e 's#!/bin/perl#!%{__perl}#' */*/*/*.pm + +pod2man --section=8 --center="BackupPC manual" doc/BackupPC.pod backuppc.8 +%{__perl} -e "s/.IX Title.*/.SH NAME\nbackuppc \\- BackupPC manual/g" -p -i.tmp backuppc.8 %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,backuppc,httpd/httpd.conf} +install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,httpd/httpd.conf} \ + $RPM_BUILD_ROOT%{_mandir}/man8 \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/www/{html,cgi-bin,html/doc} \ + $RPM_BUILD_ROOT%{_var}/{lib/%{name}/pc/localhost,log} \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/conf \ + $RPM_BUILD_ROOT%{_sysconfdir}/%{name} -echo "y" | \ -fakeroot DEBIANDEST=$RPM_BUILD_ROOT %{__perl} configure.pl +%{__perl} configure.pl \ + --batch \ + --bin-path perl=%{__perl} \ + --bin-path tar=/bin/tar \ + --bin-path smbclient=%{_bindir}/smbclient \ + --bin-path nmblookup=%{_bindir}/nmblookup \ + --bin-path rsync=%{_bindir}/rsync \ + --bin-path ping=/bin/echo \ + --bin-path df=/bin/df \ + --bin-path ssh=%{_bindir}/ssh \ + --bin-path sendmail=%{_sbindir}/sendmail \ + --bin-path par2=%{_bindir}/par \ + --bin-path hostname=/bin/hostname \ + --bin-path split=%{_bindir}/split \ + --bin-path cat=/bin/cat \ + --bin-path gzip=/bin/gzip \ + --bin-path bzip2=%{_bindir}/bzip2 \ + --cgi-dir %{_datadir}/%{name}/www/cgi-bin \ + --data-dir %{_var}/lib/%{name} \ + --dest-dir $RPM_BUILD_ROOT \ + --hostname localhost \ + --html-dir %{_datadir}/%{name}/www/html \ + --html-dir-url /BackupPC \ + --install-dir %{_usr} \ + --uid-ignore +# --config-path -pod2man --section=8 --center="BackupPC manual" doc/BackupPC.pod backuppc.8 -perl -e "s/.IX Title.*/.SH NAME\nbackuppc \\- BackupPC manual/g" -p -i.tmp backuppc.8 -rm -f $RPM_BUILD_ROOT/usr/share/backuppc/doc/* -mv -f $RPM_BUILD_ROOT/var/lib/backuppc/conf/* $RPM_BUILD_ROOT/etc/backuppc -mv -f $RPM_BUILD_ROOT/usr/share/backuppc/cgi-bin/* $RPM_BUILD_ROOT/usr/share/backuppc/cgi-bin/index.cgi -install --mode=644 conf/hosts $RPM_BUILD_ROOT/etc/backuppc -install --mode=644 debian/localhost.pl $RPM_BUILD_ROOT/etc/backuppc -install --mode=644 debian/apache.conf $RPM_BUILD_ROOT/etc/httpd/httpd.conf/93_backuppc.conf -rmdir $RPM_BUILD_ROOT/var/lib/backuppc/conf/ -mkdir $RPM_BUILD_ROOT/var/lib/backuppc/pc/localhost/ -(cd $RPM_BUILD_ROOT/usr/share/backuppc/cgi-bin; ln -s ../image) +#change user in init script +sed -i -e 's#--user backuppc#--user %{BPCuser}#' init.d/linux-backuppc +#change user in config file +sed -i -e "s#'backuppc';#'%{BPCuser}';#" $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/config.pl +sed -i -e 's/$Conf{SendmailPath} =/#$Conf{SendmailPath} =/' $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/config.pl + +install init.d/linux-backuppc $RPM_BUILD_ROOT/etc/rc.d/init.d/backuppc +install backuppc.8 $RPM_BUILD_ROOT%{_mandir}/man8 +install %{SOURCE2} $RPM_BUILD_ROOT%{_libdir}/BackupPC/Lang/pl.pm +install doc/* $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/doc +# Cleanups: +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/CVS +rm -rdf $RPM_BUILD_ROOT%{_prefix}/doc + +# symlinks +mv $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/* $RPM_BUILD_ROOT%{_sysconfdir}/%{name} +rm -rdf $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf + +cd $RPM_BUILD_ROOT%{_var}/lib/%{name} +ln -sf %{_sysconfdir}/%{name} $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf + +cd $RPM_BUILD_ROOT%{_var}/log +ln -sf %{_var}/lib/%{name}/log %{name} + +cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cgi-bin +ln -sf BackupPC_Admin index.cgi + +mv $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/BackupPC_stnd.css \ + $RPM_BUILD_ROOT/%{_sysconfdir}/%{name} + +cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html +ln -sf %{_sysconfdir}/%{name}/BackupPC_stnd.css BackupPC_stnd.css + +install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp} +install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf +install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf +touch $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/htpasswd + +%if 0 +%pre +# Add the "backuppc" user and "http" group +%groupadd -g 150 %{BPCgroup} +%useradd -c "system user for %{name}" -u 150 -d /var/lib/backuppc -s /bin/false -g %{BPCgroup} %{BPCuser} +%endif + +%post +%service backuppc restart "BackupPC" + +%preun +if [ "$1" = "0" ]; then + %service backuppc stop + /sbin/chkconfig --del backuppc +fi + +%postun +if [ "$1" = "0" ]; then + %userremove %{BPCuser} + %groupremove %{BPCgroup} +fi %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc doc/*.html -%attr(750,root,root) %dir %{_var}/backuppc -%attr(750,root,root) %dir %{_sysconfdir}/backuppc -%config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) %{_sysconfdir}/backuppc/* %attr(755,root,root) %{_bindir}/* -%{_mandir}/man?/* +%attr(755,root,root) %{_datadir}/%{name}/www/cgi-bin/BackupPC_Admin +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/www/html/doc +%{_datadir}/%{name}/www/html/doc/* +%dir %{_datadir}/%{name}/www +%dir %{_datadir}/%{name}/www/html +%dir %{_datadir}/%{name}/www/cgi-bin +%{_datadir}/%{name}/www/html/*.gif +%config(noreplace) %verify(not md5 mtime size) %{_datadir}/%{name}/www/html/BackupPC_stnd.css +%dir %{_libdir}/BackupPC +%{_libdir}/BackupPC/Attrib.pm +%{_libdir}/BackupPC/FileZIO.pm +%{_libdir}/BackupPC/Lib.pm +%{_libdir}/BackupPC/PoolWrite.pm +%{_libdir}/BackupPC/View.pm +%{_libdir}/BackupPC/CGI +%{_libdir}/BackupPC/Xfer +%{_libdir}/BackupPC/Zip +%dir %attr(755,%{BPCuser},%{BPCgroup}) %{_libdir}/BackupPC/Lang +%lang(en) %{_libdir}/BackupPC/Lang/en.pm +%lang(de) %{_libdir}/BackupPC/Lang/de.pm +%lang(fr) %{_libdir}/BackupPC/Lang/fr.pm +%lang(es) %{_libdir}/BackupPC/Lang/es.pm +%lang(it) %{_libdir}/BackupPC/Lang/it.pm +%lang(nl) %{_libdir}/BackupPC/Lang/nl.pm +%lang(pl) %{_libdir}/BackupPC/Lang/pl.pm +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name} +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/cpool +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/log +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/pc +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/pool +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/trash +%dir %attr(755,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/conf +%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/log/%{name} +%attr(754,root,root) /etc/rc.d/init.d/backuppc +%dir %{_sysconfdir}/%{name} +%{_mandir}/man8/backuppc* +%config(noreplace) %verify(not md5 mtime size) %attr(644,%{BPCuser},%{BPCgroup}) %{_sysconfdir}/%{name}/* +%dir %attr(750,root,http) %{_webapps}/%{_webapp} +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf +%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/htpasswd