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