]> git.pld-linux.org Git - packages/BackupPC.git/blob - BackupPC.spec
- add R
[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.159
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
59   disk 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
65   and cancel backups and browse and restore files from backups very
66   quickly.
67 - No client-side software is needed. On WinXX the SMB protocol is
68   used. On Linux or unix clients, rsync or tar (over ssh/rsh/NFS) can
69   be used.
70 - Flexible restore options. Single files can be downloaded from any
71   backup directly from the CGI interface. Zip or Tar archives for
72   selected files or directories can also be downloaded from the CGI
73   interface.
74 - BackupPC supports mobile environments where laptops are only
75   intermittently connected to the network and have dynamic IP
76   addresses (DHCP).
77 - Flexible configuration parameters allow multiple backups to be
78   performed in parallel.
79 - and more to discover in the manual...
80
81 %description -l pl
82 BackupPC jest oparty na dyskach, a nie ta¶mach. Ta osobliwo¶æ daje
83 mo¿liwo¶ci, których nie maj± inne rozwi±zania problemu kopii
84 zapasowych:
85 - Inteligentny schemat ¶ci±gania minimalizuje zajmowane miejsce i
86   ilo¶æ operacji wej¶cia/wyj¶cia na dysku. Takie same pliki s±
87   przechowywane tylko raz (przy u¿yciu twardych dowi±zañ), co daje
88   znacz±c± oszczêdno¶æ w miejscu na dysku i czasie zapisu.
89 - Opcjonalna kompresja pozwala na dalsze ograniczenie rozmiaru.
90   Obci±¿enie procesora jest ma³e, poniewa¿ tylko nowe pliki musz± byæ
91   kompresowane.
92 - Potê¿ny interfejs u¿ytkownika HTTP/CGI pozwala administratorom
93   przegl±daæ pliki logów, konfiguracjê i aktualny stan oraz
94   u¿ytkownikom rozpoczynaæ lub przerywaæ tworzenie kopii oraz szybko
95   przegl±daæ i odtwarzaæ pliki z kopii zapasowych.
96 - Nie jest wymagane oprogramowanie po stronie klienta. Na WinXX
97   u¿ywany jest protokó³ SMB lub rsync (specjalnie przygotowana wersja
98   pod cygwinem). Na klientach linuksowych lub uniksowych mo¿na u¿ywaæ
99   rsynca lub tara (po ssh/rsh/NFS).
100 - Dostêpne s± elastyczne opcje odzyskiwania. Mo¿na ¶ci±gaæ pojedyncze
101   pliki z kopii bezpo¶rednio z interfejsu CGI. Tak¿e archiwa zip lub
102   tar z wybranymi plikami lub katalogami mog± byæ ¶ci±gane z poziomu
103   interfejsu CGI.
104 - BackupPC obs³uguje ¶rodowiska przeno¶ne, gdzie laptopy s± pod³±czane
105   do sieci tylko z przerwami i maj± dynamiczne adresy IP (z DHCP).
106 - Elastyczna konfiguracja parametrów pozwala na wykonywanie wielu
107   kopii równolegle.
108 - Wiele wiêcej mo¿na odkryæ w manualu...
109
110 %prep
111 %setup -q -n BackupPC-%{version}
112 %patch0 -p1
113
114 %build
115 sed -i -e 's#!/bin/perl#!%{__perl}#' configure.pl
116 sed -i -e 's#!/bin/perl#!%{__perl}#' {bin,cgi-bin,doc}/*
117 sed -i -e 's#!/bin/perl#!%{__perl}#' */src/*
118 sed -i -e 's#!/bin/perl#!%{__perl}#' */*/*/*.pm
119
120
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,cgi-bin,html/doc} \
130                         $RPM_BUILD_ROOT%{_var}/{lib/%{name}/pc/localhost,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 hostname=/bin/hostname \
146         --bin-path split=%{_bindir}/split \
147         --bin-path cat=/bin/cat \
148         --bin-path gzip=/bin/gzip \
149         --bin-path bzip2=%{_bindir}/bzip2 \
150         --cgi-dir %{_datadir}/%{name}/www/cgi-bin \
151         --data-dir %{_var}/lib/%{name} \
152         --dest-dir $RPM_BUILD_ROOT \
153         --hostname localhost \
154         --html-dir %{_datadir}/%{name}/www/html \
155         --html-dir-url /BackupPC \
156         --install-dir %{_usr} \
157         --uid-ignore
158 #       --config-path
159
160 #change user in init script
161 sed -i -e 's#--user backuppc#--user %{BPCuser}#' init.d/linux-backuppc
162 #change user in config file
163 sed -i -e "s#'backuppc';#'%{BPCuser}';#" $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/config.pl
164 sed -i -e 's/$Conf{SendmailPath} =/#$Conf{SendmailPath} =/' $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/config.pl
165
166 install init.d/linux-backuppc $RPM_BUILD_ROOT/etc/rc.d/init.d/backuppc
167 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/93_backuppc.conf
168 #install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cgi-bin/.htaccess
169 install backuppc.8 $RPM_BUILD_ROOT%{_mandir}/man8
170 install %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/BackupPC/Lang/pl.pm
171 install doc/* $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/doc
172 # Cleanups:
173 rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/CVS
174 rm -rdf $RPM_BUILD_ROOT/usr/doc
175
176 # symlinks
177 mv $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf/* $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
178 rm -rdf $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf
179
180 cd $RPM_BUILD_ROOT%{_var}/lib/%{name}
181 ln -sf %{_sysconfdir}/%{name} $RPM_BUILD_ROOT%{_var}/lib/%{name}/conf
182
183 cd $RPM_BUILD_ROOT%{_var}/log
184 ln -sf %{_var}/lib/%{name}/log %{name}
185
186 cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cgi-bin
187 ln -sf BackupPC_Admin index.cgi
188
189 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html/BackupPC_stnd.css \
190         $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
191
192 cd $RPM_BUILD_ROOT%{_datadir}/%{name}/www/html
193 ln -sf %{_sysconfdir}/%{name}/BackupPC_stnd.css BackupPC_stnd.css
194
195
196 %pre
197 # Add the "backuppc" user and group
198 #if [ -n "`/usr/bin/getgid %{BPCgroup}`" ]; then
199 #       if [ "`/usr/bin/getgid %{BPCgroup}`" != "150" ]; then
200 #               echo "Error: group %{BPCgroup} doesn't have gid=150. Correct this before installing %{name}." 1>&2
201 #               exit 1
202 #       fi
203 #else
204 #       /usr/sbin/groupadd -g 150 %{BPCgroup}
205 #fi
206 #if [ -n "`/bin/id -u %{BPCuser} 2>/dev/null`" ]; then
207 #       if [ "`/bin/id -u %{BPCuser}`" != 150 ]; then
208 #               echo "Error: user %{BPCuser} doesn't have uid=150. Correct this before installing %{name}." 1>&2
209 #               exit 1
210 #       fi
211 #else
212 #       /usr/sbin/useradd -c "system user for %{name}" -u 150 \
213 #               -d /home/services/BackupPC -s /bin/false -g %{BPCgroup} %{BPCuser} 1>&2
214 #fi
215 %preun
216 if [ "$1" = "0" ]; then
217         if [ -f /var/lock/subsys/backuppc ]; then
218                 /etc/rc.d/init.d/backuppc stop
219         fi
220         /sbin/chkconfig --del backuppc
221 fi
222
223
224 %post
225 if ![ -f /etc/backuppc/password ]; then
226         openssl rand -base64 6 > $PASS
227         /usr/bin/htpasswd -cb /etc/backuppc/password admin $PASS
228         echo "Your web pasword is: $PASS ."
229         echo "Change this: htpasswd -b /etc/backuppc/password user password"
230 fi
231
232 if [ -f /var/lock/subsys/backuppc ]; then
233         /etc/rc.d/init.d/backuppc restart
234 else
235         echo "Run \"/etc/rc.d/init.d/backuppc start\" to start BackupPC." 
236 fi
237
238 %postun
239 if [ "$1" = "0" ]; then
240         %userremove %{BPCuser}
241         %groupremove %{BPCgroup}
242 fi
243
244 %clean
245 rm -rf $RPM_BUILD_ROOT
246
247 %files
248 %defattr(644,root,root,755)
249 %attr(755,root,root) %{_bindir}/*
250 %attr(755,root,root) %{_datadir}/%{name}/www/cgi-bin/BackupPC_Admin
251 #%config(noreplace) %verify(not md5 size mtime) %{_datadir}/%{name}/www/cgi-bin/.htaccess
252 %dir %{_datadir}/%{name}
253 %dir %{_datadir}/%{name}/www/html/doc
254 %{_datadir}/%{name}/www/html/doc/*
255 %dir %{_datadir}/%{name}/www
256 %dir %{_datadir}/%{name}/www/html
257 %dir %{_datadir}/%{name}/www/cgi-bin
258 %{_datadir}/%{name}/www/html/*.gif
259 %config(noreplace) %verify(not md5 size mtime) %{_datadir}/%{name}/www/html/BackupPC_stnd.css
260 %dir %{_libdir}/BackupPC
261 %{_libdir}/BackupPC/Attrib.pm
262 %{_libdir}/BackupPC/FileZIO.pm
263 %{_libdir}/BackupPC/Lib.pm
264 %{_libdir}/BackupPC/PoolWrite.pm
265 %{_libdir}/BackupPC/View.pm
266 %{_libdir}/BackupPC/CGI
267 %{_libdir}/BackupPC/Xfer
268 %{_libdir}/BackupPC/Zip
269 %dir %attr(755,%{BPCuser},%{BPCgroup}) %{_libdir}/BackupPC/Lang
270 %lang(en) %{_libdir}/BackupPC/Lang/en.pm
271 %lang(de) %{_libdir}/BackupPC/Lang/de.pm
272 %lang(fr) %{_libdir}/BackupPC/Lang/fr.pm
273 %lang(es) %{_libdir}/BackupPC/Lang/es.pm
274 %lang(it) %{_libdir}/BackupPC/Lang/it.pm
275 %lang(nl) %{_libdir}/BackupPC/Lang/nl.pm
276 %lang(pl) %{_libdir}/BackupPC/Lang/pl.pm
277 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}
278 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/cpool
279 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/log
280 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/pc
281 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/pool
282 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/trash
283 %dir %attr(755,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/conf
284 %dir %attr(750,%{BPCuser},%{BPCgroup}) %{_var}/log/%{name}
285 %attr(750,root,root) /etc/rc.d/init.d/backuppc
286 %{_sysconfdir}/httpd/httpd.conf/93_backuppc.conf
287 %dir %{_sysconfdir}/%{name}
288 %config(noreplace) %verify(not md5 size mtime) %attr(644,%{BPCuser},%{BPCgroup})  %{_sysconfdir}/%{name}/*
289 #%config(noreplace) %verify(not md5 size mtime) %attr(644,%{BPCuser},%{BPCgroup}) %{_var}/lib/%{name}/conf
290 %{_mandir}/man8/backuppc*
This page took 0.078584 seconds and 3 git commands to generate.