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