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