X-Git-Url: http://git.pld-linux.org/?p=packages%2FBackupPC.git;a=blobdiff_plain;f=BackupPC.spec;h=067029f1c2166c5bcf260f85be2b485841dd7e03;hp=059da67ff3d42875500d748ede9a3a2f5c0f97ad;hb=67934a814f19836d9eef38cf14925bb6be198db3;hpb=528c20b1cc032cd7d21be02ed186d2140a487708 diff --git a/BackupPC.spec b/BackupPC.spec index 059da67..067029f 100644 --- a/BackupPC.spec +++ b/BackupPC.spec @@ -1,56 +1,63 @@ -# TODO: -# - make it simply build... -# - make pre/post for apache + +#TO DO: +# - polish translation %{_libdir}/BackupPC/Lang/pl.pm + +%define BPCuser backuppc +%define BPCgroup backuppc %include /usr/lib/rpm/macros.perl + Summary: A high-performance, enterprise-grade system for backing up PCs Summary(pl): Wysoko wydajny, profesjonalnej klasy system do kopii zapasowych z PC Name: backuppc Version: 2.1.0 -Release: 0.1 +Release: 0.5 License: GPL Group: Networking/Utilities Source0: http://dl.sourceforge.net/backuppc/BackupPC-%{version}.tar.gz # Source0-md5: 4e201f00842c88cf241e0429643c6ec4 +Source1: %{name}_apache.conf +Source2: %{name}_htaccess +Patch0: %{name}-usernotexist.patch URL: http://backuppc.sourceforge.net/ -#BuildRequires: fakeroot -BuildRequires: perl-base -BuildRequires: perl-devel >= 1:5.6.0 BuildRequires: perl-Compress-Zlib BuildRequires: perl-Digest-MD5 -Requires: samba-clients -# lets check if it's really needed -#Requires: sperl +BuildRequires: perl-base +BuildRequires: perl-devel >= 1:5.6.0 +BuildRequires: rpmbuild(macros) >= 1.159 +Requires: apache +Requires: samba-client +Requires: sperl Requires: tar > 1.13 -Requires: webserver +Provides: group(%{BPCgroup}) +Provides: user(%{BPCuser}) Obsoletes: BackupPC BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define _backuppcdir %{_datadir}/%{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. + 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. + 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. + 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). + 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... @@ -67,15 +74,16 @@ zapasowych: 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. + 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. Na klientach linuksowych lub uniksowych - mo¿na u¿ywaæ rsynca lub tara (po ssh/rsh/NFS). + 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 + 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). @@ -85,7 +93,7 @@ zapasowych: %prep %setup -q -n BackupPC-%{version} -#%patch0 -p1 +%patch0 -p1 %build sed -i -e 's#!/bin/perl#!%{__perl}#' configure.pl @@ -98,60 +106,125 @@ perl -e "s/.IX Title.*/.SH NAME\nbackuppc \\- BackupPC manual/g" -p -i.tmp backu %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,%{name},httpd/httpd.conf} \ - $RPM_BUILD_ROOT%{_var}/lib/%{name}/pc/localhost +install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,httpd/httpd.conf} \ + $RPM_BUILD_ROOT%{_usr}/share/%{name}/www/html \ + $RPM_BUILD_ROOT%{_var}/{lib/%{name}/pc/localhost,log} \ + $RPM_BUILD_ROOT%{_datadir}/%{name}/conf \ + $RPM_BUILD_ROOT/home/services/httpd/cgi-bin/%{name} -# Does not work, yet... some voodoo-magic is needed -#echo "y" | fakeroot DEBIANDEST=$RPM_BUILD_ROOT configure.pl %{__perl} configure.pl \ --batch \ --bin-path perl=%{__perl} \ --bin-path tar=/bin/tar \ - --bin-path smbclient=/usr/bin/smbclient \ - --bin-path nmblookup=/usr/bin/nmblookup \ - --bin-path rsync=/usr/bin/rsync \ + --bin-path smbclient=%{_bindir}/smbclient \ + --bin-path nmblookup=%{_bindir}/nmblookup \ + --bin-path rsync=%{_bindir}/rsync \ --bin-path ping=/bin/ping \ --bin-path df=/bin/df \ - --bin-path ssh=/usr/bin/ssh \ - --bin-path sendmail=/usr/sbin/sendmail \ + --bin-path ssh=%{_bindir}/ssh \ + --bin-path sendmail=%{_sbindir}/sendmail \ --bin-path hostname=/bin/hostname \ - --bin-path split=/usr/bin/split \ + --bin-path split=%{_bindir}/split \ --bin-path cat=/bin/cat \ --bin-path gzip=/bin/gzip \ - --bin-path bzip2=/usr/bin/bzip2 \ - --cgi-dir %{_backuppcdir}/www/cgi-bin \ + --bin-path bzip2=%{_bindir}/bzip2 \ + --cgi-dir /home/services/httpd/cgi-bin/%{name} \ --data-dir %{_var}/lib/%{name} \ --dest-dir $RPM_BUILD_ROOT \ --hostname localhost \ - --html-dir %{_backuppcdir}/www/html \ + --html-dir %{_usr}/share/%{name}/www/html \ --html-dir-url /BackupPC \ - --install-dir %{_backuppcdir} \ + --install-dir %{_usr} \ --uid-ignore -# --config-path %{_sysconfdir}/backuppc \ +# --config-path -#mv -f $RPM_BUILD_ROOT/var/lib/backuppc/conf/* $RPM_BUILD_ROOT%{_sysconfdir}/backuppc -#mv -f $RPM_BUILD_ROOT%{_datadir}/backuppc/cgi-bin/BackupPC_Admin $RPM_BUILD_ROOT%{_datadir}/backuppc/cgi-bin/index.cgi -#install conf/hosts $RPM_BUILD_ROOT%{_sysconfdir}/backuppc -#install debian/localhost.pl $RPM_BUILD_ROOT%{_sysconfdir}/backuppc -#install debian/apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/93_backuppc.conf +install init.d/linux-backuppc $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/backuppc +install conf/BackupPC_stnd.css $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/BackupPC_stnd.css +install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/93_backuppc.conf +install %{SOURCE2} $RPM_BUILD_ROOT/home/services/httpd/cgi-bin/%{name}/.htaccess # Cleanups: -#rm -f $RPM_BUILD_ROOT%{_datadir}/backuppc/doc/* -#rmdir $RPM_BUILD_ROOT/var/lib/backuppc/conf +rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/CVS + +# symlinks +cd $RPM_BUILD_ROOT%{_sysconfdir} +ln -sf %{_var}/lib/%{name}/conf %{name} + +cd $RPM_BUILD_ROOT%{_var}/log +ln -sf %{_var}/lib/%{name}/log %{name} + +cd $RPM_BUILD_ROOT/home/services/httpd/cgi-bin/%{name} +ln -sf BackupPC_Admin index.cgi + +%pre +# Add the "backuppc" user and group +if [ -n "`/usr/bin/getgid %{BPCgroup}`" ]; then + if [ "`/usr/bin/getgid %{BPCgroup}`" != "150" ]; then + echo "Error: group %{BPCgroup} doesn't have gid=150. Correct this before installing %{name}." 1>&2 + exit 1 + fi +else + /usr/sbin/groupadd -g 150 %{BPCgroup} +fi +if [ -n "`/bin/id -u %{BPCuser} 2>/dev/null`" ]; then + if [ "`/bin/id -u %{BPCuser}`" != 150 ]; then + echo "Error: user %{BPCuser} doesn't have uid=150. Correct this before installing %{name}." 1>&2 + exit 1 + fi +else + /usr/sbin/useradd -c "system user for %{name}" -u 150 \ + -d /home/services/BackupPC -s /bin/false -g %{BPCgroup} %{BPCuser} 1>&2 +fi + +%post +/etc/init.d/backuppc restart -# Linking cgi: -#cd $RPM_BUILD_ROOT%{_datadir}/backuppc/cgi-bin -#ln -s ../image +%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 %{_sysconfdir}/backuppc -#%config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) %{_sysconfdir}/backuppc/* -#%config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) %{_sysconfdir}/httpd/httpd.conf/93_backuppc.conf -#%attr(755,root,root) %{_bindir}/* -#%attr(750,root,root) %dir %{_var}/lib/backuppc -#%{_mandir}/man?/* +%attr(755,root,root) %{_bindir}/* +%doc %{_usr}/doc/*.html +%doc %{_usr}/doc/BackupPC.pod +%dir /home/services/httpd/cgi-bin/%{name} +%attr(755,root,root)/home/services/httpd/cgi-bin/%{name}/* +%dir %{_usr}/share/%{name}/www/html +%{_usr}/share/%{name}/www/html/* +%dir %{_libdir}/BackupPC +%{_libdir}/BackupPC/Attrib.pm +%{_libdir}/BackupPC/FileZIO.pm +%{_libdir}/BackupPC/Lib.pm +%{_libdir}/BackupPC/PoolWrite.pm +%{_libdir}/BackupPC/View.pm +%dir %{_libdir}/BackupPC/CGI +%{_libdir}/BackupPC/CGI/* +%dir %{_libdir}/BackupPC/Xfer +%{_libdir}/BackupPC/Xfer/* +%dir %{_libdir}/BackupPC/Zip +%{_libdir}/BackupPC/Zip/* +%dir %{_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 +%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 %{_var}/lib/%{name}/conf +%dir %{_var}/log/%{name} +%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/backuppc +%{_sysconfdir}/httpd/httpd.conf/93_backuppc.conf +%dir %{_sysconfdir}/%{name} +%config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) /home/services/httpd/cgi-bin/%{name}/.htaccess +%config(noreplace) %verify(not md5 size mtime) %{_var}/lib/%{name}/conf/*