/[smecontribs]/rpms/BackupPC/contribs7/BackupPC.spec
ViewVC logotype

Annotation of /rpms/BackupPC/contribs7/BackupPC.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Mon Mar 2 17:29:33 2009 UTC (15 years, 8 months ago) by slords
Branch: MAIN
CVS Tags: BackupPC-3_1_0-3_el4_sme
Initial import of BackupPC

1 slords 1.1 %if %{?fedora}%{?rhel} >= 5
2     %define useselinux 1
3     %else
4     %define useselinux 0
5     %endif
6    
7     Name: BackupPC
8     Version: 3.1.0
9     Release: 3%{?dist}
10     Summary: BackupPC - high-performance backup system
11    
12     Group: Applications/System
13     License: GPLv2+
14     URL: http://backuppc.sourceforge.net/
15     Source0: http://dl.sourceforge.net/backuppc/%{name}-%{version}.tar.gz
16     Source1: BackupPC.htaccess
17     Source2: BackupPC.logrotate
18     Source3: BackupPC-README.fedora
19     BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20     BuildArch: noarch
21    
22     BuildRequires: /bin/cat
23     BuildRequires: /bin/df
24     BuildRequires: /bin/gtar
25     BuildRequires: %{_bindir}/nmblookup
26     BuildRequires: %{_bindir}/rsync
27     BuildRequires: %{_sbindir}/sendmail
28     BuildRequires: %{_bindir}/smbclient
29     BuildRequires: %{_bindir}/split
30     BuildRequires: %{_bindir}/ssh
31     BuildRequires: perl(Compress::Zlib)
32    
33     Requires: httpd
34     Requires: perl-suidperl
35     Requires: perl(File::RsyncP)
36     Requires: perl(Compress::Zlib)
37     Requires: perl(Archive::Zip)
38     Requires: perl-Time-modules
39     Requires: perl(XML::RSS)
40     Requires: rsync
41     Requires: samba-client
42     Requires(pre): %{_sbindir}/useradd
43     Requires(preun): initscripts, chkconfig
44     Requires(post): initscripts, chkconfig, %{_sbindir}/usermod
45     Requires(postun): initscripts
46     %if %{useselinux}
47     Requires: policycoreutils
48     BuildRequires: selinux-policy-devel, checkpolicy
49     %endif
50     Provides: backuppc = %{version}
51    
52     %description
53     BackupPC is a high-performance, enterprise-grade system for backing up Linux
54     and WinXX PCs and laptops to a server's disk. BackupPC is highly configurable
55     and easy to install and maintain.
56    
57     %prep
58     %setup -q
59     sed -i "s|\"backuppc\"|\"$LOGNAME\"|g" configure.pl
60     iconv -f ISO-8859-1 -t UTF-8 ChangeLog > ChangeLog.utf && mv ChangeLog.utf ChangeLog
61     pushd doc
62     iconv -f ISO-8859-1 -t UTF-8 BackupPC.pod > BackupPC.pod.utf && mv BackupPC.pod.utf BackupPC.pod
63     iconv -f ISO-8859-1 -t UTF-8 BackupPC.html > BackupPC.html.utf && mv BackupPC.html.utf BackupPC.html
64     popd
65     cp %{SOURCE3} README.fedora
66    
67     %if %{useselinux}
68     %{__mkdir} selinux
69     pushd selinux
70    
71     cat >%{name}.te <<EOF
72     policy_module(%{name},0.0.3)
73     require {
74     type var_log_t;
75     type httpd_t;
76     class sock_file write;
77     type initrc_t;
78     class unix_stream_socket connectto;
79     type ssh_exec_t;
80     type ping_exec_t;
81     type sendmail_exec_t;
82     class file getattr;
83     type httpd_sys_content_t;
84     class sock_file getattr;
85     }
86    
87     allow httpd_t httpd_sys_content_t:sock_file write;
88     allow httpd_t initrc_t:unix_stream_socket connectto;
89     allow httpd_t ping_exec_t:file getattr;
90     allow httpd_t sendmail_exec_t:file getattr;
91     allow httpd_t ssh_exec_t:file getattr;
92     allow httpd_t httpd_sys_content_t:sock_file getattr;
93     EOF
94    
95     cat >%{name}.fc <<EOF
96     %{_sysconfdir}/%{name} system_u:object_r:httpd_sys_content_t:s0
97     %{_sysconfdir}/%{name}/pc system_u:object_r:httpd_sys_script_rw_t:s0
98     %{_sysconfdir}/%{name}/config.pl system_u:object_r:httpd_sys_content_t:s0
99     %{_sysconfdir}/%{name}/hosts system_u:object_r:httpd_sys_content_t:s0
100     %{_localstatedir}/log/%{name} system_u:object_r:httpd_sys_content_t:s0
101     EOF
102     %endif
103    
104     %build
105     %if %{useselinux}
106     # SElinux
107     pushd selinux
108     make -f %{_datadir}/selinux/devel/Makefile
109     popd
110     %endif
111    
112    
113    
114     %install
115     rm -rf $RPM_BUILD_ROOT
116     perl configure.pl \
117     --batch \
118     --dest-dir $RPM_BUILD_ROOT \
119     --config-dir %{_sysconfdir}/%{name}/ \
120     --cgi-dir %{_datadir}/%{name}/sbin/ \
121     --data-dir %{_localstatedir}/lib/%{name}/ \
122     --html-dir %{_datadir}/%{name}/html/ \
123     --html-dir-url /%{name}/images \
124     --log-dir %{_localstatedir}/log/%{name} \
125     --install-dir %{_datadir}/%{name} \
126     --hostname localhost \
127     --uid-ignore
128    
129     for f in `find $RPM_BUILD_ROOT`
130     do
131     if [ -f $f ]
132     then
133     sed -i s,$LOGNAME,backuppc,g $f
134     fi
135     done
136     sed -i s,$LOGNAME,backuppc,g init.d/linux-backuppc
137    
138     %{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir}
139     %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
140     %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
141     %{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
142     %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pc
143    
144     %{__cp} init.d/linux-backuppc $RPM_BUILD_ROOT%{_initrddir}/backuppc
145     %{__cp} %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
146     %{__cp} %{SOURCE2} %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
147    
148     %{__chmod} 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/bin/*
149     %{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/backuppc
150    
151     sed -i 's/^\$Conf{XferMethod}\ =.*/$Conf{XferMethod} = "rsync";/' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.pl
152     sed -i 's|^\$Conf{CgiURL}\ =.*|$Conf{CgiURL} = "http://localhost/BackupPC";|' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.pl
153    
154     %if %{useselinux}
155     # SElinux
156     %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}
157     %{__install} -m644 selinux/%{name}.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/%{name}.pp
158     %endif
159    
160    
161     %clean
162     rm -rf $RPM_BUILD_ROOT
163    
164    
165     %pre
166     %{_sbindir}/useradd -d %{_localstatedir}/lib/%{name} -r -s /sbin/nologin backuppc 2> /dev/null || :
167    
168    
169     %preun
170     if [ $1 = 0 ]; then
171     service backuppc stop > /dev/null 2>&1 || :
172     chkconfig --del backuppc || :
173     fi
174    
175     %post
176     %if %{useselinux}
177     # Install/update Selinux policy
178     semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp
179     # files owned by RPM
180     fixfiles -R %{name} restore
181     # files created by app
182     restorecon -R %{_sysconfdir}/%{name}
183     restorecon -R %{_localstatedir}/lib/%{name}
184     restorecon -R %{_localstatedir}/log/%{name}
185     %endif
186     chkconfig --add backuppc || :
187     service httpd condrestart > /dev/null 2>&1 || :
188     #%{_sbindir}/usermod -a -G backuppc apache || :
189    
190    
191     %postun
192     service httpd condrestart > /dev/null 2>&1 || :
193     %if %{useselinux}
194     if [ "$1" -eq "0" ]; then
195     # Remove the SElinux policy.
196     semodule -r %{name} || :
197     fi
198     %endif
199    
200    
201     %files
202     %defattr(-,root,root,-)
203     %doc README README.fedora ChangeLog LICENSE doc/
204    
205     %dir %attr(-,backuppc,backuppc) %{_localstatedir}/log/%{name}
206     %dir %attr(-,backuppc,backuppc) %{_sysconfdir}/%{name}/
207    
208     %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
209     %config(noreplace) %attr(-,backuppc,backuppc) %{_sysconfdir}/%{name}/*
210     %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
211    
212     %dir %{_datadir}/%{name}
213     %dir %{_datadir}/%{name}/sbin
214     %{_datadir}/%{name}/[^s]*
215     %{_initrddir}/backuppc
216    
217     %attr(4750,backuppc,root) %{_datadir}/%{name}/sbin/BackupPC_Admin
218     %attr(-,backuppc,root) %{_localstatedir}/lib/%{name}/
219    
220     %if %{useselinux}
221     %{_datadir}/selinux/packages/%{name}/%{name}.pp
222     %endif
223    
224     %changelog
225     * Tue Dec 09 2008 Daniel B <daniel@firewall-services.com> 3.1.0-3
226     - Small changes for SME Server (apache -> www)
227    
228     * Sat Apr 05 2008 Johan Cwiklinski <johan AT x-tnd DOT be> 3.1.0-2
229     - correcting nologin path
230    
231     * Thu Nov 29 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.1.0-1
232     - New upstream version
233     - Added samba-client as a dependency
234     - Added readme.fedora
235     - Changed CGI admin path in default config file
236    
237     * Fri Sep 21 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.0.0-3
238     - Fixed SELinux policy module
239    
240     * Wed Sep 12 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.0.0-2
241     - Added SELinux policy module
242    
243     * Tue Jan 30 2007 Johan Cwiklinski <johan AT x-tnd DOT be> 3.0.0-1
244     - Rebuild RPM for v 3.0.0
245    
246     * Sat Aug 16 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-7
247     - Release bump for rebuild
248    
249     * Tue Jul 25 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-6
250     - One more config change
251    
252     * Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-5
253     - Added upstream patch for better support for rsync
254    
255     * Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-4
256     - Properly marking config files as such
257    
258     * Sun Jul 23 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-3
259     - Changes to defaults in config.pl
260     - Added Requires: rsync
261    
262     * Fri Jul 21 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-2
263     - Added requires: perl(File::RsyncP)
264    
265     * Tue Jul 18 2006 Mike McGrath <imlinux@gmail.com> 2.1.2-1
266     - Initial Fedora Packaging

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed