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