- up to 3.0.0, NFY, not tested
[packages/BackupPC.git] / BackupPC.spec
CommitLineData
9478b6bb 1
70dd92c5 2# - now path in browser is http://localhost/cgi/BackupPC/BackupPC_Admin
e8b484a8 3# TODO:
ec0b6580 4# - trigers
087f2434 5# - polish translation in SOURCE/backuppc-pl.pm
70dd92c5 6# - patch at user and gid/uid user - http://sourceforge.net/mailarchive/forum.php?thread_id=6201024&forum_id=17540
70dd92c5 7# - change or/and add Requires for --bin-path sendmail=%{_sbindir}/sendmail
29785c59 8# - correct config file
70dd92c5 9
ec0b6580 10%define oldname backuppc
b4718529 11%define BPCuser http
70dd92c5 12%define BPCgroup http
e53e588a 13%include /usr/lib/rpm/macros.perl
9478b6bb 14
bfdb5e2e 15Summary: A high-performance, enterprise-grade system for backing up
b387d795 16Summary(pl.UTF-8): Wysoko wydajny, profesjonalnej klasy system do kopii zapasowych
ec0b6580
MWP
17Name: BackupPC
18Version: 3.0.0
19Release: 0.1
e53e588a
AM
20License: GPL
21Group: Networking/Utilities
ec0b6580
MWP
22Source0: http://dl.sourceforge.net/backuppc/%{name}-%{version}.tar.gz
23# Source0-md5: dc37728c1dc9225354523f279045f3f3
24Source1: %{oldname}_apache.conf
25Source2: %{oldname}-pl.pm
26Patch0: %{oldname}-usernotexist.patch
27Patch1: %{oldname}-pathtodocs.patch
e53e588a 28URL: http://backuppc.sourceforge.net/
e53e588a 29BuildRequires: perl-Compress-Zlib
ed441291 30BuildRequires: perl-Digest-MD5
e1f29e27 31BuildRequires: perl-devel >= 1:5.6.0
7759c7a4 32BuildRequires: rpm-perlprov
15c89417 33BuildRequires: rpmbuild(macros) >= 1.268
a6c35446 34BuildRequires: sed >= 4.0
9b5058aa 35Requires(post,preun): /sbin/chkconfig
c871e746 36Requires: apache(mod_auth)
15c89417 37Requires: apache(mod_perl)
c871e746 38Requires: par2cmdline
36ac5999
MWP
39Requires: perl-Archive-Zip
40Requires: perl-Compress-Bzip2
c871e746
ER
41Requires: perl-Compress-Zlib
42Requires: perl-File-RsyncP >= 0.52
9b5058aa 43Requires: rc-scripts
36ac5999 44Requires: rsync
fd06574e 45Requires: samba-client
716c2a0b 46Requires: sperl
8f3ae6d3 47Requires: tar > 1.13
15c89417 48Requires: webapps
dbb0a940 49Provides: group(%{BPCgroup})
50Provides: user(%{BPCuser})
e53e588a 51Obsoletes: BackupPC
ec0b6580 52Obsoletes: backuppc
ed441291 53BuildArch: noarch
e53e588a
AM
54BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
15c89417
ER
56%define _webapps /etc/webapps
57%define _webapp %{name}
ba74a3a0 58%define _libdir /usr/lib
15c89417 59
e53e588a
AM
60%description
61BackupPC is disk based and not tape based. This particularity allows
62features not found in any other backup solution:
4077336d
SP
63- Clever pooling scheme minimizes disk storage and disk I/O. Identical
64 files across multiple backups of the same or different PC are stored
f1be31de
ER
65 only once (using hard links), resulting in substantial savings in disk
66 storage and disk writes.
4077336d
SP
67- Optional compression provides additional reductions in storage. CPU
68 impact of compression is low since only new files (those not already
69 in the pool) need to be compressed.
70- A powerful http/cgi user interface allows administrators to view log
f1be31de
ER
71 files, configuration, current status and allows users to initiate and
72 cancel backups and browse and restore files from backups very quickly.
2d60d17e 73- No client-side software is needed. On WinXX the SMB protocol is
f1be31de
ER
74 used. On Linux or unix clients, rsync or tar (over ssh/rsh/NFS) can be
75 used.
2d60d17e 76- Flexible restore options. Single files can be downloaded from any
77 backup directly from the CGI interface. Zip or Tar archives for
78 selected files or directories can also be downloaded from the CGI
79 interface.
80- BackupPC supports mobile environments where laptops are only
f1be31de
ER
81 intermittently connected to the network and have dynamic IP addresses
82 (DHCP).
2d60d17e 83- Flexible configuration parameters allow multiple backups to be
84 performed in parallel.
85- and more to discover in the manual...
e53e588a 86
04a75958
JR
87%description -l pl.UTF-8
88BackupPC jest oparty na dyskach, a nie taśmach. Ta osobliwość daje
89możliwości, których nie mają inne rozwiązania problemu kopii
ed441291 90zapasowych:
04a75958
JR
91- Inteligentny schemat ściągania minimalizuje zajmowane miejsce i
92 ilość operacji wejścia/wyjścia na dysku. Takie same pliki są
93 przechowywane tylko raz (przy użyciu twardych dowiązań), co daje
94 znaczącą oszczędność w miejscu na dysku i czasie zapisu.
2d60d17e 95- Opcjonalna kompresja pozwala na dalsze ograniczenie rozmiaru.
04a75958 96 Obciążenie procesora jest małe, ponieważ tylko nowe pliki muszą być
4077336d 97 kompresowane.
04a75958
JR
98- Potężny interfejs użytkownika HTTP/CGI pozwala administratorom
99 przeglądać pliki logów, konfigurację i aktualny stan oraz użytkownikom
100 rozpoczynać lub przerywać tworzenie kopii oraz szybko przeglądać i
101 odtwarzać pliki z kopii zapasowych.
2d60d17e 102- Nie jest wymagane oprogramowanie po stronie klienta. Na WinXX
04a75958
JR
103 używany jest protokół SMB lub rsync (specjalnie przygotowana wersja
104 pod cygwinem). Na klientach linuksowych lub uniksowych można używać
32915a9f 105 rsynca lub tara (po ssh/rsh/NFS).
04a75958
JR
106- Dostępne są elastyczne opcje odzyskiwania. Można ściągać pojedyncze
107 pliki z kopii bezpośrednio z interfejsu CGI. Także archiwa zip lub tar
108 z wybranymi plikami lub katalogami mogą być ściągane z poziomu
2d60d17e 109 interfejsu CGI.
04a75958
JR
110- BackupPC obsługuje środowiska przenośne, gdzie laptopy są podłączane
111 do sieci tylko z przerwami i mają dynamiczne adresy IP (z DHCP).
112- Elastyczna konfiguracja parametrów pozwala na wykonywanie wielu
113 kopii równolegle.
114- Istnieje możliwość nagrywania backupu na inne nośniki (tasmy,
bfdb5e2e 115 DVD-R/RW, CD-R/RW i inne)
04a75958 116- Wiele więcej można odkryć w manualu...
ed441291 117
e53e588a 118%prep
ec0b6580 119%setup -q
e53e588a 120
8f3ae6d3
PG
121sed -i -e 's#!/bin/perl#!%{__perl}#' configure.pl
122sed -i -e 's#!/bin/perl#!%{__perl}#' {bin,cgi-bin,doc}/*
123sed -i -e 's#!/bin/perl#!%{__perl}#' */src/*
124sed -i -e 's#!/bin/perl#!%{__perl}#' */*/*/*.pm
125
126pod2man --section=8 --center="BackupPC manual" doc/BackupPC.pod backuppc.8
a6c35446 127%{__perl} -e "s/.IX Title.*/.SH NAME\nbackuppc \\- BackupPC manual/g" -p -i.tmp backuppc.8
8f3ae6d3 128
e53e588a
AM
129%install
130rm -rf $RPM_BUILD_ROOT
85f11ed8 131install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,httpd/httpd.conf} \
0bec8bf5 132 $RPM_BUILD_ROOT%{_mandir}/man8 \
ec0b6580
MWP
133 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/doc \
134 $RPM_BUILD_ROOT%{_var}/{lib/%{name}/{pc/localhost,log},log} \
716c2a0b 135 $RPM_BUILD_ROOT%{_datadir}/%{name}/conf \
ef6a73f9 136 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
e53e588a 137
528c20b1
PG
138%{__perl} configure.pl \
139 --batch \
140 --bin-path perl=%{__perl} \
141 --bin-path tar=/bin/tar \
7670e654
SP
142 --bin-path smbclient=%{_bindir}/smbclient \
143 --bin-path nmblookup=%{_bindir}/nmblookup \
144 --bin-path rsync=%{_bindir}/rsync \
70dd92c5 145 --bin-path ping=/bin/echo \
528c20b1 146 --bin-path df=/bin/df \
7670e654
SP
147 --bin-path ssh=%{_bindir}/ssh \
148 --bin-path sendmail=%{_sbindir}/sendmail \
dbca77df 149 --bin-path par2=%{_bindir}/par \
528c20b1 150 --bin-path hostname=/bin/hostname \
7670e654 151 --bin-path split=%{_bindir}/split \
528c20b1
PG
152 --bin-path cat=/bin/cat \
153 --bin-path gzip=/bin/gzip \
7670e654 154 --bin-path bzip2=%{_bindir}/bzip2 \
a6c35446 155 --cgi-dir %{_datadir}/%{name}/www/cgi-bin \
91ca4cc8 156 --data-dir %{_var}/lib/%{name} \
528c20b1
PG
157 --dest-dir $RPM_BUILD_ROOT \
158 --hostname localhost \
a6c35446 159 --html-dir %{_datadir}/%{name}/www/html \
716c2a0b 160 --html-dir-url /BackupPC \
15f2d638 161 --install-dir %{_usr} \
ec0b6580
MWP
162 --uid-ignore \
163 --no-set-perms \
164 --fhs \
165 --dest-dir $RPM_BUILD_ROOT \
166 --compress-level=3 \
167 --backuppc-user=%{BPCuser}
168# --config-path=%{_sysconfdir}/%{name}/config.pl
9478b6bb 169
70dd92c5
MWP
170#change user in init script
171sed -i -e 's#--user backuppc#--user %{BPCuser}#' init.d/linux-backuppc
172#change user in config file
ec0b6580
MWP
173#sed -i -e "s#'backuppc';#'%{BPCuser}';#" $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.pl
174#sed -i -e 's/$Conf{SendmailPath} =/#$Conf{SendmailPath} =/' $RPM_BUILD_ROOTT%{_sysconfdir}/%{name}/config.pl
70dd92c5 175
a6c35446 176install init.d/linux-backuppc $RPM_BUILD_ROOT/etc/rc.d/init.d/backuppc
ef6a73f9 177install backuppc.8 $RPM_BUILD_ROOT%{_mandir}/man8
15c89417 178install %{SOURCE2} $RPM_BUILD_ROOT%{_libdir}/BackupPC/Lang/pl.pm
ef6a73f9 179install doc/* $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/doc
8f3ae6d3 180# Cleanups:
91ca4cc8 181rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/CVS
f62775bb 182rm -rdf $RPM_BUILD_ROOT%{_prefix}/doc
7ca1bf72 183
c7cf1aea 184# symlinks
ef6a73f9
MWP
185cd $RPM_BUILD_ROOT%{_var}/lib/%{name}
186ln -sf %{_sysconfdir}/%{name} $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf
c7cf1aea
MWP
187
188cd $RPM_BUILD_ROOT%{_var}/log
32915a9f 189ln -sf %{_var}/lib/%{name}/log %{name}
c7cf1aea 190
a6c35446 191cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cgi-bin
67934a81 192ln -sf BackupPC_Admin index.cgi
32915a9f 193
ec0b6580 194mv $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/*.css \
b7dc9a92 195 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
ef6a73f9
MWP
196
197cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html
198ln -sf %{_sysconfdir}/%{name}/BackupPC_stnd.css BackupPC_stnd.css
ec0b6580 199ln -sf %{_sysconfdir}/%{name}/BackupPC_stnd.css BackupPC.css
ef6a73f9 200
15c89417
ER
201install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
202install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
203install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
204touch $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/htpasswd
70dd92c5 205
e326eb5b 206%if 0
9478b6bb 207%pre
ec9606b7 208# Add the "backuppc" user and "http" group
e326eb5b 209%groupadd -g 150 %{BPCgroup}
ec9606b7 210%useradd -c "system user for %{name}" -u 150 -d /var/lib/backuppc -s /bin/false -g %{BPCgroup} %{BPCuser}
e326eb5b
ER
211%endif
212
91ca4cc8 213%post
f62775bb 214%service backuppc restart "BackupPC"
6e436f98 215
f62775bb
ER
216%preun
217if [ "$1" = "0" ]; then
218 %service backuppc stop
219 /sbin/chkconfig --del backuppc
ef6a73f9 220fi
91ca4cc8 221
dbb0a940 222%postun
223if [ "$1" = "0" ]; then
224 %userremove %{BPCuser}
225 %groupremove %{BPCgroup}
226fi
227
e53e588a
AM
228%clean
229rm -rf $RPM_BUILD_ROOT
230
231%files
232%defattr(644,root,root,755)
91ca4cc8 233%attr(755,root,root) %{_bindir}/*
a6c35446 234%attr(755,root,root) %{_datadir}/%{name}/www/cgi-bin/BackupPC_Admin
51256ae1 235%dir %{_datadir}/%{name}
ef6a73f9
MWP
236%dir %{_datadir}/%{name}/www/html/doc
237%{_datadir}/%{name}/www/html/doc/*
51256ae1 238%dir %{_datadir}/%{name}/www
a6c35446 239%dir %{_datadir}/%{name}/www/html
51256ae1 240%dir %{_datadir}/%{name}/www/cgi-bin
ec0b6580 241%{_datadir}/%{name}/www/html/*.png
a6c35446 242%{_datadir}/%{name}/www/html/*.gif
ec0b6580
MWP
243%config(noreplace) %verify(not md5 mtime size) %{_datadir}/%{name}/www/html/*.css
244%dir %{_libdir}/%{name}
245%{_libdir}/%{name}/CGI/*
246%{_libdir}/%{name}/Xfer/*
247%{_libdir}/%{name}/Storage/*
248%{_libdir}/%{name}/Zip/*
249%{_libdir}/%{name}/Config/*
250%{_libdir}/%{name}/Attrib.pm
251%{_libdir}/%{name}/Config.pm
252%{_libdir}/%{name}/FileZIO.pm
253%{_libdir}/%{name}/Lib.pm
254%{_libdir}/%{name}/PoolWrite.pm
255%{_libdir}/%{name}/Storage.pm
256%{_libdir}/%{name}/View.pm
ef6a73f9 257%dir %attr(755,%{BPCuser},%{BPCgroup}) %{_libdir}/BackupPC/Lang
c7cf1aea
MWP
258%lang(en) %{_libdir}/BackupPC/Lang/en.pm
259%lang(de) %{_libdir}/BackupPC/Lang/de.pm
260%lang(fr) %{_libdir}/BackupPC/Lang/fr.pm
261%lang(es) %{_libdir}/BackupPC/Lang/es.pm
262%lang(it) %{_libdir}/BackupPC/Lang/it.pm
263%lang(nl) %{_libdir}/BackupPC/Lang/nl.pm
ce281259 264%lang(pl) %{_libdir}/BackupPC/Lang/pl.pm
ec0b6580 265%lang(pt_br) %{_libdir}/BackupPC/Lang/pt_br.pm
ef6a73f9 266%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}
15f2d638 267%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/cpool
268%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/log
269%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/pc
270%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/pool
271%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/trash
5e8a66d7 272%dir %attr(755,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/conf
ef6a73f9 273%dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/log/%{name}
f1be31de 274%attr(754,root,root) /etc/rc.d/init.d/backuppc
c7cf1aea 275%dir %{_sysconfdir}/%{name}
0bec8bf5 276%{_mandir}/man8/backuppc*
15c89417
ER
277%config(noreplace) %verify(not md5 mtime size) %attr(644,%{BPCuser},%{BPCgroup}) %{_sysconfdir}/%{name}/*
278%dir %attr(750,root,http) %{_webapps}/%{_webapp}
279%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
280%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
281%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/htpasswd
This page took 0.148724 seconds and 4 git commands to generate.