]>
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.0.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: dc37728c1dc9225354523f279045f3f3 | |
24 | Source1: %{oldname}_apache.conf | |
25 | Source2: %{oldname}-pl.pm | |
26 | Patch0: %{oldname}-usernotexist.patch | |
27 | Patch1: %{oldname}-pathtodocs.patch | |
28 | URL: http://backuppc.sourceforge.net/ | |
29 | BuildRequires: perl-Compress-Zlib | |
30 | BuildRequires: perl-Digest-MD5 | |
31 | BuildRequires: perl-devel >= 1:5.6.0 | |
32 | BuildRequires: rpm-perlprov | |
33 | BuildRequires: rpmbuild(macros) >= 1.268 | |
34 | BuildRequires: sed >= 4.0 | |
35 | Requires(post,preun): /sbin/chkconfig | |
36 | Requires: apache(mod_auth) | |
37 | Requires: apache(mod_perl) | |
38 | Requires: par2cmdline | |
39 | Requires: perl-Archive-Zip | |
40 | Requires: perl-Compress-Bzip2 | |
41 | Requires: perl-Compress-Zlib | |
42 | Requires: perl-File-RsyncP >= 0.52 | |
43 | Requires: rc-scripts | |
44 | Requires: rsync | |
45 | Requires: samba-client | |
46 | Requires: sperl | |
47 | Requires: tar > 1.13 | |
48 | Requires: webapps | |
49 | Provides: group(%{BPCgroup}) | |
50 | Provides: user(%{BPCuser}) | |
51 | Obsoletes: BackupPC | |
52 | Obsoletes: backuppc | |
53 | BuildArch: noarch | |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
55 | ||
56 | %define _webapps /etc/webapps | |
57 | %define _webapp %{name} | |
58 | %define _libdir /usr/lib | |
59 | ||
60 | %description | |
61 | BackupPC is disk based and not tape based. This particularity allows | |
62 | features not found in any other backup solution: | |
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 | |
65 | only once (using hard links), resulting in substantial savings in disk | |
66 | storage and disk writes. | |
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 | |
71 | files, configuration, current status and allows users to initiate and | |
72 | cancel backups and browse and restore files from backups very quickly. | |
73 | - No client-side software is needed. On WinXX the SMB protocol is | |
74 | used. On Linux or unix clients, rsync or tar (over ssh/rsh/NFS) can be | |
75 | used. | |
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 | |
81 | intermittently connected to the network and have dynamic IP addresses | |
82 | (DHCP). | |
83 | - Flexible configuration parameters allow multiple backups to be | |
84 | performed in parallel. | |
85 | - and more to discover in the manual... | |
86 | ||
87 | %description -l pl.UTF-8 | |
88 | BackupPC jest oparty na dyskach, a nie taśmach. Ta osobliwość daje | |
89 | możliwości, których nie mają inne rozwiązania problemu kopii | |
90 | zapasowych: | |
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. | |
95 | - Opcjonalna kompresja pozwala na dalsze ograniczenie rozmiaru. | |
96 | Obciążenie procesora jest małe, ponieważ tylko nowe pliki muszą być | |
97 | kompresowane. | |
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. | |
102 | - Nie jest wymagane oprogramowanie po stronie klienta. Na WinXX | |
103 | używany jest protokół SMB lub rsync (specjalnie przygotowana wersja | |
104 | pod cygwinem). Na klientach linuksowych lub uniksowych można używać | |
105 | rsynca lub tara (po ssh/rsh/NFS). | |
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 | |
109 | interfejsu CGI. | |
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, | |
115 | DVD-R/RW, CD-R/RW i inne) | |
116 | - Wiele więcej można odkryć w manualu... | |
117 | ||
118 | %prep | |
119 | %setup -q | |
120 | ||
121 | sed -i -e 's#!/bin/perl#!%{__perl}#' configure.pl | |
122 | sed -i -e 's#!/bin/perl#!%{__perl}#' {bin,cgi-bin,doc}/* | |
123 | sed -i -e 's#!/bin/perl#!%{__perl}#' */src/* | |
124 | sed -i -e 's#!/bin/perl#!%{__perl}#' */*/*/*.pm | |
125 | ||
126 | pod2man --section=8 --center="BackupPC manual" doc/BackupPC.pod backuppc.8 | |
127 | %{__perl} -e "s/.IX Title.*/.SH NAME\nbackuppc \\- BackupPC manual/g" -p -i.tmp backuppc.8 | |
128 | ||
129 | %install | |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,httpd/httpd.conf} \ | |
132 | $RPM_BUILD_ROOT%{_mandir}/man8 \ | |
133 | $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/doc \ | |
134 | $RPM_BUILD_ROOT%{_var}/{lib/%{name}/{pc/localhost,log},log} \ | |
135 | $RPM_BUILD_ROOT%{_datadir}/%{name}/conf \ | |
136 | $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
137 | ||
138 | %{__perl} configure.pl \ | |
139 | --batch \ | |
140 | --bin-path perl=%{__perl} \ | |
141 | --bin-path tar=/bin/tar \ | |
142 | --bin-path smbclient=%{_bindir}/smbclient \ | |
143 | --bin-path nmblookup=%{_bindir}/nmblookup \ | |
144 | --bin-path rsync=%{_bindir}/rsync \ | |
145 | --bin-path ping=/bin/echo \ | |
146 | --bin-path df=/bin/df \ | |
147 | --bin-path ssh=%{_bindir}/ssh \ | |
148 | --bin-path sendmail=%{_sbindir}/sendmail \ | |
149 | --bin-path par2=%{_bindir}/par \ | |
150 | --bin-path hostname=/bin/hostname \ | |
151 | --bin-path split=%{_bindir}/split \ | |
152 | --bin-path cat=/bin/cat \ | |
153 | --bin-path gzip=/bin/gzip \ | |
154 | --bin-path bzip2=%{_bindir}/bzip2 \ | |
155 | --cgi-dir %{_datadir}/%{name}/www/cgi-bin \ | |
156 | --data-dir %{_var}/lib/%{name} \ | |
157 | --dest-dir $RPM_BUILD_ROOT \ | |
158 | --hostname localhost \ | |
159 | --html-dir %{_datadir}/%{name}/www/html \ | |
160 | --html-dir-url /BackupPC \ | |
161 | --install-dir %{_usr} \ | |
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 | |
169 | ||
170 | #change user in init script | |
171 | sed -i -e 's#--user backuppc#--user %{BPCuser}#' init.d/linux-backuppc | |
172 | #change user in config file | |
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 | |
175 | ||
176 | install init.d/linux-backuppc $RPM_BUILD_ROOT/etc/rc.d/init.d/backuppc | |
177 | install backuppc.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
178 | install %{SOURCE2} $RPM_BUILD_ROOT%{_libdir}/BackupPC/Lang/pl.pm | |
179 | install doc/* $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/doc | |
180 | # Cleanups: | |
181 | rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/CVS | |
182 | rm -rdf $RPM_BUILD_ROOT%{_prefix}/doc | |
183 | ||
184 | # symlinks | |
185 | cd $RPM_BUILD_ROOT%{_var}/lib/%{name} | |
186 | ln -sf %{_sysconfdir}/%{name} $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf | |
187 | ||
188 | cd $RPM_BUILD_ROOT%{_var}/log | |
189 | ln -sf %{_var}/lib/%{name}/log %{name} | |
190 | ||
191 | cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cgi-bin | |
192 | ln -sf BackupPC_Admin index.cgi | |
193 | ||
194 | mv $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/*.css \ | |
195 | $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
196 | ||
197 | cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html | |
198 | ln -sf %{_sysconfdir}/%{name}/BackupPC_stnd.css BackupPC_stnd.css | |
199 | ln -sf %{_sysconfdir}/%{name}/BackupPC_stnd.css BackupPC.css | |
200 | ||
201 | install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp} | |
202 | install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf | |
203 | install %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
204 | touch $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/htpasswd | |
205 | ||
206 | %if 0 | |
207 | %pre | |
208 | # Add the "backuppc" user and "http" group | |
209 | %groupadd -g 150 %{BPCgroup} | |
210 | %useradd -c "system user for %{name}" -u 150 -d /var/lib/backuppc -s /bin/false -g %{BPCgroup} %{BPCuser} | |
211 | %endif | |
212 | ||
213 | %post | |
214 | %service backuppc restart "BackupPC" | |
215 | ||
216 | %preun | |
217 | if [ "$1" = "0" ]; then | |
218 | %service backuppc stop | |
219 | /sbin/chkconfig --del backuppc | |
220 | fi | |
221 | ||
222 | %postun | |
223 | if [ "$1" = "0" ]; then | |
224 | %userremove %{BPCuser} | |
225 | %groupremove %{BPCgroup} | |
226 | fi | |
227 | ||
228 | %clean | |
229 | rm -rf $RPM_BUILD_ROOT | |
230 | ||
231 | %files | |
232 | %defattr(644,root,root,755) | |
233 | %attr(755,root,root) %{_bindir}/* | |
234 | %attr(755,root,root) %{_datadir}/%{name}/www/cgi-bin/BackupPC_Admin | |
235 | %dir %{_datadir}/%{name} | |
236 | %dir %{_datadir}/%{name}/www/html/doc | |
237 | %{_datadir}/%{name}/www/html/doc/* | |
238 | %dir %{_datadir}/%{name}/www | |
239 | %dir %{_datadir}/%{name}/www/html | |
240 | %dir %{_datadir}/%{name}/www/cgi-bin | |
241 | %{_datadir}/%{name}/www/html/*.png | |
242 | %{_datadir}/%{name}/www/html/*.gif | |
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 | |
257 | %dir %attr(755,%{BPCuser},%{BPCgroup}) %{_libdir}/BackupPC/Lang | |
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 | |
264 | %lang(pl) %{_libdir}/BackupPC/Lang/pl.pm | |
265 | %lang(pt_br) %{_libdir}/BackupPC/Lang/pt_br.pm | |
266 | %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name} | |
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 | |
272 | %dir %attr(755,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/conf | |
273 | %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/log/%{name} | |
274 | %attr(754,root,root) /etc/rc.d/init.d/backuppc | |
275 | %dir %{_sysconfdir}/%{name} | |
276 | %{_mandir}/man8/backuppc* | |
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 |