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