65 Source1: rc.bacula |
56 Source1: rc.bacula |
66 Source2: bexec.sh |
57 Source2: bexec.sh |
67 Patch0: bacula.patch |
58 Patch0: bacula.patch |
68 |
59 |
69 # build information |
60 # build information |
70 Prefix: %{l_prefix} |
61 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes |
71 BuildRoot: %{l_buildroot} |
62 PreReq: OpenPKG, openpkg >= 20100101 |
72 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes |
63 BuildPreReq: readline, zlib |
73 PreReq: OpenPKG, openpkg >= 20060823 |
64 PreReq: readline, zlib |
74 BuildPreReq: ncurses, readline, zlib |
|
75 PreReq: ncurses, readline, zlib |
|
76 %if "%{with_ssl}" == "yes" |
65 %if "%{with_ssl}" == "yes" |
77 BuildPreReq: openssl >= 0.9.8, openssl::with_threads = yes |
66 BuildPreReq: openssl >= 0.9.8 |
78 PreReq: openssl >= 0.9.8, openssl::with_threads = yes |
67 PreReq: openssl >= 0.9.8 |
79 %endif |
68 %endif |
80 %if "%{with_wrap}" == "yes" |
69 %if "%{with_wrap}" == "yes" |
81 BuildPreReq: tcpwrappers |
70 BuildPreReq: tcpwrappers |
82 PreReq: tcpwrappers |
71 PreReq: tcpwrappers |
83 %endif |
72 %endif |
136 # for the same reason remove version informations from config files |
123 # for the same reason remove version informations from config files |
137 %{l_shtool} subst \ |
124 %{l_shtool} subst \ |
138 -e "s;For Bacula release @VERSION@ .*;;" \ |
125 -e "s;For Bacula release @VERSION@ .*;;" \ |
139 `find . -name "*.conf.in"` |
126 `find . -name "*.conf.in"` |
140 |
127 |
141 # help specific platforms find fdatasync(3) |
|
142 libs="" |
|
143 case "%{l_platform -t}" in |
|
144 *-sunos* ) libs="-lrt" ;; |
|
145 esac |
|
146 |
|
147 # use localhost as default host |
128 # use localhost as default host |
148 %{l_shtool} subst \ |
129 %{l_shtool} subst \ |
149 -e 's;hostname=.*;hostname=localhost;g' \ |
130 -e 's;hostname=.*;hostname=localhost;g' \ |
150 -e 's;\(CONS_LIBS="-lreadline.*\)-ltermcap;\1-lncurses;g' \ |
|
151 configure |
131 configure |
152 |
132 |
153 # configure |
133 # configure |
154 LIBS= |
134 LIBS= |
155 case "%{l_platform -t}" in |
135 case "%{l_platform -t}" in |
156 *-linux*) ldfl="-L/usr/lib/termcap" ;; |
136 *-linux*) LIBS="-L/usr/lib/termcap";; |
157 *-sunos*) ldfl="-ldl" ;; |
|
158 esac |
137 esac |
159 CC="%{l_cc}" \ |
138 CC="%{l_cc}" \ |
160 CFLAGS="%{l_cflags -O}" \ |
139 CFLAGS="%{l_cflags -O}" \ |
161 CPPFLAGS="%{l_cppflags ncurses}" \ |
140 CPPFLAGS="%{l_cppflags}" \ |
162 LDFLAGS="%{l_ldflags} $ldfl" \ |
141 LDFLAGS="%{l_ldflags} $LIBS" \ |
163 LIBS="$libs -lz" \ |
|
164 GREP="grep" \ |
|
165 ./configure \ |
142 ./configure \ |
166 --prefix=%{l_prefix} \ |
143 --prefix=%{l_prefix} \ |
167 --with-dir-user=%{l_rusr} \ |
144 --with-dir-user=%{l_rusr} \ |
168 --with-dir-group=%{l_rgrp} \ |
145 --with-dir-group=%{l_rgrp} \ |
169 --with-sd-user=%{l_rusr} \ |
146 --with-sd-user=%{l_rusr} \ |
200 %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" |
177 %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" |
201 --with-python=%{l_prefix} \ |
178 --with-python=%{l_prefix} \ |
202 %endif |
179 %endif |
203 --enable-wx-console=no \ |
180 --enable-wx-console=no \ |
204 --sysconfdir=%{l_prefix}/etc/bacula \ |
181 --sysconfdir=%{l_prefix}/etc/bacula \ |
205 --libexecdir=%{l_prefix}/libexec/bacula \ |
|
206 --mandir=%{l_prefix}/man \ |
182 --mandir=%{l_prefix}/man \ |
207 --with-scriptdir=%{l_prefix}/libexec/bacula \ |
183 --with-scriptdir=%{l_prefix}/libexec/bacula \ |
208 --with-working-dir=%{l_prefix}/var/bacula \ |
184 --with-working-dir=%{l_prefix}/var/bacula \ |
209 --with-pid-dir=%{l_prefix}/var/bacula/run \ |
185 --with-pid-dir=%{l_prefix}/var/bacula/run \ |
210 --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys \ |
186 --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys \ |
211 --with-archivedir=/tmp \ |
|
212 --with-sbin-perm=0755 \ |
|
213 --disable-shared \ |
|
214 --disable-libtool \ |
|
215 --disable-nls |
187 --disable-nls |
216 |
188 |
217 # build |
189 # build |
218 %{l_make} %{l_mflags -O} |
190 %{l_make} %{l_mflags -O} |
219 |
191 |
220 %install |
192 %install |
221 # clean up build cruft |
|
222 rm -rf $RPM_BUILD_ROOT |
|
223 |
193 |
224 # create installation hierarchy |
194 # create installation hierarchy |
225 %{l_shtool} mkdir -f -p -m 755 \ |
195 %{l_shtool} mkdir -f -p -m 755 \ |
226 $RPM_BUILD_ROOT%{l_prefix}/bin \ |
196 $RPM_BUILD_ROOT%{l_prefix}/bin \ |
227 $RPM_BUILD_ROOT%{l_prefix}/sbin \ |
197 $RPM_BUILD_ROOT%{l_prefix}/sbin \ |
232 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
202 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
233 $RPM_BUILD_ROOT%{l_prefix}/var/bacula \ |
203 $RPM_BUILD_ROOT%{l_prefix}/var/bacula \ |
234 $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run \ |
204 $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run \ |
235 $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run/subsys \ |
205 $RPM_BUILD_ROOT%{l_prefix}/var/bacula/run/subsys \ |
236 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
206 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \ |
237 $RPM_BUILD_ROOT%{l_prefix}/man/man8 |
207 $RPM_BUILD_ROOT%{l_prefix}/man/man8 \ |
|
208 $RPM_BUILD_ROOT%{l_prefix}/share/bacula/examples \ |
|
209 $RPM_BUILD_ROOT%{l_prefix}/share/bacula/examples/default-config |
238 |
210 |
239 # install |
211 # install |
240 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
212 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
241 |
213 |
242 # strip down installation |
214 # strip down installation |
243 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true |
215 # do not strip binaries, to make it easier to diagnose problems |
|
216 # strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true |
244 ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula && |
217 ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula && |
245 for unwanted in startmysql stopmysql; do |
218 for unwanted in bconsole startmysql stopmysql; do |
246 rm -f $unwanted |
219 rm -f $unwanted |
247 done |
220 done |
248 ) || exit $? |
221 ) || exit $? |
249 |
222 |
250 # install additional files |
223 # install additional files |
251 %{l_shtool} install -c -m 754 %{l_value -s -a} \ |
224 %{l_shtool} install -c -m 754 %{l_value -s -a} \ |
252 %{SOURCE bexec.sh} $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec |
225 %{SOURCE bexec.sh} $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec |
253 %{l_shtool} install -c -m 640 \ |
226 |
254 src/console/bconsole.conf $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/ |
227 # wrap binaries to avoid to specify "-c" for each run |
255 |
228 ( cd $RPM_BUILD_ROOT%{l_prefix}/sbin |
256 ## wrap binaries to avoid to specify "-c" for each run |
229 for bin in bacula-dir bacula-fd bacula-sd \ |
257 #( cd $RPM_BUILD_ROOT%{l_prefix}/sbin |
230 bconsole bcopy bextract bls bscan dbcheck \ |
258 # for bin in bacula-dir bacula-fd bacula-sd \ |
231 tray-monitor wx-console; do |
259 # bconsole bcopy bextract bls bscan dbcheck \ |
232 if [ -x $bin ]; then |
260 # tray-monitor wx-console; do |
233 mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula |
261 # if [ -x $bin ]; then |
234 ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin |
262 # mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula |
235 fi |
263 # ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin |
236 done |
264 # fi |
237 ) || exit $? |
265 # done |
238 |
266 #) || exit $? |
239 # install run-command script |
267 |
|
268 # install runcommand script |
|
269 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
240 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
270 -e 's,@with_server@,%{with_server},g' \ |
241 -e 's,@with_server@,%{with_server},g' \ |
271 %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
242 %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
272 |
243 |
273 # determine installation files |
244 # determine installation files |
274 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
245 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
275 %{l_files_std} \ |
246 %{l_files_std} \ |
276 '%config(noreplace) %{l_prefix}/etc/bacula/*.conf' \ |
247 '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula' \ |
277 %if "%{with_server}" == "yes" |
248 '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run' \ |
278 '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ |
249 '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run/subsys' \ |
279 '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ |
|
280 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/delete_catalog_backup' \ |
|
281 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/make_catalog_backup' \ |
|
282 %endif |
|
283 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/dvd-handler' \ |
250 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/dvd-handler' \ |
284 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/mtx-changer' \ |
251 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/mtx-changer' \ |
285 '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run/subsys' \ |
252 %if "%{with_server}" == "yes" |
286 '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula/run' \ |
253 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/make_catalog_backup' \ |
287 '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bacula' |
254 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/delete_catalog_backup'\ |
|
255 '%config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ |
|
256 '%config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ |
|
257 %endif |
|
258 '%config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \ |
|
259 %if "%{with_server}" == "yes" |
|
260 '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-dir.conf' \ |
|
261 '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-sd.conf' \ |
|
262 %endif |
|
263 '%attr(640,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/bacula/bacula-fd.conf' |
288 |
264 |
289 %files -f files |
265 %files -f files |
290 |
266 |
291 %clean |
267 %clean |
292 rm -rf $RPM_BUILD_ROOT |
|
293 |
268 |
294 %post |
269 %post |
295 # create initial database |
270 # create initial database |
296 if [ ! -f $RPM_INSTALL_PREFIX/var/bacula/bacula.db ]; then |
271 if [ ! -f $RPM_INSTALL_PREFIX/var/bacula/bacula.db ]; then |
297 $RPM_INSTALL_PREFIX/libexec/bacula/make_bacula_tables |
272 $RPM_INSTALL_PREFIX/libexec/bacula/make_bacula_tables |