2 # Copyright (C) 2000-2006 Kern Sibbald
4 # Platform Build Configuration
6 # basic defines for every build
7 %define _version @VERSION@
9 %define depkgs_version 25Jun06
10 %define _rescuever 1.8.6
11 %define docs_version @VERSION@
13 # any patches for this release
14 # be sure to check the setup section for patch macros
17 #--------------------------------------------------------------------------
18 # it should not be necessary to change anything below here for a release
19 # except for patch macros in the setup section
20 #--------------------------------------------------------------------------
22 Summary: Bacula - The Network Backup Solution
26 Group: System Environment/Daemons
28 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
29 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
30 Source2: Release_Notes-%{version}-%{release}.tar.gz
31 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{docs_version}.tar.gz
32 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
33 BuildRoot: %{_tmppath}/%{name}-root
34 URL: http://www.bacula.org/
35 Vendor: The Bacula Team
36 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
38 # define the basic package description
39 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
40 %define blurb2 Bacula is a set of computer programs that permit you (or the system
41 %define blurb3 administrator) to manage backup, recovery, and verification of computer
42 %define blurb4 data across a network of computers of different kinds. In technical terms,
43 %define blurb5 it is a network client/server based backup program. Bacula is relatively
44 %define blurb6 easy to use and efficient, while offering many advanced storage management
45 %define blurb7 features that make it easy to find and recover lost or damaged files.
46 %define blurb8 Bacula source code has been released under the GPL version 2 license.
49 %define sqlite_bindir /usr/lib/bacula/sqlite
50 %define working_dir /var/bacula
51 %define _docsrc ../%{name}-docs-%{docs_version}
52 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
53 %define depkgs ../depkgs
55 # NOTE these defines are used in some rather complex useradd and groupadd
56 # commands. If you change them examine the post scripts for consequences.
57 %define director_daemon_user bacula
58 %define storage_daemon_user bacula
59 %define file_daemon_user root
60 %define daemon_group bacula
61 # group that has write access to tape devices, usually disk on Linux
62 %define storage_daemon_group disk
63 %define user_file /etc/passwd
64 %define group_file /etc/group
67 %define useradd /usr/sbin/useradd
68 %define groupadd /usr/sbin/groupadd
69 %define usermod /usr/sbin/usermod
71 # platform defines - set one below or define the build_xxx on the command line
74 %{?build_rh7:%define rh7 1}
76 %{?build_rh8:%define rh8 1}
78 %{?build_rh9:%define rh9 1}
81 %{?build_fc1:%define fc1 1}
83 %{?build_fc3:%define fc3 1}
85 %{?build_fc4:%define fc4 1}
87 %{?build_fc5:%define fc5 1}
88 # Whitebox Enterprise build
90 %{?build_wb3:%define wb3 1}
91 # RedHat Enterprise builds
93 %{?build_rhel3:%define rhel3 1}
94 %{?build_rhel3:%define wb3 1}
96 %{?build_rhel4:%define rhel4 1}
97 %{?build_rhel4:%define fc3 1}
100 %{?build_centos3:%define centos3 1}
101 %{?build_centos3:%define wb3 1}
103 %{?build_centos4:%define centos4 1}
104 %{?build_centos4:%define fc3 1}
107 %{?build_su9:%define su9 1}
109 %{?build_su10:%define su10 1}
112 %{?build_mdk:%define mdk 1}
114 %{?build_mdv:%define mdv 1}
115 %{?build_mdv:%define mdk 1}
117 # test for a platform definition
118 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
119 %{error: You must specify a platform. Please examine the spec file.}
124 # set for database support desired or define the build_xxx on the command line
126 %{?build_mysql:%define mysql 1}
127 # if using mysql 4.x define this and mysql above
128 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
130 %{?build_mysql4:%define mysql4 1}
131 %{?build_mysql4:%define mysql 1}
132 # if using mysql 5.x define this and mysql above
133 # currently: SuSE 10.1 and Fedora Core 5
135 %{?build_mysql5:%define mysql5 1}
136 %{?build_mysql5:%define mysql 1}
138 %{?build_sqlite:%define sqlite 1}
140 %{?build_postgresql:%define postgresql 1}
142 # test for a database definition
143 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
144 %{error: You must specify database support. Please examine the spec file.}
149 %define db_backend mysql
152 %define db_backend sqlite
155 %define db_backend postgresql
160 %{?build_x86_64:%define x86_64 1}
162 # check what distribution we are
163 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
164 %define _dist %(grep Red /etc/redhat-release)
166 %if %{fc1} || %{fc4} || %{fc5}
167 %define _dist %(grep Fedora /etc/redhat-release)
169 %if %{centos4} || %{centos3}
170 %define _dist %(grep CentOS /etc/redhat-release)
172 %if %{fc3} && ! %{rhel4} && ! %{centos4}
173 %define _dist %(grep Fedora /etc/redhat-release)
175 %if %{wb3} && ! %{rhel3} && ! %{centos3}
176 %define _dist %(grep White /etc/whitebox-release)
178 %if %{su9} || %{su10}
179 %define _dist %(grep -i SuSE /etc/SuSE-release)
182 %define _dist %(grep Mand /etc/mandrake-release)
184 Distribution: %{_dist}
186 # Should we build gconsole, possible only if gnome >= 2.0 available
192 # specifically disallow gconsole if desired
193 %{?nobuild_gconsole:%define gconsole 0}
195 # Should we build wxconsole, only wxWidgets >=2.6 is supported
196 # currently only SuSE 10 and FC4
198 %{?build_wxconsole:%define wxconsole 1}
200 # should we turn on python support
202 %{?build_python:%define python 1}
204 %{expand: %%define gccver %(rpm -q gcc | cut -d - -f 2)}
205 %{expand: %%define gccrel %(rpm -q gcc | cut -d - -f 3)}
207 BuildRequires: gcc, gcc-c++, make, autoconf
208 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
209 BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, libxml2-devel, zlib-devel
210 BuildRequires: openssl-devel
212 BuildRequires: python, python-devel
213 %{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
216 BuildRequires: pkgconfig
219 BuildRequires: libtermcap-devel
220 BuildRequires: glibc-devel >= 2.2
223 BuildRequires: termcap
224 BuildRequires: glibc-devel >= 2.3
226 %if %{su9} && %{gconsole}
227 BuildRequires: libgnome >= 2.0
228 BuildRequires: gtk2-devel >= 2.0
229 BuildRequires: libgnomeui-devel >= 2.0
230 BuildRequires: ORBit2-devel
231 BuildRequires: libart_lgpl-devel >= 2.0
232 BuildRequires: libbonobo-devel >= 2.0
233 BuildRequires: libbonoboui-devel >= 2.0
234 BuildRequires: bonobo-activation-devel
235 BuildRequires: gconf2-devel
236 BuildRequires: linc-devel
237 BuildRequires: freetype2-devel
240 BuildRequires: termcap
241 BuildRequires: glibc-devel >= 2.3
243 %if %{su10} && %{gconsole}
244 BuildRequires: libgnome >= 2.12
245 BuildRequires: gtk2-devel >= 2.8
246 BuildRequires: libgnomeui-devel >= 2.12
247 BuildRequires: ORBit2-devel
248 BuildRequires: libart_lgpl-devel >= 2.3
249 BuildRequires: libbonobo-devel >= 2.10
250 BuildRequires: libbonoboui-devel >= 2.10
251 BuildRequires: bonobo-activation-devel
252 BuildRequires: gconf2-devel
253 BuildRequires: freetype2-devel
254 BuildRequires: cairo-devel
255 BuildRequires: fontconfig-devel >= 2.3
256 BuildRequires: gnome-vfs2-devel >= 2.12
257 BuildRequires: libpng-devel
260 BuildRequires: libtermcap-devel
261 BuildRequires: libstdc++-static-devel
262 BuildRequires: glibc-static-devel
263 BuildRequires: glibc-devel >= 2.3
265 %if %{mdk} && !%{mdv} && %{gconsole}
266 BuildRequires: gtk2-devel >= 2.0
267 BuildRequires: libgnomeui2-devel >= 2.0
268 BuildRequires: libORBit2-devel
269 BuildRequires: libart_lgpl-devel >= 2.0
270 BuildRequires: libbonobo2_0-devel
271 BuildRequires: libbonoboui2_0-devel
272 BuildRequires: libbonobo-activation-devel
273 BuildRequires: libGConf2-devel
274 BuildRequires: freetype2-devel
276 %if %{mdv} && %{gconsole}
277 BuildRequires: gtk2-devel >= 2.8
278 BuildRequires: libgnomeui2-devel >= 2.10
279 BuildRequires: libORBit2-devel
280 BuildRequires: libart_lgpl-devel >= 2.3
281 BuildRequires: libbonobo2_0-devel
282 BuildRequires: libbonoboui2_0-devel
283 BuildRequires: libbonobo-activation-devel
284 BuildRequires: libGConf2-devel
285 BuildRequires: freetype2-devel
288 BuildRequires: libtermcap-devel
289 BuildRequires: glibc-devel >= 2.3
291 %if %{fc3} && %{gconsole}
292 BuildRequires: gtk2-devel >= 2.4
293 BuildRequires: libgnomeui-devel >= 2.8
294 BuildRequires: ORBit2-devel
295 BuildRequires: libart_lgpl-devel >= 2.3
296 BuildRequires: libbonobo-devel >= 2.8
297 BuildRequires: libbonoboui-devel >= 2.8
298 BuildRequires: bonobo-activation-devel
299 BuildRequires: GConf2-devel
300 BuildRequires: freetype-devel
303 BuildRequires: libtermcap-devel
304 BuildRequires: glibc-devel >= 2.3
306 %if %{fc4} && %{gconsole}
307 BuildRequires: gtk2-devel >= 2.6
308 BuildRequires: libgnomeui-devel >= 2.10
309 BuildRequires: ORBit2-devel
310 BuildRequires: libart_lgpl-devel >= 2.3
311 BuildRequires: libbonobo-devel >= 2.8
312 BuildRequires: libbonoboui-devel >= 2.8
313 BuildRequires: bonobo-activation-devel
314 BuildRequires: GConf2-devel
315 BuildRequires: freetype-devel
318 BuildRequires: libtermcap-devel
319 BuildRequires: glibc-devel >= 2.4
321 %if %{fc5} && %{gconsole}
322 BuildRequires: gtk2-devel >= 2.8
323 BuildRequires: libgnomeui-devel >= 2.14
324 BuildRequires: ORBit2-devel
325 BuildRequires: libart_lgpl-devel >= 2.3
326 BuildRequires: libbonobo-devel >= 2.14
327 BuildRequires: libbonoboui-devel >= 2.14
328 BuildRequires: GConf2-devel
329 BuildRequires: freetype-devel
331 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
332 BuildRequires: libtermcap-devel
333 BuildRequires: glibc-devel >= 2.3
335 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
336 BuildRequires: gtk2-devel >= 2.0
337 BuildRequires: libgnomeui-devel >= 2.0
338 BuildRequires: ORBit2-devel
339 BuildRequires: libart_lgpl-devel >= 2.0
340 BuildRequires: libbonobo-devel >= 2.0
341 BuildRequires: libbonoboui-devel >= 2.0
342 BuildRequires: bonobo-activation-devel
343 BuildRequires: GConf2-devel
344 BuildRequires: linc-devel
345 BuildRequires: freetype-devel
348 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
349 BuildRequires: mysql-devel >= 3.23
352 %if %{mysql} && %{mysql4}
353 BuildRequires: mysql-devel >= 4.0
356 %if %{mysql} && %{mysql5}
357 BuildRequires: mysql-devel >= 5.0
360 %if %{postgresql} && %{wb3}
361 BuildRequires: rh-postgresql-devel >= 7
364 %if %{postgresql} && ! %{wb3}
365 BuildRequires: postgresql-devel >= 7
369 BuildRequires: wxGTK-devel >= 2.6
393 Summary: Bacula - The Network Backup Solution
394 Group: System Environment/Daemons
395 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
396 Conflicts: bacula-client
397 Obsoletes: bacula-rescue
398 Requires: ncurses, libstdc++, zlib, openssl, mtx
401 Requires: glibc >= 2.2
404 %if %{su9} || %{su10}
405 Requires: glibc >= 2.3
408 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
409 Requires: glibc >= 2.3
413 Requires: glibc >= 2.4
417 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
418 Requires: mysql >= 3.23
419 Requires: mysql-server >= 3.23
421 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
422 Requires: mysql >= 4.0
423 Requires: mysql-server >= 4.0
425 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql5}
426 Requires: mysql >= 5.0
427 Requires: mysql-server >= 5.0
430 %if %{mysql} && %{su9} && ! %{mysql4}
431 Requires: mysql >= 3.23
432 Requires: mysql-client >= 3.23
434 %if %{mysql} && %{su9} && %{mysql4}
435 Requires: mysql >= 4.0
436 Requires: mysql-client >= 4.0
438 %if %{mysql} && %{su10} && %{mysql4}
439 Requires: mysql >= 4.0
440 Requires: mysql-client >= 4.0
442 %if %{mysql} && %{su10} && %{mysql5}
443 Requires: mysql >= 5.0
444 Requires: mysql-client >= 5.0
447 %if %{mysql} && %{mdk} && ! %{mysql4}
448 Requires: mysql >= 3.23
449 Requires: mysql-client >= 3.23
451 %if %{mysql} && %{mdk} && %{mysql4}
452 Requires: mysql >= 4.0
453 Requires: mysql-client >= 4.0
456 %if %{postgresql} && %{wb3}
457 Requires: rh-postgresql >= 7
458 Requires: rh-postgresql-server >= 7
460 %if %{postgresql} && ! %{wb3}
461 Requires: postgresql >= 7
462 Requires: postgresql-server >= 7
472 %description postgresql
476 Requires: python >= %{pyver}
490 This build requires MySQL to be installed separately as the catalog database.
493 This build requires PostgreSQL to be installed separately as the catalog database.
496 This build incorporates sqlite as the catalog database, statically compiled.
500 Summary: Bacula - The Network Backup Solution
501 Group: System Environment/Daemons
505 This is Bacula's version of mtx tape utilities for Linux distributions that
506 do not provide their own mtx package
509 Summary: Bacula - The Network Backup Solution
510 Group: System Environment/Daemons
512 Conflicts: bacula-mysql
513 Conflicts: bacula-sqlite
514 Conflicts: bacula-postgresql
515 Obsoletes: bacula-rescue
516 Requires: libstdc++, zlib, openssl
519 Requires: glibc >= 2.2
522 %if %{su9} || %{su10}
523 Requires: glibc >= 2.3
526 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
527 Requires: glibc >= 2.3
531 Requires: glibc >= 2.4
536 Requires: python >= %{pyver}
550 This is the File daemon (Client) only package. It includes the command line
555 Summary: Bacula - The Network Backup Solution
556 Group: System Environment/Daemons
558 %description updatedb
569 This package installs scripts for updating older versions of the bacula
574 Summary: Bacula - The Network Backup Solution
575 Group: System Environment/Daemons
576 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
579 %if %{gconsole} && %{su9}
580 Requires: gtk2 >= 2.0
581 Requires: libgnome >= 2.0
582 Requires: libgnomeui >= 2.0
583 Requires: glibc >= 2.3
585 Requires: libart_lgpl >= 2.0
586 Requires: libbonobo >= 2.0
587 Requires: libbonoboui >= 2.0
588 Requires: bonobo-activation
593 %if %{gconsole} && %{su10}
594 Requires: gtk2 >= 2.8
595 Requires: libgnome >= 2.12
596 Requires: libgnomeui >= 2.12
597 Requires: glibc >= 2.3
599 Requires: libart_lgpl >= 2.3
600 Requires: libbonobo >= 2.10
601 Requires: libbonoboui >= 2.10
602 Requires: bonobo-activation
606 Requires: fontconfig >= 2.3
607 Requires: gnome-vfs2 >= 2.12
610 %if %{gconsole} && %{mdk} && !%{mdv}
611 Requires: gtk2 >= 2.0
612 Requires: libgnomeui2
613 Requires: glibc >= 2.3
615 Requires: libart_lgpl >= 2.0
616 Requires: libbonobo >= 2.0
617 Requires: libbonoboui >= 2.0
621 %if %{gconsole} && %{mdv}
622 Requires: gtk2 >= 2.8
623 Requires: libgnomeui2
624 Requires: glibc >= 2.3
626 Requires: libart_lgpl >= 2.3
627 Requires: libbonobo >= 2.10
628 Requires: libbonoboui >= 2.10
632 %if %{gconsole} && %{fc3}
633 Requires: gtk2 >= 2.4
634 Requires: libgnomeui >= 2.8
635 Requires: glibc >= 2.3
637 Requires: libart_lgpl >= 2.3
638 Requires: libbonobo >= 2.8
639 Requires: libbonoboui >= 2.8
640 Requires: bonobo-activation
644 %if %{gconsole} && %{fc4}
645 Requires: gtk2 >= 2.6
646 Requires: libgnomeui >= 2.10
647 Requires: glibc >= 2.3
649 Requires: libart_lgpl >= 2.3
650 Requires: libbonobo >= 2.8
651 Requires: libbonoboui >= 2.8
652 Requires: bonobo-activation
656 %if %{gconsole} && %{fc5}
657 Requires: gtk2 >= 2.8
658 Requires: libgnomeui >= 2.14
659 Requires: glibc >= 2.4
661 Requires: libart_lgpl >= 2.3
662 Requires: libbonobo >= 2.14
663 Requires: libbonoboui >= 2.14
667 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
668 Requires: gtk2 >= 2.0
669 Requires: libgnomeui >= 2.0
670 Requires: glibc >= 2.3
672 Requires: libart_lgpl >= 2.0
673 Requires: libbonobo >= 2.0
674 Requires: libbonoboui >= 2.0
675 Requires: bonobo-activation
680 %if %{gconsole} && %{su9}
683 %if %{gconsole} && %{su10}
686 %if %{gconsole} && ! %{su9} && ! %{su10}
691 %description gconsole
702 This is the Gnome Console package. It is an add-on to the client or
708 Summary: Bacula - The Network Backup Solution
709 Group: System Environment/Daemons
710 Requires: wxGTK >= 2.6, libstdc++, openssl
713 %if %{wxconsole} && %{su10}
714 Requires: gtk2 >= 2.8
717 %if %{wxconsole} && %{fc3}
718 Requires: gtk2 >= 2.4
721 %if %{wxconsole} && %{fc4}
722 Requires: gtk2 >= 2.6
725 %if %{wxconsole} && %{fc5}
726 Requires: gtk2 >= 2.8
730 %description wxconsole
741 This is the WXWindows Console package. It is an add-on to the client or
755 %if %{su9} || %{su10}
756 export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap"
767 # patches for the bundled sqlite scripts
768 # as of 1.38.0 first 3 patches no longer needed
770 # patch the make_sqlite_tables script for installation bindir
771 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
773 # patch the create_sqlite_database script for installation bindir
774 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
776 # patch the make_catalog_backup script for installation bindir
777 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
779 # patch the update_sqlite_tables script for installation bindir
780 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
782 # patch the bacula-dir init script to remove sqlite service
783 %if %{sqlite} && %{su9}
784 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
786 %if %{sqlite} && %{su10}
787 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
790 # 64 bit lib location hacks
792 export LDFLAGS="${LDFLAGS} -L/usr/lib64"
794 %if %{mysql} && %{x86_64}
795 export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
797 # this MAY be necessary for python support - waiting for feedback to enable
798 #%if %{python} && %{x86_64}
799 #export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
804 --sbindir=/usr/sbin \
805 --sysconfdir=/etc/bacula \
806 --with-scriptdir=/etc/bacula \
807 --enable-smartalloc \
808 --enable-client-only \
818 --sbindir=/usr/sbin \
819 --sysconfdir=/etc/bacula \
820 --with-scriptdir=/etc/bacula \
821 --enable-smartalloc \
825 %if %{gconsole} && ! %{rh8}
826 --enable-tray-monitor \
832 --with-sqlite=${cwd}/%{depkgs}/sqlite \
838 --enable-wx-console \
843 --with-working-dir=%{working_dir} \
844 --with-pid-dir=/var/run \
845 --with-subsys-dir=/var/lock/subsys \
846 --with-dir-user=%{director_daemon_user} \
847 --with-dir-group=%{daemon_group} \
848 --with-sd-user=%{storage_daemon_user} \
849 --with-sd-group=%{storage_daemon_group} \
850 --with-fd-user=%{file_daemon_user} \
851 --with-fd-group=%{daemon_group} \
852 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
853 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
854 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
855 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
856 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
857 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
865 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
866 mkdir -p $RPM_BUILD_ROOT/etc/init.d
867 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
868 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
869 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
870 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
871 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
873 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
875 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
876 %if %{gconsole} && ! %{su9} && ! %{su10}
877 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
878 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
879 mkdir -p $RPM_BUILD_ROOT/usr/bin
883 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
887 prefix=$RPM_BUILD_ROOT/usr \
888 sbindir=$RPM_BUILD_ROOT/usr/sbin \
889 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
890 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
891 working_dir=$RPM_BUILD_ROOT%{working_dir} \
896 prefix=$RPM_BUILD_ROOT/usr \
897 sbindir=$RPM_BUILD_ROOT/usr/sbin \
898 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
899 working_dir=$RPM_BUILD_ROOT%{working_dir} \
900 mandir=$RPM_BUILD_ROOT/usr/man \
904 # fixme - make installs the mysql scripts for sqlite build
906 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
907 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
908 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
911 # fixme - make installs the mysql scripts for postgresql build
913 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
914 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
917 # fixme - make installs gconsole script for build without gconsole
919 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
922 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
924 # install the init scripts
925 %if %{su9} || %{su10}
926 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
927 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
928 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
931 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
932 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
933 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
935 %if ! %{su9} && ! %{su10} && ! %{mdk}
936 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
937 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
938 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
940 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
942 # install the menu stuff
943 %if %{gconsole} && %{su9}
944 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
945 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
946 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
947 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
949 %if %{gconsole} && %{su10}
950 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
951 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
952 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
953 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
955 %if %{wxconsole} && %{su10}
956 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
957 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
959 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
964 %if %{gconsole} && %{iftrick}
965 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
966 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
967 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
968 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
969 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
971 %if %{gconsole} && ! %{rh8}
972 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
973 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
975 %if %{wxconsole} && %{iftrick}
976 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
977 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
978 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
979 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
980 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
985 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
986 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
987 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
990 # install the logrotate file
991 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
993 # install the updatedb scripts
994 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
996 # install the logwatch scripts
997 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
998 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
999 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1000 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
1001 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
1002 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
1004 # install the rescue files
1005 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
1006 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
1007 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
1008 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
1009 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
1010 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
1011 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
1012 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
1013 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
1014 rm -f src/filed/static-bacula-fd
1017 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
1018 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
1021 # now clean up permissions that are left broken by the install
1022 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
1023 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
1024 %if %{gconsole} && ! %{rh8}
1025 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
1026 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
1030 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
1033 # MySQL specific files
1035 %defattr(-, root, root)
1036 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
1037 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
1038 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
1039 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
1040 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
1041 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
1042 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
1043 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
1048 %defattr(-,root,root)
1049 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
1050 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
1051 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
1052 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
1053 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
1054 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1055 %{sqlite_bindir}/libsqlite.a
1056 %{sqlite_bindir}/sqlite.h
1057 %{sqlite_bindir}/sqlite
1062 %defattr(-,root,root)
1063 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1064 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1065 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1066 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1067 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1068 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1071 # The rest is DB backend independent
1072 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1073 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1074 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1075 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1076 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1077 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1078 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1079 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1080 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1081 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1082 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1083 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1084 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1085 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1086 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1087 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1088 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1089 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1090 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1091 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1092 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1093 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1094 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1096 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1097 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1099 /etc/logrotate.d/bacula
1100 /etc/log.d/scripts/services/bacula
1101 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1102 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1103 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1104 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1105 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1106 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1107 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1108 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1110 /usr/sbin/bacula-dir
1118 /usr/sbin/btraceback
1127 # test for bacula database older than version 8
1128 # note: this ASSUMES no password has been set for bacula database
1129 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1134 # test for bacula database older than version 8
1135 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1136 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1141 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1144 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1145 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1146 echo "You appear to be running database version $DB_VER. You must first update"
1147 echo "your database to version 8 and then install this upgrade. The alternative"
1148 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1149 echo "catalog information, then do the upgrade. Information on updating a"
1150 echo "database older than version 8 can be found in the release notes."
1158 # check for and copy /etc/bacula/console.conf to bconsole.conf
1159 if [ -s /etc/bacula/console.conf ];then
1160 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1163 # create the daemon users and groups
1164 # first create the groups if they don't exist
1165 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1166 if [ -z "$HAVE_BACULA" ]; then
1167 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1168 echo "The group %{daemon_group} has been added to %{group_file}."
1169 echo "See the manual chapter \"Running Bacula\" for details."
1171 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1172 if [ -z "$HAVE_BACULA" ]; then
1173 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1174 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1175 echo "See the manual chapter \"Running Bacula\" for details."
1177 # now create the users if they do not exist
1178 # we do not use the -g option allowing the primary group to be set to system default
1179 # this will be a unique group on redhat type systems or the group users on some systems
1180 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1181 if [ -z "$HAVE_BACULA" ]; then
1182 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1183 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1184 echo "See the manual chapter \"Running Bacula\" for details."
1186 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1187 if [ -z "$HAVE_BACULA" ]; then
1188 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1189 echo "The user %{director_daemon_user} has been added to %{user_file}."
1190 echo "See the manual chapter \"Running Bacula\" for details."
1192 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1193 if [ -z "$HAVE_BACULA" ]; then
1194 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1195 echo "The user %{file_daemon_user} has been added to %{user_file}."
1196 echo "See the manual chapter \"Running Bacula\" for details."
1198 # now we add the supplementary groups, this is ok to call even if the users already exist
1199 # we only do this if the user is NOT root
1200 IS_ROOT=%{director_daemon_user}
1201 if [ "$IS_ROOT" != "root" ]; then
1202 %{usermod} -G %{daemon_group} %{director_daemon_user}
1204 IS_ROOT=%{storage_daemon_user}
1205 if [ "$IS_ROOT" != "root" ]; then
1206 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1208 IS_ROOT=%{file_daemon_user}
1209 if [ "$IS_ROOT" != "root" ]; then
1210 %{usermod} -G %{daemon_group} %{file_daemon_user}
1224 if [ "$1" -ge 1 ] ; then
1225 /sbin/chkconfig --add bacula-dir
1226 /sbin/chkconfig --add bacula-fd
1227 /sbin/chkconfig --add bacula-sd
1231 # test for an existing database
1232 # note: this ASSUMES no password has been set for bacula database
1233 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1235 # grant privileges and create tables if they do not exist
1236 if [ -z "$DB_VER" ]; then
1237 echo "Hmm, doesn't look like you have an existing database."
1238 echo "Granting privileges for MySQL user bacula..."
1239 /etc/bacula/grant_mysql_privileges
1240 echo "Creating MySQL bacula database..."
1241 /etc/bacula/create_mysql_database
1242 echo "Creating bacula tables..."
1243 /etc/bacula/make_mysql_tables
1245 # check to see if we need to upgrade a 1.36 or lower database
1246 elif [ "$DB_VER" -lt "9" ]; then
1247 echo "This release requires an upgrade to your bacula database."
1248 echo "Backing up your current database..."
1249 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1250 echo "Upgrading bacula database ..."
1251 /etc/bacula/update_mysql_tables
1252 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1258 # test for an existing database
1259 if [ -s %{working_dir}/bacula.db ]; then
1260 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1261 # check to see if we need to upgrade a 1.36 or lower database
1262 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1263 echo "This release requires an upgrade to your bacula database."
1264 echo "Backing up your current database..."
1265 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1266 echo "Upgrading bacula database ..."
1267 /etc/bacula/update_sqlite_tables
1268 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1271 # create the database and tables
1272 echo "Hmm, doesn't look like you have an existing database."
1273 echo "Creating SQLite database..."
1274 /etc/bacula/create_sqlite_database
1275 echo "Creating the SQLite tables..."
1276 /etc/bacula/make_sqlite_tables
1281 # test for an existing database
1282 # note: this ASSUMES no password has been set for bacula database
1283 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1285 # grant privileges and create tables if they do not exist
1286 if [ -z "$DB_VER" ]; then
1287 echo "Hmm, doesn't look like you have an existing database."
1288 echo "Creating PostgreSQL bacula database..."
1289 /etc/bacula/create_postgresql_database
1290 echo "Creating bacula tables..."
1291 /etc/bacula/make_postgresql_tables
1292 echo "Granting privileges for PostgreSQL user bacula..."
1293 /etc/bacula/grant_postgresql_privileges
1295 # check to see if we need to upgrade a 1.36 or lower database
1296 elif [ "$DB_VER" -lt "9" ]; then
1297 echo "This release requires an upgrade to your bacula database."
1298 echo "Backing up your current database..."
1299 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1300 echo "Upgrading bacula database ..."
1301 /etc/bacula/update_postgresql_tables
1302 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1307 # generate passwords if needed
1308 if [ -d /etc/bacula ]; then
1310 for file in *.conf; do
1311 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
1312 need_password=`grep $string $file 2>/dev/null`
1313 if [ -n "$need_password" ]; then
1314 pass=`openssl rand -base64 33`
1315 sed "s-$string-$pass-g" $file > $file.new
1316 cp -f $file.new $file; rm -f $file.new
1334 /sbin/chkconfig --del bacula-dir
1335 /sbin/chkconfig --del bacula-fd
1336 /sbin/chkconfig --del bacula-sd
1341 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1342 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1343 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1344 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1349 %defattr(-,root,root)
1350 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1351 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1352 /etc/init.d/bacula-fd
1353 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1355 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1356 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1358 /etc/logrotate.d/bacula
1360 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1361 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1362 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1365 /usr/sbin/btraceback
1366 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1367 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1373 # create the daemon group and user
1374 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1375 if [ -z "$HAVE_BACULA" ]; then
1376 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1377 echo "The group %{daemon_group} has been added to %{group_file}."
1378 echo "See the manual chapter \"Running Bacula\" for details."
1380 # we do not use the -g option allowing the primary group to be set to system default
1381 # this will be a unique group on redhat type systems or the group users on some systems
1382 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1383 if [ -z "$HAVE_BACULA" ]; then
1384 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1385 echo "The user %{file_daemon_user} has been added to %{user_file}."
1386 echo "See the manual chapter \"Running Bacula\" for details."
1388 # now we add the supplementary group, this is ok to call even if the user already exists
1389 # we only do this if the user is NOT root
1390 IS_ROOT=%{file_daemon_user}
1391 if [ "$IS_ROOT" != "root" ]; then
1392 %{usermod} -G %{daemon_group} %{file_daemon_user}
1397 if [ "$1" -ge 1 ] ; then
1398 /sbin/chkconfig --add bacula-fd
1401 # generate passwords if needed
1402 if [ -d /etc/bacula ]; then
1404 for file in *.conf; do
1405 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
1406 need_password=`grep $string $file 2>/dev/null`
1407 if [ -n "$need_password" ]; then
1408 pass=`openssl rand -base64 33`
1409 sed "s-$string-$pass-g" $file > $file.new
1410 cp -f $file.new $file; rm -f $file.new
1419 /sbin/chkconfig --del bacula-fd
1423 %defattr(-,root,%{daemon_group})
1424 /etc/bacula/updatedb/*
1427 # create the daemon group
1428 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1429 if [ -z "$HAVE_BACULA" ]; then
1430 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1431 echo "The group %{daemon_group} has been added to %{group_file}."
1432 echo "See the manual chapter \"Running Bacula\" for details."
1436 echo "The database update scripts were installed to /etc/bacula/updatedb"
1440 %defattr(-,root,root)
1441 /usr/sbin/gnome-console
1442 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1443 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1444 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1445 /usr/share/pixmaps/bacula.png
1446 /usr/share/applications/bacula.desktop
1449 %if %{gconsole} && ! %{rh8}
1450 /usr/sbin/bacula-tray-monitor
1451 %config(noreplace) /etc/bacula/tray-monitor.conf
1452 /usr/share/pixmaps/bacula-tray-monitor.xpm
1453 /usr/share/applications/bacula-tray-monitor.desktop
1456 %if %{gconsole} && ! %{su9} && ! %{su10}
1457 # add the console helper files
1458 %config(noreplace,missingok) /etc/pam.d/gnome-console
1459 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1460 /usr/bin/gnome-console
1465 # create the daemon group
1466 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1467 if [ -z "$HAVE_BACULA" ]; then
1468 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1469 echo "The group %{daemon_group} has been added to %{group_file}."
1470 echo "See the manual chapter \"Running Bacula\" for details."
1474 # generate passwords if needed
1475 if [ -d /etc/bacula ]; then
1477 for file in *.conf; do
1478 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
1479 need_password=`grep $string $file 2>/dev/null`
1480 if [ -n "$need_password" ]; then
1481 pass=`openssl rand -base64 33`
1482 sed "s-$string-$pass-g" $file > $file.new
1483 cp -f $file.new $file; rm -f $file.new
1492 %defattr(-,root,root)
1494 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1495 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1496 /usr/share/pixmaps/wxwin16x16.xpm
1497 /usr/share/applications/wxconsole.desktop
1500 %if %{wxconsole} && ! %{su9} && ! %{su10}
1501 # add the console helper files
1502 %config(noreplace,missingok) /etc/pam.d/wxconsole
1503 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1509 # create the daemon group
1510 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1511 if [ -z "$HAVE_BACULA" ]; then
1512 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1513 echo "The group %{daemon_group} has been added to %{group_file}."
1514 echo "See the manual chapter \"Running Bacula\" for details."
1518 # generate passwords if needed
1519 if [ -d /etc/bacula ]; then
1521 for file in *.conf; do
1522 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
1523 need_password=`grep $string $file 2>/dev/null`
1524 if [ -n "$need_password" ]; then
1525 pass=`openssl rand -base64 33`
1526 sed "s-$string-$pass-g" $file > $file.new
1527 cp -f $file.new $file; rm -f $file.new
1535 * Tue Jul 04 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1536 - add check to buildrequires to make sure libstdc++ version matches gcc
1537 * Mon Jul 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1538 - add python build support
1539 - fix LDFLAGS declarations
1540 * Sun Jul 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1541 - add requires for standard compiler toolchain
1542 - move version and release tags up
1544 - add docs_version tag
1545 * Sat Jul 01 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1546 - update rescuever to 1.8.6
1547 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1548 - update depkgs to 25Jun06
1549 - add mysql5 build tag
1550 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1551 - 1.38.10 bump rescue version
1552 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1553 - fix usermod statements
1555 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1556 - add -g param back to useradd statements Bug 605
1557 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1558 - redundant code cleanup
1559 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1560 - add wxconsole package
1561 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1563 - dependency update for Mandriva
1564 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1566 - remove -n option from useradd scripts
1567 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1569 - fix problem specifying more than one primary group for user bacula
1570 - add build switch to not build gconsole regardless of platform
1571 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1572 - add centos3 build tag
1573 - fix link error of static-fd on Mandrake with --disable-nls
1574 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1575 - add fc4 dependencies
1576 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1577 - add SuSE 10.0 build
1578 - remove specific permission in attrib macros
1579 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1581 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1582 - refix compat for _dist on SLES9 which seems to have been removed
1583 - added note regarding Aleksandar's use of specific permissions in attrib macros
1584 - need to review and add specific fc4 build currently using fc3 Requires
1585 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1587 - Reorganize files and pre/post sections to remove repetitions
1588 - Always build separate mtx package
1589 - Fix file ownerships for /etc/bacula and Bacula's working dir
1590 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1591 - Disable GNOME on RH7
1592 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1593 - Red Hat and look alikes have mtx RPM, do not build/package our version
1594 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1595 - minor edit to _dist for SLES9 compatibility
1596 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1598 - kern changed location of pdf files and html manual in docs package
1599 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1601 - add docs (from prebuilt tarball) and rescue packages back in
1602 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1603 - remove 3 of 4 sqlite script patches as not needed
1604 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1606 - remove docs and rescue sections (remove static fd)
1607 - add dvd-freespace and dvd-writepart files
1608 - update depkgs to 22Jun05
1609 - change database update to 8 to 9
1610 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1611 - minor cleanups before 1.38 changes
1612 - add popt and popt-devel build dependencies
1613 - add tetex and tetex-dvips dependencies for doc build
1614 - replace deprecated Copyright tag with License
1615 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1616 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1617 - conflict with sqlite packages. remove readline dependency.
1618 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1619 - release 1.36.3 update docs
1620 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1621 - add centos4 build tag
1622 - add x86_64 build tag
1623 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1624 - add rhel4 build tag
1625 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1626 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1627 - add rhel3 build tag
1628 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1629 - fix tray-monitor.conf for noreplace
1630 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1631 - fix distribution check for Fedora and Whitebox
1632 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1633 - add logwatch script
1635 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1636 - add build for Fedora Core 3 (linc now included in ORDit2)
1637 - add mysql4 define for Mandrake 10.1
1638 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1639 - fix {group_file} variable in post scripts
1640 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1641 - add distribution checking and custom Distribution tag
1642 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1643 - ASSIGNMENT OF COPYRIGHT
1644 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1645 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1646 - all right, title and interest in and to the copyright in this software RPM
1647 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1648 - free of all liens, encumbrances or any known claims against said copyright.
1649 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1651 - thanks to Daniel Widyono
1652 - update description for rescue package to describe cdrom creation
1653 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1654 - update depkgs to 29Oct04
1655 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1656 - add cdrom rescue to bacula-rescue package
1657 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1658 - misc fixes from 1.36.0 suse feedback
1659 - fix situation where sqlite database exists but sqlite has been removed.
1660 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1661 - remove tray-monitor from RH8 build
1662 - fix permissions on tray-monitor files
1663 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1664 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1665 - change database update to 7 to 8 upgrade,
1666 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1667 - build in 30Jul04, add freetype dependancy to gnome package.
1668 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1669 - add documentation to console for groupadd
1670 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1671 - add support for running daemons as root.bacula
1672 - correct for change in location of floppy rescue files in 1.35.2
1673 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1674 - updated depgkgs to 30Jul04
1675 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1676 - really, really fix symlink creation for gconsole
1677 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1678 - fix symlink creation in gconsole post install
1679 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1680 - fixed error in gconsole post script
1681 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1682 - add check for gconsole symlink before trying to create it
1683 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1684 - fix some minor permissions issues on doc files that CVS won't let us fix
1685 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1686 - add pkgconfig to BuildRequires
1687 - clean up gnome1/2 menu entries for appropriate packages
1688 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1689 - tightened up doc distribution
1690 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1691 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1692 - rpm's horrible bug that prevents nested conditional macros prevents me
1693 - from implementing these 2 separate approaches within the conditionals which
1694 - create the separate server packages.
1695 - the solution adopted is to remove the gnome-console files from the server packages
1696 - so bacula-gconsole is now an add on for both client and server packages.
1697 - this also now allows the server packages to be install on machines without
1698 - an X-server and we can still maintain a single spec file.
1699 - added tests to make sure we have defined platform and database macros.
1700 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1701 - corrected mysql prerequisites for suse
1702 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1703 - replaced all cp commands with cp -p
1704 - removed addition of a+x permissions on gnome-console
1705 - corrected permissions on init scripts
1706 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1707 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1709 - various cleanup patches from Michael K. Johnson:
1710 - corrected post install routines for nicer chkconfig
1711 - removed chmod changes in post routines and moved to install section
1712 - removed interactive nature of post routine for rescue package
1713 - added description of building rescue disks to the description of rescue package
1714 - added clean of build root to beginning of install
1715 - removed specifying attr in all file lists
1716 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1717 - added bconsole to client package
1718 - added gconsole package as add-on to client
1719 - removed spurious dependancies on updatedb package (!cut/paste)
1720 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1721 - added updatedb package
1722 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1723 - added postgresql package
1724 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1725 - corrected the if else logic in the dependancy sections
1726 - changes for 1.34 release
1727 - /etc/bacula/console is now /etc/bacula/bconsole
1728 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1729 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1730 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1731 - added new /etc/bacula/drop_mysql_database
1732 - added new /etc/bacula/drop_sqlite_database
1733 - added new /etc/bacula/grant_sqlite_privileges
1734 - added new generic bacula database scripts in /etc/bacula
1735 - added pre-install sections to check for database versions older than 6
1736 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1737 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1738 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1739 - added testing for existing databases before executing any of the database creation scripts
1740 - added defines working_dir and sqlite_bindir in place of hard coded paths
1741 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1742 - added build configuration for SuSE.
1743 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1744 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1745 - added patch for create_sqlite_database to fix the installed bindir
1746 - added execute of create_sqlite_database to post of sqlite package
1747 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1748 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1749 - added bacula-fd as Requires for rescue package
1750 - added build tag for Fedora Core 1
1751 - cleaned up dependancies for all builds
1752 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1753 - removed rh_version from package names
1754 - added platform build configuration section to beginning of file
1755 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1756 - removed make_static_bacula script from rescue package install
1757 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1758 - Added define at top of file for depkgs version
1759 - Added rescue sub-package
1760 - Moved requires statements into proper sub-package locations
1761 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1762 - Corrected Requires for Gnome 1.4/2.0 builds
1763 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1764 - Added separate source declaration for depkgs
1765 - added patch for make_catalog_backup script
1766 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1767 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1768 - Added rh_version to sub-package names
1769 - Added installed but missing file /etc/bacula/gconsole
1770 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1771 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1772 - Update spec for version 1.31 and combine client
1773 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>