2 # Copyright (C) 2000-2006 Kern Sibbald
4 # Platform Build Configuration
6 # basic defines for every build
7 %define depkgs ../depkgs
8 %define depkgs_version 28Mar06
9 %define sqlite_bindir /usr/lib/bacula/sqlite
10 %define working_dir /var/bacula
11 %define director_daemon_user bacula
12 %define storage_daemon_user bacula
13 %define file_daemon_user root
14 %define daemon_group bacula
15 # group that has write access to tape devices, usually disk on Linux
16 %define storage_daemon_group disk
17 %define user_file /etc/passwd
18 %define group_file /etc/group
19 %define useradd /usr/sbin/useradd
20 %define groupadd /usr/sbin/groupadd
21 %define usermod /usr/sbin/usermod
22 %define _rescuever 1.8.3
24 # platform defines - set one below or define the build_xxx on the command line
27 %{?build_rh7:%define rh7 1}
29 %{?build_rh8:%define rh8 1}
31 %{?build_rh9:%define rh9 1}
34 %{?build_fc1:%define fc1 1}
36 %{?build_fc3:%define fc3 1}
38 %{?build_fc4:%define fc4 1}
39 # Whitebox Enterprise build
41 %{?build_wb3:%define wb3 1}
42 # RedHat Enterprise builds
44 %{?build_rhel3:%define rhel3 1}
45 %{?build_rhel3:%define wb3 1}
47 %{?build_rhel4:%define rhel4 1}
48 %{?build_rhel4:%define fc3 1}
51 %{?build_centos3:%define centos3 1}
52 %{?build_centos3:%define wb3 1}
54 %{?build_centos4:%define centos4 1}
55 %{?build_centos4:%define fc3 1}
58 %{?build_su9:%define su9 1}
60 %{?build_su10:%define su10 1}
63 %{?build_mdk:%define mdk 1}
65 %{?build_mdv:%define mdv 1}
66 %{?build_mdv:%define mdk 1}
68 # test for a platform definition
69 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
70 %{error: You must specify a platform. Please examine the spec file.}
75 # set for database support desired or define the build_xxx on the command line
77 %{?build_mysql:%define mysql 1}
78 # if using mysql 4.x define this and mysql above
79 # currently: Mandrake 10.1, SuSE 9.2, RHEL4 and Fedora Core 4
81 %{?build_mysql4:%define mysql4 1}
82 %{?build_mysql4:%define mysql 1}
84 %{?build_sqlite:%define sqlite 1}
86 %{?build_postgresql:%define postgresql 1}
88 # test for a database definition
89 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
90 %{error: You must specify database support. Please examine the spec file.}
95 %define db_backend mysql
98 %define db_backend sqlite
101 %define db_backend postgresql
106 %{?build_x86_64:%define x86_64 1}
108 # check what distribution we are
109 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
110 %define _dist %(grep Red /etc/redhat-release)
113 %define _dist %(grep Fedora /etc/redhat-release)
115 %if %{centos4} || %{centos3}
116 %define _dist %(grep CentOS /etc/redhat-release)
118 %if %{fc3} && ! %{rhel4} && ! %{centos4}
119 %define _dist %(grep Fedora /etc/redhat-release)
121 %if %{wb3} && ! %{rhel3} && ! %{centos3}
122 %define _dist %(grep White /etc/whitebox-release)
124 %if %{su9} || %{su10}
125 %define _dist %(grep -i SuSE /etc/SuSE-release)
128 %define _dist %(grep Mand /etc/mandrake-release)
131 # Should we build gconsole, possible only if gnome >= 2.0 available
137 # specifically disallow gconsole if desired
138 %{?nobuild_gconsole:%define gconsole 0}
140 # Should we build wxconsole, only wxWidgets >=2.6 is supported
141 # currently only SuSE 10 and FC4
143 %{?build_wxconsole:%define wxconsole 1}
145 Summary: Bacula - The Network Backup Solution
149 Group: System Environment/Daemons
151 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
152 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
153 Source2: Release_Notes-%{version}-%{release}.tar.gz
154 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
155 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
156 BuildRoot: %{_tmppath}/%{name}-root
157 URL: http://www.bacula.org/
158 Vendor: The Bacula Team
159 Distribution: %{_dist}
160 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
162 %define _docsrc ../%{name}-docs-%{version}
163 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
165 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
166 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
167 BuildRequires: openssl-devel
169 BuildRequires: pkgconfig
172 BuildRequires: libtermcap-devel
173 BuildRequires: glibc-devel >= 2.2
176 BuildRequires: termcap
177 BuildRequires: glibc-devel >= 2.3
179 %if %{su9} && %{gconsole}
180 BuildRequires: libgnome >= 2.0
181 BuildRequires: gtk2-devel >= 2.0
182 BuildRequires: libgnomeui-devel >= 2.0
183 BuildRequires: ORBit2-devel
184 BuildRequires: libart_lgpl-devel >= 2.0
185 BuildRequires: libbonobo-devel >= 2.0
186 BuildRequires: libbonoboui-devel >= 2.0
187 BuildRequires: bonobo-activation-devel
188 BuildRequires: gconf2-devel
189 BuildRequires: linc-devel
190 BuildRequires: freetype2-devel
193 BuildRequires: termcap
194 BuildRequires: glibc-devel >= 2.3
196 %if %{su10} && %{gconsole}
197 BuildRequires: libgnome >= 2.12
198 BuildRequires: gtk2-devel >= 2.8
199 BuildRequires: libgnomeui-devel >= 2.12
200 BuildRequires: ORBit2-devel
201 BuildRequires: libart_lgpl-devel >= 2.3
202 BuildRequires: libbonobo-devel >= 2.10
203 BuildRequires: libbonoboui-devel >= 2.10
204 BuildRequires: bonobo-activation-devel
205 BuildRequires: gconf2-devel
206 BuildRequires: freetype2-devel
207 BuildRequires: cairo-devel
208 BuildRequires: fontconfig-devel >= 2.3
209 BuildRequires: gnome-vfs2-devel >= 2.12
210 BuildRequires: libpng-devel
213 BuildRequires: libtermcap-devel
214 BuildRequires: libstdc++-static-devel
215 BuildRequires: glibc-static-devel
216 BuildRequires: glibc-devel >= 2.3
218 %if %{mdk} && !%{mdv} && %{gconsole}
219 BuildRequires: gtk2-devel >= 2.0
220 BuildRequires: libgnomeui2-devel >= 2.0
221 BuildRequires: libORBit2-devel
222 BuildRequires: libart_lgpl-devel >= 2.0
223 BuildRequires: libbonobo2_0-devel
224 BuildRequires: libbonoboui2_0-devel
225 BuildRequires: libbonobo-activation-devel
226 BuildRequires: libGConf2-devel
227 BuildRequires: freetype2-devel
229 %if %{mdv} && %{gconsole}
230 BuildRequires: gtk2-devel >= 2.8
231 BuildRequires: libgnomeui2-devel >= 2.10
232 BuildRequires: libORBit2-devel
233 BuildRequires: libart_lgpl-devel >= 2.3
234 BuildRequires: libbonobo2_0-devel
235 BuildRequires: libbonoboui2_0-devel
236 BuildRequires: libbonobo-activation-devel
237 BuildRequires: libGConf2-devel
238 BuildRequires: freetype2-devel
241 BuildRequires: libtermcap-devel
242 BuildRequires: glibc-devel >= 2.3
244 %if %{fc3} && %{gconsole}
245 BuildRequires: gtk2-devel >= 2.4
246 BuildRequires: libgnomeui-devel >= 2.8
247 BuildRequires: ORBit2-devel
248 BuildRequires: libart_lgpl-devel >= 2.3
249 BuildRequires: libbonobo-devel >= 2.8
250 BuildRequires: libbonoboui-devel >= 2.8
251 BuildRequires: bonobo-activation-devel
252 BuildRequires: GConf2-devel
253 BuildRequires: freetype-devel
256 BuildRequires: libtermcap-devel
257 BuildRequires: glibc-devel >= 2.3
259 %if %{fc4} && %{gconsole}
260 BuildRequires: gtk2-devel >= 2.6
261 BuildRequires: libgnomeui-devel >= 2.10
262 BuildRequires: ORBit2-devel
263 BuildRequires: libart_lgpl-devel >= 2.3
264 BuildRequires: libbonobo-devel >= 2.8
265 BuildRequires: libbonoboui-devel >= 2.8
266 BuildRequires: bonobo-activation-devel
267 BuildRequires: GConf2-devel
268 BuildRequires: freetype-devel
270 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
271 BuildRequires: libtermcap-devel
272 BuildRequires: glibc-devel >= 2.3
274 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole}
275 BuildRequires: gtk2-devel >= 2.0
276 BuildRequires: libgnomeui-devel >= 2.0
277 BuildRequires: ORBit2-devel
278 BuildRequires: libart_lgpl-devel >= 2.0
279 BuildRequires: libbonobo-devel >= 2.0
280 BuildRequires: libbonoboui-devel >= 2.0
281 BuildRequires: bonobo-activation-devel
282 BuildRequires: GConf2-devel
283 BuildRequires: linc-devel
284 BuildRequires: freetype-devel
287 %if %{mysql} && ! %{mysql4}
288 BuildRequires: mysql-devel >= 3.23
291 %if %{mysql} && %{mysql4}
292 BuildRequires: mysql-devel >= 4.0
295 %if %{postgresql} && %{wb3}
296 BuildRequires: rh-postgresql-devel >= 7
299 %if %{postgresql} && ! %{wb3}
300 BuildRequires: postgresql-devel >= 7
304 BuildRequires: wxGTK-devel >= 2.6
308 Bacula - It comes by night and sucks the vital essence from your computers.
310 Bacula is a set of computer programs that permit you (or the system
311 administrator) to manage backup, recovery, and verification of computer
312 data across a network of computers of different kinds. In technical terms,
313 it is a network client/server based backup program. Bacula is relatively
314 easy to use and efficient, while offering many advanced storage management
315 features that make it easy to find and recover lost or damaged files.
316 Bacula source code has been released under the GPL version 2 license.
328 Summary: Bacula - The Network Backup Solution
329 Group: System Environment/Daemons
330 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
331 Conflicts: bacula-client
332 Obsoletes: bacula-rescue
333 Requires: ncurses, libstdc++, zlib, openssl, mtx
336 Requires: glibc >= 2.2
339 %if %{su9} || %{su10}
340 Requires: glibc >= 2.3
343 %if ! %{rh7} && ! %{su9} && ! %{su10}
344 Requires: glibc >= 2.3
348 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4}
349 Requires: mysql >= 3.23
350 Requires: mysql-server >= 3.23
352 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
353 Requires: mysql >= 4.0
354 Requires: mysql-server >= 4.0
357 %if %{mysql} && %{su9} && ! %{mysql4}
358 Requires: mysql >= 3.23
359 Requires: mysql-client >= 3.23
361 %if %{mysql} && %{su9} && %{mysql4}
362 Requires: mysql >= 4.0
363 Requires: mysql-client >= 4.0
365 %if %{mysql} && %{su10} && %{mysql4}
366 Requires: mysql >= 4.0
367 Requires: mysql-client >= 4.0
370 %if %{mysql} && %{mdk} && ! %{mysql4}
371 Requires: mysql >= 3.23
372 Requires: mysql-client >= 3.23
374 %if %{mysql} && %{mdk} && %{mysql4}
375 Requires: mysql >= 4.0
376 Requires: mysql-client >= 4.0
379 %if %{postgresql} && %{wb3}
380 Requires: rh-postgresql >= 7
381 Requires: rh-postgresql-server >= 7
383 %if %{postgresql} && ! %{wb3}
384 Requires: postgresql >= 7
385 Requires: postgresql-server >= 7
395 %description postgresql
398 Bacula - It comes by night and sucks the vital essence from your computers.
400 Bacula is a set of computer programs that permit you (or the system
401 administrator) to manage backup, recovery, and verification of computer
402 data across a network of computers of different kinds. In technical terms,
403 it is a network client/server based backup program. Bacula is relatively
404 easy to use and efficient, while offering many advanced storage management
405 features that make it easy to find and recover lost or damaged files.
406 Bacula source code has been released under the GPL version 2 license.
409 This build requires MySQL to be installed separately as the catalog database.
412 This build requires PostgreSQL to be installed separately as the catalog database.
415 This build incorporates sqlite as the catalog database, statically compiled.
419 Summary: Bacula - The Network Backup Solution
420 Group: System Environment/Daemons
424 This is Bacula's version of mtx tape utilities for Linux distributions that
425 do not provide their own mtx package
428 Summary: Bacula - The Network Backup Solution
429 Group: System Environment/Daemons
431 Conflicts: bacula-mysql
432 Conflicts: bacula-sqlite
433 Conflicts: bacula-postgresql
434 Obsoletes: bacula-rescue
435 Requires: libstdc++, zlib, openssl
438 Requires: glibc >= 2.2
441 %if %{su9} || %{su10}
442 Requires: glibc >= 2.3
445 %if ! %{rh7} && ! %{su9} && ! %{su10}
446 Requires: glibc >= 2.3
451 Bacula - It comes by night and sucks the vital essence from your computers.
453 Bacula is a set of computer programs that permit you (or the system
454 administrator) to manage backup, recovery, and verification of computer
455 data across a network of computers of different kinds. In technical terms,
456 it is a network client/server based backup program. Bacula is relatively
457 easy to use and efficient, while offering many advanced storage management
458 features that make it easy to find and recover lost or damaged files.
459 Bacula source code has been released under the GPL version 2 license.
461 This is the File daemon (Client) only package. It includes the command line
466 Summary: Bacula - The Network Backup Solution
467 Group: System Environment/Daemons
469 %description updatedb
470 Bacula - It comes by night and sucks the vital essence from your computers.
472 Bacula is a set of computer programs that permit you (or the system
473 administrator) to manage backup, recovery, and verification of computer
474 data across a network of computers of different kinds. In technical terms,
475 it is a network client/server based backup program. Bacula is relatively
476 easy to use and efficient, while offering many advanced storage management
477 features that make it easy to find and recover lost or damaged files.
478 Bacula source code has been released under the GPL version 2 license.
480 This package installs scripts for updating older versions of the bacula
485 Summary: Bacula - The Network Backup Solution
486 Group: System Environment/Daemons
487 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
490 %if %{gconsole} && %{su9}
491 Requires: gtk2 >= 2.0
492 Requires: libgnome >= 2.0
493 Requires: libgnomeui >= 2.0
494 Requires: glibc >= 2.3
496 Requires: libart_lgpl >= 2.0
497 Requires: libbonobo >= 2.0
498 Requires: libbonoboui >= 2.0
499 Requires: bonobo-activation
504 %if %{gconsole} && %{su10}
505 Requires: gtk2 >= 2.8
506 Requires: libgnome >= 2.12
507 Requires: libgnomeui >= 2.12
508 Requires: glibc >= 2.3
510 Requires: libart_lgpl >= 2.3
511 Requires: libbonobo >= 2.10
512 Requires: libbonoboui >= 2.10
513 Requires: bonobo-activation
517 Requires: fontconfig >= 2.3
518 Requires: gnome-vfs2 >= 2.12
521 %if %{gconsole} && %{mdk} && !%{mdv}
522 Requires: gtk2 >= 2.0
523 Requires: libgnomeui2
524 Requires: glibc >= 2.3
526 Requires: libart_lgpl >= 2.0
527 Requires: libbonobo >= 2.0
528 Requires: libbonoboui >= 2.0
532 %if %{gconsole} && %{mdv}
533 Requires: gtk2 >= 2.8
534 Requires: libgnomeui2
535 Requires: glibc >= 2.3
537 Requires: libart_lgpl >= 2.3
538 Requires: libbonobo >= 2.10
539 Requires: libbonoboui >= 2.10
543 %if %{gconsole} && %{fc3}
544 Requires: gtk2 >= 2.4
545 Requires: libgnomeui >= 2.8
546 Requires: glibc >= 2.3
548 Requires: libart_lgpl >= 2.3
549 Requires: libbonobo >= 2.8
550 Requires: libbonoboui >= 2.8
551 Requires: bonobo-activation
555 %if %{gconsole} && %{fc4}
556 Requires: gtk2 >= 2.6
557 Requires: libgnomeui >= 2.10
558 Requires: glibc >= 2.3
560 Requires: libart_lgpl >= 2.3
561 Requires: libbonobo >= 2.8
562 Requires: libbonoboui >= 2.8
563 Requires: bonobo-activation
567 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4}
568 Requires: gtk2 >= 2.0
569 Requires: libgnomeui >= 2.0
570 Requires: glibc >= 2.3
572 Requires: libart_lgpl >= 2.0
573 Requires: libbonobo >= 2.0
574 Requires: libbonoboui >= 2.0
575 Requires: bonobo-activation
580 %if %{gconsole} && %{su9}
583 %if %{gconsole} && %{su10}
586 %if %{gconsole} && ! %{su9} && ! %{su10}
591 %description gconsole
592 Bacula - It comes by night and sucks the vital essence from your computers.
594 Bacula is a set of computer programs that permit you (or the system
595 administrator) to manage backup, recovery, and verification of computer
596 data across a network of computers of different kinds. In technical terms,
597 it is a network client/server based backup program. Bacula is relatively
598 easy to use and efficient, while offering many advanced storage management
599 features that make it easy to find and recover lost or damaged files.
600 Bacula source code has been released under the GPL version 2 license.
602 This is the Gnome Console package. It is an add-on to the client or
608 Summary: Bacula - The Network Backup Solution
609 Group: System Environment/Daemons
610 Requires: wxGTK >= 2.6, libstdc++, openssl
613 %if %{wxconsole} && %{su10}
614 Requires: gtk2 >= 2.8
617 %if %{wxconsole} && %{fc4}
618 Requires: gtk2 >= 2.6
622 %description wxconsole
623 Bacula - It comes by night and sucks the vital essence from your computers.
625 Bacula is a set of computer programs that permit you (or the system
626 administrator) to manage backup, recovery, and verification of computer
627 data across a network of computers of different kinds. In technical terms,
628 it is a network client/server based backup program. Bacula is relatively
629 easy to use and efficient, while offering many advanced storage management
630 features that make it easy to find and recover lost or damaged files.
631 Bacula source code has been released under the GPL version 2 license.
633 This is the WXWindows Console package. It is an add-on to the client or
647 %if %{su9} || %{su10}
648 export LDFLAGS="-L/usr/lib/termcap"
659 # patches for the bundled sqlite scripts
660 # as of 1.38.0 first 3 patches no longer needed
662 # patch the make_sqlite_tables script for installation bindir
663 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
665 # patch the create_sqlite_database script for installation bindir
666 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
668 # patch the make_catalog_backup script for installation bindir
669 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
671 # patch the update_sqlite_tables script for installation bindir
672 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
674 # patch the bacula-dir init script to remove sqlite service
675 %if %{sqlite} && %{su9}
676 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
678 %if %{sqlite} && %{su10}
679 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
682 # 64 bit lib location hacks
683 # this is the location on redhat type platforms, don't know about others yet
685 export LDFLAGS=-L/usr/lib64
687 %if %{mysql} && %{x86_64}
688 export LDFLAGS=-L/usr/lib64/mysql
693 --sbindir=/usr/sbin \
694 --sysconfdir=/etc/bacula \
695 --with-scriptdir=/etc/bacula \
696 --enable-smartalloc \
697 --enable-client-only \
707 --sbindir=/usr/sbin \
708 --sysconfdir=/etc/bacula \
709 --with-scriptdir=/etc/bacula \
710 --enable-smartalloc \
714 %if %{gconsole} && ! %{rh8}
715 --enable-tray-monitor \
721 --with-sqlite=${cwd}/%{depkgs}/sqlite \
727 --enable-wx-console \
729 --with-working-dir=%{working_dir} \
730 --with-pid-dir=/var/run \
731 --with-subsys-dir=/var/lock/subsys \
732 --with-dir-user=%{director_daemon_user} \
733 --with-dir-group=%{daemon_group} \
734 --with-sd-user=%{storage_daemon_user} \
735 --with-sd-group=%{storage_daemon_group} \
736 --with-fd-user=%{file_daemon_user} \
737 --with-fd-group=%{daemon_group} \
738 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
739 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
740 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
741 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
742 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
743 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
751 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
752 mkdir -p $RPM_BUILD_ROOT/etc/init.d
753 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
754 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
755 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
756 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
757 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
759 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
761 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
762 %if %{gconsole} && ! %{su9} && ! %{su10}
763 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
764 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
765 mkdir -p $RPM_BUILD_ROOT/usr/bin
769 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
773 prefix=$RPM_BUILD_ROOT/usr \
774 sbindir=$RPM_BUILD_ROOT/usr/sbin \
775 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
776 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
777 working_dir=$RPM_BUILD_ROOT%{working_dir} \
782 prefix=$RPM_BUILD_ROOT/usr \
783 sbindir=$RPM_BUILD_ROOT/usr/sbin \
784 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
785 working_dir=$RPM_BUILD_ROOT%{working_dir} \
786 mandir=$RPM_BUILD_ROOT/usr/man \
790 # fixme - make installs the mysql scripts for sqlite build
792 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
793 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
794 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
797 # fixme - make installs the mysql scripts for postgresql build
799 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
800 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
803 # fixme - make installs gconsole script for build without gconsole
805 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
808 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
810 # install the init scripts
811 %if %{su9} || %{su10}
812 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
813 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
814 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
817 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
818 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
819 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
821 %if ! %{su9} && ! %{su10} && ! %{mdk}
822 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
823 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
824 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
826 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
828 # install the menu stuff
829 %if %{gconsole} && %{su9}
830 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
831 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
832 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
833 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
835 %if %{gconsole} && %{su10}
836 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
837 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
838 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
839 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
841 %if %{wxconsole} && %{su10}
842 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
843 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
845 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
850 %if %{gconsole} && %{iftrick}
851 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
852 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
853 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
854 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
855 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
857 %if %{gconsole} && ! %{rh8}
858 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
859 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
861 %if %{wxconsole} && %{iftrick}
862 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
863 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
864 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
865 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
866 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
871 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
872 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
873 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
876 # install the logrotate file
877 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
879 # install the updatedb scripts
880 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
882 # install the logwatch scripts
883 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
884 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
885 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
886 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
887 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
888 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
890 # install the rescue files
891 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
892 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
893 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
894 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
895 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
896 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
897 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
898 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
899 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
900 rm -f src/filed/static-bacula-fd
903 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
904 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
907 # now clean up permissions that are left broken by the install
908 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
909 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
910 %if %{gconsole} && ! %{rh8}
911 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
912 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
916 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
919 # MySQL specific files
921 %defattr(-, root, root)
922 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
923 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
924 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
925 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
926 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
927 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
928 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
929 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
934 %defattr(-,root,root)
935 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
936 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
937 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
938 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
939 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
940 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
941 %{sqlite_bindir}/libsqlite.a
942 %{sqlite_bindir}/sqlite.h
943 %{sqlite_bindir}/sqlite
948 %defattr(-,root,root)
949 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
950 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
951 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
952 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
953 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
954 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
957 # The rest is DB backend independent
958 %attr(-, root, %{daemon_group}) %dir /etc/bacula
959 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
960 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
961 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
962 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
963 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
964 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
965 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
966 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
967 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
968 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
969 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
970 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
971 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
972 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
973 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
974 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
975 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
976 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
977 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
978 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
979 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
980 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
982 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
983 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
985 /etc/logrotate.d/bacula
986 /etc/log.d/scripts/services/bacula
987 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
988 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
989 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
990 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
991 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
992 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
993 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
994 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1004 /usr/sbin/btraceback
1013 # test for bacula database older than version 8
1014 # note: this ASSUMES no password has been set for bacula database
1015 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1020 # test for bacula database older than version 8
1021 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1022 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1027 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1030 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1031 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1032 echo "You appear to be running database version $DB_VER. You must first update"
1033 echo "your database to version 8 and then install this upgrade. The alternative"
1034 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1035 echo "catalog information, then do the upgrade. Information on updating a"
1036 echo "database older than version 8 can be found in the release notes."
1044 # check for and copy /etc/bacula/console.conf to bconsole.conf
1045 if [ -s /etc/bacula/console.conf ];then
1046 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1049 # create the daemon users and groups
1050 # first create the groups if they don't exist
1051 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1052 if [ -z "$HAVE_BACULA" ]; then
1053 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1054 echo "The group %{daemon_group} has been added to %{group_file}."
1055 echo "See the manual chapter \"Running Bacula\" for details."
1057 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1058 if [ -z "$HAVE_BACULA" ]; then
1059 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1060 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1061 echo "See the manual chapter \"Running Bacula\" for details."
1063 # now create the users if they do not exist
1064 # we do not use the -g option allowing the primary group to be set to system default
1065 # this will be a unique group on redhat type systems or the group users on some systems
1066 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1067 if [ -z "$HAVE_BACULA" ]; then
1068 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1069 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1070 echo "See the manual chapter \"Running Bacula\" for details."
1072 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1073 if [ -z "$HAVE_BACULA" ]; then
1074 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1075 echo "The user %{director_daemon_user} has been added to %{user_file}."
1076 echo "See the manual chapter \"Running Bacula\" for details."
1078 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1079 if [ -z "$HAVE_BACULA" ]; then
1080 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1081 echo "The user %{file_daemon_user} has been added to %{user_file}."
1082 echo "See the manual chapter \"Running Bacula\" for details."
1084 # now we add the supplementary groups, this is ok to call even if the users already exist
1085 # we only do this if the user is NOT root
1086 IS_ROOT=%{director_daemon_user}
1087 if [ "$IS_ROOT" != "root" ]; then
1088 %{usermod} %{director_daemon_user} -G %{daemon_group}
1090 IS_ROOT=%{storage_daemon_user}
1091 if [ "$IS_ROOT" != "root" ]; then
1092 %{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group}
1094 IS_ROOT=%{file_daemon_user}
1095 if [ "$IS_ROOT" != "root" ]; then
1096 %{usermod} %{file_daemon_user} -G %{daemon_group}
1110 if [ "$1" -ge 1 ] ; then
1111 /sbin/chkconfig --add bacula-dir
1112 /sbin/chkconfig --add bacula-fd
1113 /sbin/chkconfig --add bacula-sd
1117 # test for an existing database
1118 # note: this ASSUMES no password has been set for bacula database
1119 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1121 # grant privileges and create tables if they do not exist
1122 if [ -z "$DB_VER" ]; then
1123 echo "Hmm, doesn't look like you have an existing database."
1124 echo "Granting privileges for MySQL user bacula..."
1125 /etc/bacula/grant_mysql_privileges
1126 echo "Creating MySQL bacula database..."
1127 /etc/bacula/create_mysql_database
1128 echo "Creating bacula tables..."
1129 /etc/bacula/make_mysql_tables
1131 # check to see if we need to upgrade a 1.36 or lower database
1132 elif [ "$DB_VER" -lt "9" ]; then
1133 echo "This release requires an upgrade to your bacula database."
1134 echo "Backing up your current database..."
1135 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1136 echo "Upgrading bacula database ..."
1137 /etc/bacula/update_mysql_tables
1138 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1144 # test for an existing database
1145 if [ -s %{working_dir}/bacula.db ]; then
1146 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1147 # check to see if we need to upgrade a 1.36 or lower database
1148 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1149 echo "This release requires an upgrade to your bacula database."
1150 echo "Backing up your current database..."
1151 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1152 echo "Upgrading bacula database ..."
1153 /etc/bacula/update_sqlite_tables
1154 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1157 # create the database and tables
1158 echo "Hmm, doesn't look like you have an existing database."
1159 echo "Creating SQLite database..."
1160 /etc/bacula/create_sqlite_database
1161 echo "Creating the SQLite tables..."
1162 /etc/bacula/make_sqlite_tables
1167 # test for an existing database
1168 # note: this ASSUMES no password has been set for bacula database
1169 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1171 # grant privileges and create tables if they do not exist
1172 if [ -z "$DB_VER" ]; then
1173 echo "Hmm, doesn't look like you have an existing database."
1174 echo "Creating PostgreSQL bacula database..."
1175 /etc/bacula/create_postgresql_database
1176 echo "Creating bacula tables..."
1177 /etc/bacula/make_postgresql_tables
1178 echo "Granting privileges for PostgreSQL user bacula..."
1179 /etc/bacula/grant_postgresql_privileges
1181 # check to see if we need to upgrade a 1.36 or lower database
1182 elif [ "$DB_VER" -lt "9" ]; then
1183 echo "This release requires an upgrade to your bacula database."
1184 echo "Backing up your current database..."
1185 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1186 echo "Upgrading bacula database ..."
1187 /etc/bacula/update_postgresql_tables
1188 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1193 # generate passwords if needed
1194 if [ -d /etc/bacula ]; then
1196 for file in *.conf; do
1197 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1198 need_password=`grep $string $file 2>/dev/null`
1199 if [ -n "$need_password" ]; then
1200 pass=`openssl rand -base64 33`
1201 sed "s-$string-$pass-g" $file > $file.new
1202 cp -f $file.new $file; rm -f $file.new
1220 /sbin/chkconfig --del bacula-dir
1221 /sbin/chkconfig --del bacula-fd
1222 /sbin/chkconfig --del bacula-sd
1227 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1228 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1229 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1230 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1235 %defattr(-,root,root)
1236 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1237 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1238 /etc/init.d/bacula-fd
1239 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1241 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1242 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1244 /etc/logrotate.d/bacula
1246 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1247 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1248 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1251 /usr/sbin/btraceback
1252 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1253 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1259 # create the daemon group and user
1260 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1261 if [ -z "$HAVE_BACULA" ]; then
1262 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1263 echo "The group %{daemon_group} has been added to %{group_file}."
1264 echo "See the manual chapter \"Running Bacula\" for details."
1266 # we do not use the -g option allowing the primary group to be set to system default
1267 # this will be a unique group on redhat type systems or the group users on some systems
1268 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1269 if [ -z "$HAVE_BACULA" ]; then
1270 %{useradd} -r -c "Bacula" -d %{working_dir} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1271 echo "The user %{file_daemon_user} has been added to %{user_file}."
1272 echo "See the manual chapter \"Running Bacula\" for details."
1274 # now we add the supplementary group, this is ok to call even if the user already exists
1275 # we only do this if the user is NOT root
1276 IS_ROOT=%{file_daemon_user}
1277 if [ "$IS_ROOT" != "root" ]; then
1278 %{usermod} %{file_daemon_user} -G %{daemon_group}
1283 if [ "$1" -ge 1 ] ; then
1284 /sbin/chkconfig --add bacula-fd
1287 # generate passwords if needed
1288 if [ -d /etc/bacula ]; then
1290 for file in *.conf; do
1291 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1292 need_password=`grep $string $file 2>/dev/null`
1293 if [ -n "$need_password" ]; then
1294 pass=`openssl rand -base64 33`
1295 sed "s-$string-$pass-g" $file > $file.new
1296 cp -f $file.new $file; rm -f $file.new
1305 /sbin/chkconfig --del bacula-fd
1309 %defattr(-,root,%{daemon_group})
1310 /etc/bacula/updatedb/*
1313 # create the daemon group
1314 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1315 if [ -z "$HAVE_BACULA" ]; then
1316 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1317 echo "The group %{daemon_group} has been added to %{group_file}."
1318 echo "See the manual chapter \"Running Bacula\" for details."
1322 echo "The database update scripts were installed to /etc/bacula/updatedb"
1326 %defattr(-,root,root)
1327 /usr/sbin/gnome-console
1328 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1329 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1330 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1331 /usr/share/pixmaps/bacula.png
1335 /usr/share/applications/bacula.desktop
1338 %if %{gconsole} && ! %{rh8}
1339 /usr/sbin/bacula-tray-monitor
1340 %config(noreplace) /etc/bacula/tray-monitor.conf
1341 /usr/share/pixmaps/bacula-tray-monitor.xpm
1342 /usr/share/applications/bacula-tray-monitor.desktop
1345 %if %{gconsole} && ! %{su9} && ! %{su10}
1346 # add the console helper files
1347 %config(noreplace,missingok) /etc/pam.d/gnome-console
1348 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1349 /usr/bin/gnome-console
1354 # create the daemon group
1355 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1356 if [ -z "$HAVE_BACULA" ]; then
1357 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1358 echo "The group %{daemon_group} has been added to %{group_file}."
1359 echo "See the manual chapter \"Running Bacula\" for details."
1363 # generate passwords if needed
1364 if [ -d /etc/bacula ]; then
1366 for file in *.conf; do
1367 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1368 need_password=`grep $string $file 2>/dev/null`
1369 if [ -n "$need_password" ]; then
1370 pass=`openssl rand -base64 33`
1371 sed "s-$string-$pass-g" $file > $file.new
1372 cp -f $file.new $file; rm -f $file.new
1381 %defattr(-,root,root)
1383 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1384 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1385 /usr/share/pixmaps/wxwin16x16.xpm
1389 /usr/share/applications/wxconsole.desktop
1392 %if %{wxconsole} && ! %{su9} && ! %{su10}
1393 # add the console helper files
1394 %config(noreplace,missingok) /etc/pam.d/wxconsole
1395 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1401 # create the daemon group
1402 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1403 if [ -z "$HAVE_BACULA" ]; then
1404 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1405 echo "The group %{daemon_group} has been added to %{group_file}."
1406 echo "See the manual chapter \"Running Bacula\" for details."
1410 # generate passwords if needed
1411 if [ -d /etc/bacula ]; then
1413 for file in *.conf; do
1414 for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
1415 need_password=`grep $string $file 2>/dev/null`
1416 if [ -n "$need_password" ]; then
1417 pass=`openssl rand -base64 33`
1418 sed "s-$string-$pass-g" $file > $file.new
1419 cp -f $file.new $file; rm -f $file.new
1427 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1428 - add wxconsole package
1429 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1431 - dependency update for Mandriva
1432 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1434 - remove -n option from useradd scripts
1435 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1437 - fix problem specifying more than one primary group for user bacula
1438 - add build switch to not build gconsole regardless of platform
1439 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1440 - add centos3 build tag
1441 - fix link error of static-fd on Mandrake with --disable-nls
1442 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1443 - add fc4 dependencies
1444 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1445 - add SuSE 10.0 build
1446 - remove specific permission in attrib macros
1447 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1449 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1450 - refix compat for _dist on SLES9 which seems to have been removed
1451 - added note regarding Aleksandar's use of specific permissions in attrib macros
1452 - need to review and add specific fc4 build currently using fc3 Requires
1453 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1455 - Reorganize files and pre/post sections to remove repetitions
1456 - Always build separate mtx package
1457 - Fix file ownerships for /etc/bacula and Bacula's working dir
1458 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1459 - Disable GNOME on RH7
1460 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1461 - Red Hat and look alikes have mtx RPM, do not build/package our version
1462 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1463 - minor edit to _dist for SLES9 compatibility
1464 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1466 - kern changed location of pdf files and html manual in docs package
1467 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1469 - add docs (from prebuilt tarball) and rescue packages back in
1470 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1471 - remove 3 of 4 sqlite script patches as not needed
1472 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1474 - remove docs and rescue sections (remove static fd)
1475 - add dvd-freespace and dvd-writepart files
1476 - update depkgs to 22Jun05
1477 - change database update to 8 to 9
1478 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1479 - minor cleanups before 1.38 changes
1480 - add popt and popt-devel build dependencies
1481 - add tetex and tetex-dvips dependencies for doc build
1482 - replace deprecated Copyright tag with License
1483 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1484 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1485 - conflict with sqlite packages. remove readline dependency.
1486 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1487 - release 1.36.3 update docs
1488 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1489 - add centos4 build tag
1490 - add x86_64 build tag
1491 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1492 - add rhel4 build tag
1493 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1494 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1495 - add rhel3 build tag
1496 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1497 - fix tray-monitor.conf for noreplace
1498 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1499 - fix distribution check for Fedora and Whitebox
1500 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - add logwatch script
1503 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add build for Fedora Core 3 (linc now included in ORDit2)
1505 - add mysql4 define for Mandrake 10.1
1506 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1507 - fix {group_file} variable in post scripts
1508 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1509 - add distribution checking and custom Distribution tag
1510 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1511 - ASSIGNMENT OF COPYRIGHT
1512 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1513 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1514 - all right, title and interest in and to the copyright in this software RPM
1515 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1516 - free of all liens, encumbrances or any known claims against said copyright.
1517 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1519 - thanks to Daniel Widyono
1520 - update description for rescue package to describe cdrom creation
1521 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1522 - update depkgs to 29Oct04
1523 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1524 - add cdrom rescue to bacula-rescue package
1525 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1526 - misc fixes from 1.36.0 suse feedback
1527 - fix situation where sqlite database exists but sqlite has been removed.
1528 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1529 - remove tray-monitor from RH8 build
1530 - fix permissions on tray-monitor files
1531 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1532 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1533 - change database update to 7 to 8 upgrade,
1534 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1535 - build in 30Jul04, add freetype dependancy to gnome package.
1536 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1537 - add documentation to console for groupadd
1538 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1539 - add support for running daemons as root.bacula
1540 - correct for change in location of floppy rescue files in 1.35.2
1541 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1542 - updated depgkgs to 30Jul04
1543 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1544 - really, really fix symlink creation for gconsole
1545 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1546 - fix symlink creation in gconsole post install
1547 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1548 - fixed error in gconsole post script
1549 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1550 - add check for gconsole symlink before trying to create it
1551 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1552 - fix some minor permissions issues on doc files that CVS won't let us fix
1553 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1554 - add pkgconfig to BuildRequires
1555 - clean up gnome1/2 menu entries for appropriate packages
1556 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1557 - tightened up doc distribution
1558 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1559 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1560 - rpm's horrible bug that prevents nested conditional macros prevents me
1561 - from implementing these 2 separate approaches within the conditionals which
1562 - create the separate server packages.
1563 - the solution adopted is to remove the gnome-console files from the server packages
1564 - so bacula-gconsole is now an add on for both client and server packages.
1565 - this also now allows the server packages to be install on machines without
1566 - an X-server and we can still maintain a single spec file.
1567 - added tests to make sure we have defined platform and database macros.
1568 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1569 - corrected mysql prerequisites for suse
1570 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1571 - replaced all cp commands with cp -p
1572 - removed addition of a+x permissions on gnome-console
1573 - corrected permissions on init scripts
1574 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1575 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1577 - various cleanup patches from Michael K. Johnson:
1578 - corrected post install routines for nicer chkconfig
1579 - removed chmod changes in post routines and moved to install section
1580 - removed interactive nature of post routine for rescue package
1581 - added description of building rescue disks to the description of rescue package
1582 - added clean of build root to beginning of install
1583 - removed specifying attr in all file lists
1584 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1585 - added bconsole to client package
1586 - added gconsole package as add-on to client
1587 - removed spurious dependancies on updatedb package (!cut/paste)
1588 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1589 - added updatedb package
1590 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1591 - added postgresql package
1592 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1593 - corrected the if else logic in the dependancy sections
1594 - changes for 1.34 release
1595 - /etc/bacula/console is now /etc/bacula/bconsole
1596 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1597 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1598 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1599 - added new /etc/bacula/drop_mysql_database
1600 - added new /etc/bacula/drop_sqlite_database
1601 - added new /etc/bacula/grant_sqlite_privileges
1602 - added new generic bacula database scripts in /etc/bacula
1603 - added pre-install sections to check for database versions older than 6
1604 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1605 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1606 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1607 - added testing for existing databases before executing any of the database creation scripts
1608 - added defines working_dir and sqlite_bindir in place of hard coded paths
1609 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1610 - added build configuration for SuSE.
1611 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1612 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1613 - added patch for create_sqlite_database to fix the installed bindir
1614 - added execute of create_sqlite_database to post of sqlite package
1615 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1616 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1617 - added bacula-fd as Requires for rescue package
1618 - added build tag for Fedora Core 1
1619 - cleaned up dependancies for all builds
1620 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1621 - removed rh_version from package names
1622 - added platform build configuration section to beginning of file
1623 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1624 - removed make_static_bacula script from rescue package install
1625 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1626 - Added define at top of file for depkgs version
1627 - Added rescue sub-package
1628 - Moved requires statements into proper sub-package locations
1629 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1630 - Corrected Requires for Gnome 1.4/2.0 builds
1631 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1632 - Added separate source declaration for depkgs
1633 - added patch for make_catalog_backup script
1634 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1635 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1636 - Added rh_version to sub-package names
1637 - Added installed but missing file /etc/bacula/gconsole
1638 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1639 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1640 - Update spec for version 1.31 and combine client
1641 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>