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 25Jun06
9 %define sqlite_bindir /usr/lib/bacula/sqlite
10 %define working_dir /var/bacula
12 # NOTE these defines are used in some rather complex useradd and groupadd
13 # commands. If you change them examine the post scripts for consequences.
14 %define director_daemon_user bacula
15 %define storage_daemon_user bacula
16 %define file_daemon_user root
17 %define daemon_group bacula
18 # group that has write access to tape devices, usually disk on Linux
19 %define storage_daemon_group disk
21 %define user_file /etc/passwd
22 %define group_file /etc/group
23 %define useradd /usr/sbin/useradd
24 %define groupadd /usr/sbin/groupadd
25 %define usermod /usr/sbin/usermod
26 %define _rescuever 1.8.5
28 # platform defines - set one below or define the build_xxx on the command line
31 %{?build_rh7:%define rh7 1}
33 %{?build_rh8:%define rh8 1}
35 %{?build_rh9:%define rh9 1}
38 %{?build_fc1:%define fc1 1}
40 %{?build_fc3:%define fc3 1}
42 %{?build_fc4:%define fc4 1}
44 %{?build_fc5:%define fc5 1}
45 # Whitebox Enterprise build
47 %{?build_wb3:%define wb3 1}
48 # RedHat Enterprise builds
50 %{?build_rhel3:%define rhel3 1}
51 %{?build_rhel3:%define wb3 1}
53 %{?build_rhel4:%define rhel4 1}
54 %{?build_rhel4:%define fc3 1}
57 %{?build_centos3:%define centos3 1}
58 %{?build_centos3:%define wb3 1}
60 %{?build_centos4:%define centos4 1}
61 %{?build_centos4:%define fc3 1}
64 %{?build_su9:%define su9 1}
66 %{?build_su10:%define su10 1}
69 %{?build_mdk:%define mdk 1}
71 %{?build_mdv:%define mdv 1}
72 %{?build_mdv:%define mdk 1}
74 # test for a platform definition
75 %if ! %{rh7} && ! %{rh8} && ! %{rh9} && ! %{fc1} && ! %{fc3} && ! %{fc4} && ! %{fc5} && ! %{wb3} && ! %{su9} && ! %{su10} && ! %{mdk}
76 %{error: You must specify a platform. Please examine the spec file.}
81 # set for database support desired or define the build_xxx on the command line
83 %{?build_mysql:%define mysql 1}
84 # if using mysql 4.x define this and mysql above
85 # currently: Mandrake 10.1, SuSE 9.x & 10.0, RHEL4 and Fedora Core 4
87 %{?build_mysql4:%define mysql4 1}
88 %{?build_mysql4:%define mysql 1}
89 # if using mysql 5.x define this and mysql above
90 # currently: SuSE 10.1 and Fedora Core 5
92 %{?build_mysql5:%define mysql5 1}
93 %{?build_mysql5:%define mysql 1}
95 %{?build_sqlite:%define sqlite 1}
97 %{?build_postgresql:%define postgresql 1}
99 # test for a database definition
100 %if ! %{mysql} && ! %{sqlite} && ! %{postgresql}
101 %{error: You must specify database support. Please examine the spec file.}
106 %define db_backend mysql
109 %define db_backend sqlite
112 %define db_backend postgresql
117 %{?build_x86_64:%define x86_64 1}
119 # check what distribution we are
120 %if %{rh7} || %{rh8} || %{rh9} || %{rhel3} || %{rhel4}
121 %define _dist %(grep Red /etc/redhat-release)
123 %if %{fc1} || %{fc4} || %{fc5}
124 %define _dist %(grep Fedora /etc/redhat-release)
126 %if %{centos4} || %{centos3}
127 %define _dist %(grep CentOS /etc/redhat-release)
129 %if %{fc3} && ! %{rhel4} && ! %{centos4}
130 %define _dist %(grep Fedora /etc/redhat-release)
132 %if %{wb3} && ! %{rhel3} && ! %{centos3}
133 %define _dist %(grep White /etc/whitebox-release)
135 %if %{su9} || %{su10}
136 %define _dist %(grep -i SuSE /etc/SuSE-release)
139 %define _dist %(grep Mand /etc/mandrake-release)
142 # Should we build gconsole, possible only if gnome >= 2.0 available
148 # specifically disallow gconsole if desired
149 %{?nobuild_gconsole:%define gconsole 0}
151 # Should we build wxconsole, only wxWidgets >=2.6 is supported
152 # currently only SuSE 10 and FC4
154 %{?build_wxconsole:%define wxconsole 1}
156 # define the basic package description
157 %define blurb Bacula - It comes by night and sucks the vital essence from your computers.
158 %define blurb2 Bacula is a set of computer programs that permit you (or the system
159 %define blurb3 administrator) to manage backup, recovery, and verification of computer
160 %define blurb4 data across a network of computers of different kinds. In technical terms,
161 %define blurb5 it is a network client/server based backup program. Bacula is relatively
162 %define blurb6 easy to use and efficient, while offering many advanced storage management
163 %define blurb7 features that make it easy to find and recover lost or damaged files.
164 %define blurb8 Bacula source code has been released under the GPL version 2 license.
166 Summary: Bacula - The Network Backup Solution
170 Group: System Environment/Daemons
172 Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
173 Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
174 Source2: Release_Notes-%{version}-%{release}.tar.gz
175 Source3: http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz
176 Source4: http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz
177 BuildRoot: %{_tmppath}/%{name}-root
178 URL: http://www.bacula.org/
179 Vendor: The Bacula Team
180 Distribution: %{_dist}
181 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
183 %define _docsrc ../%{name}-docs-%{version}
184 %define _rescuesrc ../%{name}-rescue-%{_rescuever}
186 BuildRequires: gcc, gcc-c++
187 BuildRequires: atk-devel, ncurses-devel, pango-devel, perl
188 BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel
189 BuildRequires: openssl-devel
191 BuildRequires: pkgconfig
194 BuildRequires: libtermcap-devel
195 BuildRequires: glibc-devel >= 2.2
198 BuildRequires: termcap
199 BuildRequires: glibc-devel >= 2.3
201 %if %{su9} && %{gconsole}
202 BuildRequires: libgnome >= 2.0
203 BuildRequires: gtk2-devel >= 2.0
204 BuildRequires: libgnomeui-devel >= 2.0
205 BuildRequires: ORBit2-devel
206 BuildRequires: libart_lgpl-devel >= 2.0
207 BuildRequires: libbonobo-devel >= 2.0
208 BuildRequires: libbonoboui-devel >= 2.0
209 BuildRequires: bonobo-activation-devel
210 BuildRequires: gconf2-devel
211 BuildRequires: linc-devel
212 BuildRequires: freetype2-devel
215 BuildRequires: termcap
216 BuildRequires: glibc-devel >= 2.3
218 %if %{su10} && %{gconsole}
219 BuildRequires: libgnome >= 2.12
220 BuildRequires: gtk2-devel >= 2.8
221 BuildRequires: libgnomeui-devel >= 2.12
222 BuildRequires: ORBit2-devel
223 BuildRequires: libart_lgpl-devel >= 2.3
224 BuildRequires: libbonobo-devel >= 2.10
225 BuildRequires: libbonoboui-devel >= 2.10
226 BuildRequires: bonobo-activation-devel
227 BuildRequires: gconf2-devel
228 BuildRequires: freetype2-devel
229 BuildRequires: cairo-devel
230 BuildRequires: fontconfig-devel >= 2.3
231 BuildRequires: gnome-vfs2-devel >= 2.12
232 BuildRequires: libpng-devel
235 BuildRequires: libtermcap-devel
236 BuildRequires: libstdc++-static-devel
237 BuildRequires: glibc-static-devel
238 BuildRequires: glibc-devel >= 2.3
240 %if %{mdk} && !%{mdv} && %{gconsole}
241 BuildRequires: gtk2-devel >= 2.0
242 BuildRequires: libgnomeui2-devel >= 2.0
243 BuildRequires: libORBit2-devel
244 BuildRequires: libart_lgpl-devel >= 2.0
245 BuildRequires: libbonobo2_0-devel
246 BuildRequires: libbonoboui2_0-devel
247 BuildRequires: libbonobo-activation-devel
248 BuildRequires: libGConf2-devel
249 BuildRequires: freetype2-devel
251 %if %{mdv} && %{gconsole}
252 BuildRequires: gtk2-devel >= 2.8
253 BuildRequires: libgnomeui2-devel >= 2.10
254 BuildRequires: libORBit2-devel
255 BuildRequires: libart_lgpl-devel >= 2.3
256 BuildRequires: libbonobo2_0-devel
257 BuildRequires: libbonoboui2_0-devel
258 BuildRequires: libbonobo-activation-devel
259 BuildRequires: libGConf2-devel
260 BuildRequires: freetype2-devel
263 BuildRequires: libtermcap-devel
264 BuildRequires: glibc-devel >= 2.3
266 %if %{fc3} && %{gconsole}
267 BuildRequires: gtk2-devel >= 2.4
268 BuildRequires: libgnomeui-devel >= 2.8
269 BuildRequires: ORBit2-devel
270 BuildRequires: libart_lgpl-devel >= 2.3
271 BuildRequires: libbonobo-devel >= 2.8
272 BuildRequires: libbonoboui-devel >= 2.8
273 BuildRequires: bonobo-activation-devel
274 BuildRequires: GConf2-devel
275 BuildRequires: freetype-devel
278 BuildRequires: libtermcap-devel
279 BuildRequires: glibc-devel >= 2.3
281 %if %{fc4} && %{gconsole}
282 BuildRequires: gtk2-devel >= 2.6
283 BuildRequires: libgnomeui-devel >= 2.10
284 BuildRequires: ORBit2-devel
285 BuildRequires: libart_lgpl-devel >= 2.3
286 BuildRequires: libbonobo-devel >= 2.8
287 BuildRequires: libbonoboui-devel >= 2.8
288 BuildRequires: bonobo-activation-devel
289 BuildRequires: GConf2-devel
290 BuildRequires: freetype-devel
293 BuildRequires: libtermcap-devel
294 BuildRequires: glibc-devel >= 2.4
296 %if %{fc5} && %{gconsole}
297 BuildRequires: gtk2-devel >= 2.8
298 BuildRequires: libgnomeui-devel >= 2.14
299 BuildRequires: ORBit2-devel
300 BuildRequires: libart_lgpl-devel >= 2.3
301 BuildRequires: libbonobo-devel >= 2.14
302 BuildRequires: libbonoboui-devel >= 2.14
303 BuildRequires: GConf2-devel
304 BuildRequires: freetype-devel
306 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
307 BuildRequires: libtermcap-devel
308 BuildRequires: glibc-devel >= 2.3
310 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5} && %{gconsole}
311 BuildRequires: gtk2-devel >= 2.0
312 BuildRequires: libgnomeui-devel >= 2.0
313 BuildRequires: ORBit2-devel
314 BuildRequires: libart_lgpl-devel >= 2.0
315 BuildRequires: libbonobo-devel >= 2.0
316 BuildRequires: libbonoboui-devel >= 2.0
317 BuildRequires: bonobo-activation-devel
318 BuildRequires: GConf2-devel
319 BuildRequires: linc-devel
320 BuildRequires: freetype-devel
323 %if %{mysql} && ! %{mysql4} && ! %{mysql5}
324 BuildRequires: mysql-devel >= 3.23
327 %if %{mysql} && %{mysql4}
328 BuildRequires: mysql-devel >= 4.0
331 %if %{mysql} && %{mysql5}
332 BuildRequires: mysql-devel >= 5.0
335 %if %{postgresql} && %{wb3}
336 BuildRequires: rh-postgresql-devel >= 7
339 %if %{postgresql} && ! %{wb3}
340 BuildRequires: postgresql-devel >= 7
344 BuildRequires: wxGTK-devel >= 2.6
368 Summary: Bacula - The Network Backup Solution
369 Group: System Environment/Daemons
370 Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
371 Conflicts: bacula-client
372 Obsoletes: bacula-rescue
373 Requires: ncurses, libstdc++, zlib, openssl, mtx
376 Requires: glibc >= 2.2
379 %if %{su9} || %{su10}
380 Requires: glibc >= 2.3
383 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
384 Requires: glibc >= 2.3
388 Requires: glibc >= 2.4
392 %if %{mysql} && ! %{su9} && ! %{mdk} && ! %{mysql4} && ! %{mysql5}
393 Requires: mysql >= 3.23
394 Requires: mysql-server >= 3.23
396 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql4}
397 Requires: mysql >= 4.0
398 Requires: mysql-server >= 4.0
400 %if %{mysql} && ! %{su9} && ! %{su10} && ! %{mdk} && %{mysql5}
401 Requires: mysql >= 5.0
402 Requires: mysql-server >= 5.0
405 %if %{mysql} && %{su9} && ! %{mysql4}
406 Requires: mysql >= 3.23
407 Requires: mysql-client >= 3.23
409 %if %{mysql} && %{su9} && %{mysql4}
410 Requires: mysql >= 4.0
411 Requires: mysql-client >= 4.0
413 %if %{mysql} && %{su10} && %{mysql4}
414 Requires: mysql >= 4.0
415 Requires: mysql-client >= 4.0
417 %if %{mysql} && %{su10} && %{mysql5}
418 Requires: mysql >= 5.0
419 Requires: mysql-client >= 5.0
422 %if %{mysql} && %{mdk} && ! %{mysql4}
423 Requires: mysql >= 3.23
424 Requires: mysql-client >= 3.23
426 %if %{mysql} && %{mdk} && %{mysql4}
427 Requires: mysql >= 4.0
428 Requires: mysql-client >= 4.0
431 %if %{postgresql} && %{wb3}
432 Requires: rh-postgresql >= 7
433 Requires: rh-postgresql-server >= 7
435 %if %{postgresql} && ! %{wb3}
436 Requires: postgresql >= 7
437 Requires: postgresql-server >= 7
447 %description postgresql
461 This build requires MySQL to be installed separately as the catalog database.
464 This build requires PostgreSQL to be installed separately as the catalog database.
467 This build incorporates sqlite as the catalog database, statically compiled.
471 Summary: Bacula - The Network Backup Solution
472 Group: System Environment/Daemons
476 This is Bacula's version of mtx tape utilities for Linux distributions that
477 do not provide their own mtx package
480 Summary: Bacula - The Network Backup Solution
481 Group: System Environment/Daemons
483 Conflicts: bacula-mysql
484 Conflicts: bacula-sqlite
485 Conflicts: bacula-postgresql
486 Obsoletes: bacula-rescue
487 Requires: libstdc++, zlib, openssl
490 Requires: glibc >= 2.2
493 %if %{su9} || %{su10}
494 Requires: glibc >= 2.3
497 %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{fc5}
498 Requires: glibc >= 2.3
502 Requires: glibc >= 2.4
517 This is the File daemon (Client) only package. It includes the command line
522 Summary: Bacula - The Network Backup Solution
523 Group: System Environment/Daemons
525 %description updatedb
536 This package installs scripts for updating older versions of the bacula
541 Summary: Bacula - The Network Backup Solution
542 Group: System Environment/Daemons
543 Requires: atk, libstdc++, zlib, pango, libxml2, bacula-fd, openssl
546 %if %{gconsole} && %{su9}
547 Requires: gtk2 >= 2.0
548 Requires: libgnome >= 2.0
549 Requires: libgnomeui >= 2.0
550 Requires: glibc >= 2.3
552 Requires: libart_lgpl >= 2.0
553 Requires: libbonobo >= 2.0
554 Requires: libbonoboui >= 2.0
555 Requires: bonobo-activation
560 %if %{gconsole} && %{su10}
561 Requires: gtk2 >= 2.8
562 Requires: libgnome >= 2.12
563 Requires: libgnomeui >= 2.12
564 Requires: glibc >= 2.3
566 Requires: libart_lgpl >= 2.3
567 Requires: libbonobo >= 2.10
568 Requires: libbonoboui >= 2.10
569 Requires: bonobo-activation
573 Requires: fontconfig >= 2.3
574 Requires: gnome-vfs2 >= 2.12
577 %if %{gconsole} && %{mdk} && !%{mdv}
578 Requires: gtk2 >= 2.0
579 Requires: libgnomeui2
580 Requires: glibc >= 2.3
582 Requires: libart_lgpl >= 2.0
583 Requires: libbonobo >= 2.0
584 Requires: libbonoboui >= 2.0
588 %if %{gconsole} && %{mdv}
589 Requires: gtk2 >= 2.8
590 Requires: libgnomeui2
591 Requires: glibc >= 2.3
593 Requires: libart_lgpl >= 2.3
594 Requires: libbonobo >= 2.10
595 Requires: libbonoboui >= 2.10
599 %if %{gconsole} && %{fc3}
600 Requires: gtk2 >= 2.4
601 Requires: libgnomeui >= 2.8
602 Requires: glibc >= 2.3
604 Requires: libart_lgpl >= 2.3
605 Requires: libbonobo >= 2.8
606 Requires: libbonoboui >= 2.8
607 Requires: bonobo-activation
611 %if %{gconsole} && %{fc4}
612 Requires: gtk2 >= 2.6
613 Requires: libgnomeui >= 2.10
614 Requires: glibc >= 2.3
616 Requires: libart_lgpl >= 2.3
617 Requires: libbonobo >= 2.8
618 Requires: libbonoboui >= 2.8
619 Requires: bonobo-activation
623 %if %{gconsole} && %{fc5}
624 Requires: gtk2 >= 2.8
625 Requires: libgnomeui >= 2.14
626 Requires: glibc >= 2.4
628 Requires: libart_lgpl >= 2.3
629 Requires: libbonobo >= 2.14
630 Requires: libbonoboui >= 2.14
634 %if %{gconsole} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && ! %{fc5}
635 Requires: gtk2 >= 2.0
636 Requires: libgnomeui >= 2.0
637 Requires: glibc >= 2.3
639 Requires: libart_lgpl >= 2.0
640 Requires: libbonobo >= 2.0
641 Requires: libbonoboui >= 2.0
642 Requires: bonobo-activation
647 %if %{gconsole} && %{su9}
650 %if %{gconsole} && %{su10}
653 %if %{gconsole} && ! %{su9} && ! %{su10}
658 %description gconsole
669 This is the Gnome Console package. It is an add-on to the client or
675 Summary: Bacula - The Network Backup Solution
676 Group: System Environment/Daemons
677 Requires: wxGTK >= 2.6, libstdc++, openssl
680 %if %{wxconsole} && %{su10}
681 Requires: gtk2 >= 2.8
684 %if %{wxconsole} && %{fc3}
685 Requires: gtk2 >= 2.4
688 %if %{wxconsole} && %{fc4}
689 Requires: gtk2 >= 2.6
692 %if %{wxconsole} && %{fc5}
693 Requires: gtk2 >= 2.8
697 %description wxconsole
708 This is the WXWindows Console package. It is an add-on to the client or
722 %if %{su9} || %{su10}
723 export LDFLAGS="-L/usr/lib/termcap"
734 # patches for the bundled sqlite scripts
735 # as of 1.38.0 first 3 patches no longer needed
737 # patch the make_sqlite_tables script for installation bindir
738 # patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
740 # patch the create_sqlite_database script for installation bindir
741 #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
743 # patch the make_catalog_backup script for installation bindir
744 #patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
746 # patch the update_sqlite_tables script for installation bindir
747 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
749 # patch the bacula-dir init script to remove sqlite service
750 %if %{sqlite} && %{su9}
751 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
753 %if %{sqlite} && %{su10}
754 patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
757 # 64 bit lib location hacks
759 export LDFLAGS=-L/usr/lib64
761 %if %{mysql} && %{x86_64}
762 export LDFLAGS=-L/usr/lib64/mysql
767 --sbindir=/usr/sbin \
768 --sysconfdir=/etc/bacula \
769 --with-scriptdir=/etc/bacula \
770 --enable-smartalloc \
771 --enable-client-only \
781 --sbindir=/usr/sbin \
782 --sysconfdir=/etc/bacula \
783 --with-scriptdir=/etc/bacula \
784 --enable-smartalloc \
788 %if %{gconsole} && ! %{rh8}
789 --enable-tray-monitor \
795 --with-sqlite=${cwd}/%{depkgs}/sqlite \
801 --enable-wx-console \
803 --with-working-dir=%{working_dir} \
804 --with-pid-dir=/var/run \
805 --with-subsys-dir=/var/lock/subsys \
806 --with-dir-user=%{director_daemon_user} \
807 --with-dir-group=%{daemon_group} \
808 --with-sd-user=%{storage_daemon_user} \
809 --with-sd-group=%{storage_daemon_group} \
810 --with-fd-user=%{file_daemon_user} \
811 --with-fd-group=%{daemon_group} \
812 --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
813 --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
814 --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
815 --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
816 --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
817 --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
825 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
826 mkdir -p $RPM_BUILD_ROOT/etc/init.d
827 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
828 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/logfiles
829 mkdir -p $RPM_BUILD_ROOT/etc/log.d/conf/services
830 mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
831 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
833 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
835 mkdir -p $RPM_BUILD_ROOT/etc/bacula/updatedb
836 %if %{gconsole} && ! %{su9} && ! %{su10}
837 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
838 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
839 mkdir -p $RPM_BUILD_ROOT/usr/bin
843 mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
847 prefix=$RPM_BUILD_ROOT/usr \
848 sbindir=$RPM_BUILD_ROOT/usr/sbin \
849 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
850 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
851 working_dir=$RPM_BUILD_ROOT%{working_dir} \
856 prefix=$RPM_BUILD_ROOT/usr \
857 sbindir=$RPM_BUILD_ROOT/usr/sbin \
858 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
859 working_dir=$RPM_BUILD_ROOT%{working_dir} \
860 mandir=$RPM_BUILD_ROOT/usr/man \
864 # fixme - make installs the mysql scripts for sqlite build
866 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
867 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
868 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
871 # fixme - make installs the mysql scripts for postgresql build
873 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
874 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
877 # fixme - make installs gconsole script for build without gconsole
879 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
882 rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd
884 # install the init scripts
885 %if %{su9} || %{su10}
886 cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
887 cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
888 cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
891 cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
892 cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
893 cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
895 %if ! %{su9} && ! %{su10} && ! %{mdk}
896 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
897 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
898 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
900 chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
902 # install the menu stuff
903 %if %{gconsole} && %{su9}
904 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
905 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
906 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
907 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
909 %if %{gconsole} && %{su10}
910 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
911 cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
912 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
913 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
915 %if %{wxconsole} && %{su10}
916 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
917 cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
919 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
924 %if %{gconsole} && %{iftrick}
925 cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
926 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
927 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
928 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
929 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
931 %if %{gconsole} && ! %{rh8}
932 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
933 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
935 %if %{wxconsole} && %{iftrick}
936 cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
937 cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
938 cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
939 cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
940 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
945 cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
946 cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
947 cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
950 # install the logrotate file
951 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
953 # install the updatedb scripts
954 cp -p updatedb/* $RPM_BUILD_ROOT/etc/bacula/updatedb/
956 # install the logwatch scripts
957 cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
958 cp -p scripts/logwatch/logfile.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
959 cp -p scripts/logwatch/services.bacula.conf $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
960 chmod 755 $RPM_BUILD_ROOT/etc/log.d/scripts/services/bacula
961 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/logfiles/bacula.conf
962 chmod 644 $RPM_BUILD_ROOT/etc/log.d/conf/services/bacula.conf
964 # install the rescue files
965 mkdir $RPM_BUILD_ROOT/etc/bacula/rescue
966 cp -p %{_rescuesrc}/Makefile* $RPM_BUILD_ROOT/etc/bacula/rescue/
967 cp -p %{_rescuesrc}/README $RPM_BUILD_ROOT/etc/bacula/rescue/
968 cp -p %{_rescuesrc}/configure $RPM_BUILD_ROOT/etc/bacula/rescue/
969 cp -p %{_rescuesrc}/version.h $RPM_BUILD_ROOT/etc/bacula/rescue/
970 cp -pr %{_rescuesrc}/linux $RPM_BUILD_ROOT/etc/bacula/rescue/
971 cp -pr %{_rescuesrc}/autoconf $RPM_BUILD_ROOT/etc/bacula/rescue/
972 touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
973 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
974 rm -f src/filed/static-bacula-fd
977 mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
978 mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
981 # now clean up permissions that are left broken by the install
982 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
983 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
984 %if %{gconsole} && ! %{rh8}
985 chmod 755 $RPM_BUILD_ROOT/usr/sbin/bacula-tray-monitor
986 chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf
990 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
993 # MySQL specific files
995 %defattr(-, root, root)
996 %attr(-, root, %{daemon_group}) /etc/bacula/create_mysql_database
997 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_database
998 %attr(-, root, %{daemon_group}) /etc/bacula/make_mysql_tables
999 %attr(-, root, %{daemon_group}) /etc/bacula/drop_mysql_tables
1000 %attr(-, root, %{daemon_group}) /etc/bacula/update_mysql_tables
1001 %attr(-, root, %{daemon_group}) /etc/bacula/grant_mysql_privileges
1002 %attr(-, root, %{daemon_group}) /etc/bacula/startmysql
1003 %attr(-, root, %{daemon_group}) /etc/bacula/stopmysql
1008 %defattr(-,root,root)
1009 %attr(-, root, %{daemon_group}) /etc/bacula/create_sqlite_database
1010 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_database
1011 %attr(-, root, %{daemon_group}) /etc/bacula/grant_sqlite_privileges
1012 %attr(-, root, %{daemon_group}) /etc/bacula/make_sqlite_tables
1013 %attr(-, root, %{daemon_group}) /etc/bacula/drop_sqlite_tables
1014 %attr(-, root, %{daemon_group}) /etc/bacula/update_sqlite_tables
1015 %{sqlite_bindir}/libsqlite.a
1016 %{sqlite_bindir}/sqlite.h
1017 %{sqlite_bindir}/sqlite
1022 %defattr(-,root,root)
1023 %attr(-, root, %{daemon_group}) /etc/bacula/create_postgresql_database
1024 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_database
1025 %attr(-, root, %{daemon_group}) /etc/bacula/make_postgresql_tables
1026 %attr(-, root, %{daemon_group}) /etc/bacula/drop_postgresql_tables
1027 %attr(-, root, %{daemon_group}) /etc/bacula/update_postgresql_tables
1028 %attr(-, root, %{daemon_group}) /etc/bacula/grant_postgresql_privileges
1031 # The rest is DB backend independent
1032 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1033 %attr(-, root, %{daemon_group}) /etc/bacula/bacula
1034 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1035 %attr(-, root, %{daemon_group}) /etc/bacula/create_bacula_database
1036 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_database
1037 %attr(-, root, %{daemon_group}) /etc/bacula/grant_bacula_privileges
1038 %attr(-, root, %{daemon_group}) /etc/bacula/make_bacula_tables
1039 %attr(-, root, %{daemon_group}) /etc/bacula/drop_bacula_tables
1040 %attr(-, root, %{daemon_group}) /etc/bacula/update_bacula_tables
1041 %attr(-, root, %{daemon_group}) /etc/bacula/make_catalog_backup
1042 %attr(-, root, %{daemon_group}) /etc/bacula/delete_catalog_backup
1043 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1044 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1045 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1046 %attr(-, root, %{daemon_group}) /etc/bacula/disk-changer
1047 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir
1048 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd
1049 %attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd
1050 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
1051 %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
1052 %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler
1053 %attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
1054 %attr(-, root, %{storage_daemon_group}) /etc/bacula/mtx-changer
1056 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1057 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1059 /etc/logrotate.d/bacula
1060 /etc/log.d/scripts/services/bacula
1061 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-dir.conf
1062 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1063 %attr(-, root, %{storage_daemon_group}) %config(noreplace) /etc/bacula/bacula-sd.conf
1064 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1065 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/logfiles/bacula.conf
1066 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/log.d/conf/services/bacula.conf
1067 %attr(-, root, %{daemon_group}) /etc/bacula/query.sql
1068 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1070 /usr/sbin/bacula-dir
1078 /usr/sbin/btraceback
1087 # test for bacula database older than version 8
1088 # note: this ASSUMES no password has been set for bacula database
1089 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1094 # test for bacula database older than version 8
1095 if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
1096 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1101 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1104 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "8" ]; then
1105 echo "This bacula upgrade will update a bacula database from version 8 to 9."
1106 echo "You appear to be running database version $DB_VER. You must first update"
1107 echo "your database to version 8 and then install this upgrade. The alternative"
1108 echo "is to use /etc/bacula/drop_%{db_backend}_tables to delete all your your current"
1109 echo "catalog information, then do the upgrade. Information on updating a"
1110 echo "database older than version 8 can be found in the release notes."
1118 # check for and copy /etc/bacula/console.conf to bconsole.conf
1119 if [ -s /etc/bacula/console.conf ];then
1120 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
1123 # create the daemon users and groups
1124 # first create the groups if they don't exist
1125 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1126 if [ -z "$HAVE_BACULA" ]; then
1127 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1128 echo "The group %{daemon_group} has been added to %{group_file}."
1129 echo "See the manual chapter \"Running Bacula\" for details."
1131 HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
1132 if [ -z "$HAVE_BACULA" ]; then
1133 %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
1134 echo "The group %{storage_daemon_group} has been added to %{group_file}."
1135 echo "See the manual chapter \"Running Bacula\" for details."
1137 # now create the users if they do not exist
1138 # we do not use the -g option allowing the primary group to be set to system default
1139 # this will be a unique group on redhat type systems or the group users on some systems
1140 HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
1141 if [ -z "$HAVE_BACULA" ]; then
1142 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
1143 echo "The user %{storage_daemon_user} has been added to %{user_file}."
1144 echo "See the manual chapter \"Running Bacula\" for details."
1146 HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
1147 if [ -z "$HAVE_BACULA" ]; then
1148 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
1149 echo "The user %{director_daemon_user} has been added to %{user_file}."
1150 echo "See the manual chapter \"Running Bacula\" for details."
1152 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1153 if [ -z "$HAVE_BACULA" ]; then
1154 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1155 echo "The user %{file_daemon_user} has been added to %{user_file}."
1156 echo "See the manual chapter \"Running Bacula\" for details."
1158 # now we add the supplementary groups, this is ok to call even if the users already exist
1159 # we only do this if the user is NOT root
1160 IS_ROOT=%{director_daemon_user}
1161 if [ "$IS_ROOT" != "root" ]; then
1162 %{usermod} -G %{daemon_group} %{director_daemon_user}
1164 IS_ROOT=%{storage_daemon_user}
1165 if [ "$IS_ROOT" != "root" ]; then
1166 %{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
1168 IS_ROOT=%{file_daemon_user}
1169 if [ "$IS_ROOT" != "root" ]; then
1170 %{usermod} -G %{daemon_group} %{file_daemon_user}
1184 if [ "$1" -ge 1 ] ; then
1185 /sbin/chkconfig --add bacula-dir
1186 /sbin/chkconfig --add bacula-fd
1187 /sbin/chkconfig --add bacula-sd
1191 # test for an existing database
1192 # note: this ASSUMES no password has been set for bacula database
1193 DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
1195 # grant privileges and create tables if they do not exist
1196 if [ -z "$DB_VER" ]; then
1197 echo "Hmm, doesn't look like you have an existing database."
1198 echo "Granting privileges for MySQL user bacula..."
1199 /etc/bacula/grant_mysql_privileges
1200 echo "Creating MySQL bacula database..."
1201 /etc/bacula/create_mysql_database
1202 echo "Creating bacula tables..."
1203 /etc/bacula/make_mysql_tables
1205 # check to see if we need to upgrade a 1.36 or lower database
1206 elif [ "$DB_VER" -lt "9" ]; then
1207 echo "This release requires an upgrade to your bacula database."
1208 echo "Backing up your current database..."
1209 mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1210 echo "Upgrading bacula database ..."
1211 /etc/bacula/update_mysql_tables
1212 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1218 # test for an existing database
1219 if [ -s %{working_dir}/bacula.db ]; then
1220 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1`
1221 # check to see if we need to upgrade a 1.36 or lower database
1222 if [ "$DB_VER" -lt "9" ] && [ "$DB_VER" -ge "8" ]; then
1223 echo "This release requires an upgrade to your bacula database."
1224 echo "Backing up your current database..."
1225 echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1226 echo "Upgrading bacula database ..."
1227 /etc/bacula/update_sqlite_tables
1228 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1231 # create the database and tables
1232 echo "Hmm, doesn't look like you have an existing database."
1233 echo "Creating SQLite database..."
1234 /etc/bacula/create_sqlite_database
1235 echo "Creating the SQLite tables..."
1236 /etc/bacula/make_sqlite_tables
1241 # test for an existing database
1242 # note: this ASSUMES no password has been set for bacula database
1243 DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
1245 # grant privileges and create tables if they do not exist
1246 if [ -z "$DB_VER" ]; then
1247 echo "Hmm, doesn't look like you have an existing database."
1248 echo "Creating PostgreSQL bacula database..."
1249 /etc/bacula/create_postgresql_database
1250 echo "Creating bacula tables..."
1251 /etc/bacula/make_postgresql_tables
1252 echo "Granting privileges for PostgreSQL user bacula..."
1253 /etc/bacula/grant_postgresql_privileges
1255 # check to see if we need to upgrade a 1.36 or lower database
1256 elif [ "$DB_VER" -lt "9" ]; then
1257 echo "This release requires an upgrade to your bacula database."
1258 echo "Backing up your current database..."
1259 pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
1260 echo "Upgrading bacula database ..."
1261 /etc/bacula/update_postgresql_tables
1262 echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2"
1267 # generate passwords if needed
1268 if [ -d /etc/bacula ]; then
1270 for file in *.conf; do
1271 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
1272 need_password=`grep $string $file 2>/dev/null`
1273 if [ -n "$need_password" ]; then
1274 pass=`openssl rand -base64 33`
1275 sed "s-$string-$pass-g" $file > $file.new
1276 cp -f $file.new $file; rm -f $file.new
1294 /sbin/chkconfig --del bacula-dir
1295 /sbin/chkconfig --del bacula-fd
1296 /sbin/chkconfig --del bacula-sd
1301 %attr(-, root, %{storage_daemon_group}) /usr/sbin/loaderinfo
1302 %attr(-, root, %{storage_daemon_group}) /usr/sbin/mtx
1303 %attr(-, root, %{storage_daemon_group}) /usr/sbin/scsitape
1304 %attr(-, root, %{storage_daemon_group}) /usr/sbin/tapeinfo
1309 %defattr(-,root,root)
1310 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1311 %attr(-, root, %{daemon_group}) /etc/bacula/bconsole
1312 /etc/init.d/bacula-fd
1313 %attr(-, root, %{daemon_group}) /etc/bacula/rescue
1315 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo
1316 %doc %{_docsrc}/manual/bacula.pdf %{_docsrc}/developers/developers.pdf %{_docsrc}/manual/bacula ../Release_Notes-%{version}-%{release}.txt
1318 /etc/logrotate.d/bacula
1320 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bacula-fd.conf
1321 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/bconsole.conf
1322 %attr(-, root, %{daemon_group}) %dir %{working_dir}
1325 /usr/sbin/btraceback
1326 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb
1327 %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx
1333 # create the daemon group and user
1334 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1335 if [ -z "$HAVE_BACULA" ]; then
1336 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1337 echo "The group %{daemon_group} has been added to %{group_file}."
1338 echo "See the manual chapter \"Running Bacula\" for details."
1340 # we do not use the -g option allowing the primary group to be set to system default
1341 # this will be a unique group on redhat type systems or the group users on some systems
1342 HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
1343 if [ -z "$HAVE_BACULA" ]; then
1344 %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
1345 echo "The user %{file_daemon_user} has been added to %{user_file}."
1346 echo "See the manual chapter \"Running Bacula\" for details."
1348 # now we add the supplementary group, this is ok to call even if the user already exists
1349 # we only do this if the user is NOT root
1350 IS_ROOT=%{file_daemon_user}
1351 if [ "$IS_ROOT" != "root" ]; then
1352 %{usermod} -G %{daemon_group} %{file_daemon_user}
1357 if [ "$1" -ge 1 ] ; then
1358 /sbin/chkconfig --add bacula-fd
1361 # generate passwords if needed
1362 if [ -d /etc/bacula ]; then
1364 for file in *.conf; do
1365 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
1366 need_password=`grep $string $file 2>/dev/null`
1367 if [ -n "$need_password" ]; then
1368 pass=`openssl rand -base64 33`
1369 sed "s-$string-$pass-g" $file > $file.new
1370 cp -f $file.new $file; rm -f $file.new
1379 /sbin/chkconfig --del bacula-fd
1383 %defattr(-,root,%{daemon_group})
1384 /etc/bacula/updatedb/*
1387 # create the daemon group
1388 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1389 if [ -z "$HAVE_BACULA" ]; then
1390 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1391 echo "The group %{daemon_group} has been added to %{group_file}."
1392 echo "See the manual chapter \"Running Bacula\" for details."
1396 echo "The database update scripts were installed to /etc/bacula/updatedb"
1400 %defattr(-,root,root)
1401 /usr/sbin/gnome-console
1402 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1403 %attr(-, root, %{daemon_group}) /etc/bacula/gconsole
1404 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/gnome-console.conf
1405 /usr/share/pixmaps/bacula.png
1406 /usr/share/applications/bacula.desktop
1409 %if %{gconsole} && ! %{rh8}
1410 /usr/sbin/bacula-tray-monitor
1411 %config(noreplace) /etc/bacula/tray-monitor.conf
1412 /usr/share/pixmaps/bacula-tray-monitor.xpm
1413 /usr/share/applications/bacula-tray-monitor.desktop
1416 %if %{gconsole} && ! %{su9} && ! %{su10}
1417 # add the console helper files
1418 %config(noreplace,missingok) /etc/pam.d/gnome-console
1419 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
1420 /usr/bin/gnome-console
1425 # create the daemon group
1426 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1427 if [ -z "$HAVE_BACULA" ]; then
1428 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1429 echo "The group %{daemon_group} has been added to %{group_file}."
1430 echo "See the manual chapter \"Running Bacula\" for details."
1434 # generate passwords if needed
1435 if [ -d /etc/bacula ]; then
1437 for file in *.conf; do
1438 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
1439 need_password=`grep $string $file 2>/dev/null`
1440 if [ -n "$need_password" ]; then
1441 pass=`openssl rand -base64 33`
1442 sed "s-$string-$pass-g" $file > $file.new
1443 cp -f $file.new $file; rm -f $file.new
1452 %defattr(-,root,root)
1454 %attr(-, root, %{daemon_group}) %dir /etc/bacula
1455 %attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
1456 /usr/share/pixmaps/wxwin16x16.xpm
1457 /usr/share/applications/wxconsole.desktop
1460 %if %{wxconsole} && ! %{su9} && ! %{su10}
1461 # add the console helper files
1462 %config(noreplace,missingok) /etc/pam.d/wxconsole
1463 %config(noreplace,missingok) /etc/security/console.apps/wxconsole
1469 # create the daemon group
1470 HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
1471 if [ -z "$HAVE_BACULA" ]; then
1472 %{groupadd} -r %{daemon_group} > /dev/null 2>&1
1473 echo "The group %{daemon_group} has been added to %{group_file}."
1474 echo "See the manual chapter \"Running Bacula\" for details."
1478 # generate passwords if needed
1479 if [ -d /etc/bacula ]; then
1481 for file in *.conf; do
1482 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
1483 need_password=`grep $string $file 2>/dev/null`
1484 if [ -n "$need_password" ]; then
1485 pass=`openssl rand -base64 33`
1486 sed "s-$string-$pass-g" $file > $file.new
1487 cp -f $file.new $file; rm -f $file.new
1495 * Sun Jun 25 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1496 - update depkgs to 25Jun06
1497 - add mysql5 build tag
1498 * Mon Jun 12 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1499 - 1.38.10 bump rescue version
1500 * Sun Jun 03 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1501 - fix usermod statements
1503 * Thu Apr 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1504 - add -g param back to useradd statements Bug 605
1505 * Mon Apr 17 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1506 - redundant code cleanup
1507 * Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1508 - add wxconsole package
1509 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1511 - dependency update for Mandriva
1512 * Sun Apr 08 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1514 - remove -n option from useradd scripts
1515 * Sun Apr 02 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1517 - fix problem specifying more than one primary group for user bacula
1518 - add build switch to not build gconsole regardless of platform
1519 * Sun Jan 29 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1520 - add centos3 build tag
1521 - fix link error of static-fd on Mandrake with --disable-nls
1522 * Fri Jan 27 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1523 - add fc4 dependencies
1524 * Mon Jan 23 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1525 - add SuSE 10.0 build
1526 - remove specific permission in attrib macros
1527 * Sat Jan 21 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
1529 - fix usermode required on suse, suse doesn't have usermode (xsu instead)
1530 - refix compat for _dist on SLES9 which seems to have been removed
1531 - added note regarding Aleksandar's use of specific permissions in attrib macros
1532 - need to review and add specific fc4 build currently using fc3 Requires
1533 * Wed Dec 14 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1535 - Reorganize files and pre/post sections to remove repetitions
1536 - Always build separate mtx package
1537 - Fix file ownerships for /etc/bacula and Bacula's working dir
1538 * Wed Nov 23 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1539 - Disable GNOME on RH7
1540 * Fri Nov 18 2005 Aleksandar Milivojevic <alex@milivojevic.org>
1541 - Red Hat and look alikes have mtx RPM, do not build/package our version
1542 * Sun Nov 13 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1543 - minor edit to _dist for SLES9 compatibility
1544 * Sat Nov 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1546 - kern changed location of pdf files and html manual in docs package
1547 * Sun Oct 30 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1549 - add docs (from prebuilt tarball) and rescue packages back in
1550 - remove dvd-freespace and dvd-writepart files, add dvd-handler
1551 - remove 3 of 4 sqlite script patches as not needed
1552 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1554 - remove docs and rescue sections (remove static fd)
1555 - add dvd-freespace and dvd-writepart files
1556 - update depkgs to 22Jun05
1557 - change database update to 8 to 9
1558 * Sun Jul 24 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1559 - minor cleanups before 1.38 changes
1560 - add popt and popt-devel build dependencies
1561 - add tetex and tetex-dvips dependencies for doc build
1562 - replace deprecated Copyright tag with License
1563 * Sat May 07 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1564 - move sqlite installation bindir to /usr/lib/bacula/sqlite and remove
1565 - conflict with sqlite packages. remove readline dependency.
1566 * Sun Apr 17 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1567 - release 1.36.3 update docs
1568 * Tue Apr 05 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1569 - add centos4 build tag
1570 - add x86_64 build tag
1571 * Sun Apr 03 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1572 - add rhel4 build tag
1573 - clean up for mysql4 which is now mdk-10.1, suse-9.2 and rhel4
1574 * Sun Mar 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1575 - add rhel3 build tag
1576 * Tue Mar 01 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1577 - fix tray-monitor.conf for noreplace
1578 * Mon Feb 28 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1579 - fix distribution check for Fedora and Whitebox
1580 * Sun Feb 06 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1581 - add logwatch script
1583 * Sat Jan 15 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1584 - add build for Fedora Core 3 (linc now included in ORDit2)
1585 - add mysql4 define for Mandrake 10.1
1586 * Fri Jan 14 2005 D. Scott Barninger <barninger@fairfieldcomputers.com>
1587 - fix {group_file} variable in post scripts
1588 * Thu Dec 30 2004 D. Scott Barninger <barninger@fairfieldcomputers.com>
1589 - add distribution checking and custom Distribution tag
1590 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1591 - ASSIGNMENT OF COPYRIGHT
1592 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
1593 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
1594 - all right, title and interest in and to the copyright in this software RPM
1595 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
1596 - free of all liens, encumbrances or any known claims against said copyright.
1597 * Sat Dec 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1599 - thanks to Daniel Widyono
1600 - update description for rescue package to describe cdrom creation
1601 * Thu Nov 18 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1602 - update depkgs to 29Oct04
1603 * Fri Nov 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1604 - add cdrom rescue to bacula-rescue package
1605 * Sun Oct 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1606 - misc fixes from 1.36.0 suse feedback
1607 - fix situation where sqlite database exists but sqlite has been removed.
1608 * Fri Oct 22 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1609 - remove tray-monitor from RH8 build
1610 - fix permissions on tray-monitor files
1611 * Wed Oct 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1612 - add Mandrake support and tray-monitor, misc changes for 1.35.8/1.36.0,
1613 - change database update to 7 to 8 upgrade,
1614 - revert depkgs to 08Mar04 as there seems to be a bug in the sqlite
1615 - build in 30Jul04, add freetype dependancy to gnome package.
1616 * Sun Sep 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1617 - add documentation to console for groupadd
1618 * Sat Sep 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1619 - add support for running daemons as root.bacula
1620 - correct for change in location of floppy rescue files in 1.35.2
1621 - removed /etc/bacula/fd script from all packages as it has disappeared from 1.35.2
1622 - updated depgkgs to 30Jul04
1623 * Thu Jun 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1624 - really, really fix symlink creation for gconsole
1625 * Thu Jun 17 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1626 - fix symlink creation in gconsole post install
1627 * Sat Jun 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1628 - fixed error in gconsole post script
1629 * Fri Apr 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1630 - add check for gconsole symlink before trying to create it
1631 * Sun Apr 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1632 - fix some minor permissions issues on doc files that CVS won't let us fix
1633 * Sun Apr 04 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1634 - add pkgconfig to BuildRequires
1635 - clean up gnome1/2 menu entries for appropriate packages
1636 * Fri Apr 02 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1637 - tightened up doc distribution
1638 * Tue Mar 30 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1639 - added usermode (Redhat) and xsu (SuSE) support for gnome-console;
1640 - rpm's horrible bug that prevents nested conditional macros prevents me
1641 - from implementing these 2 separate approaches within the conditionals which
1642 - create the separate server packages.
1643 - the solution adopted is to remove the gnome-console files from the server packages
1644 - so bacula-gconsole is now an add on for both client and server packages.
1645 - this also now allows the server packages to be install on machines without
1646 - an X-server and we can still maintain a single spec file.
1647 - added tests to make sure we have defined platform and database macros.
1648 * Sat Mar 13 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1649 - corrected mysql prerequisites for suse
1650 * Mon Mar 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1651 - replaced all cp commands with cp -p
1652 - removed addition of a+x permissions on gnome-console
1653 - corrected permissions on init scripts
1654 * Sat Feb 28 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1655 - corrected creation of sqlite_bindir in install from !mysql to sqlite
1657 - various cleanup patches from Michael K. Johnson:
1658 - corrected post install routines for nicer chkconfig
1659 - removed chmod changes in post routines and moved to install section
1660 - removed interactive nature of post routine for rescue package
1661 - added description of building rescue disks to the description of rescue package
1662 - added clean of build root to beginning of install
1663 - removed specifying attr in all file lists
1664 * Fri Feb 20 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1665 - added bconsole to client package
1666 - added gconsole package as add-on to client
1667 - removed spurious dependancies on updatedb package (!cut/paste)
1668 * Thu Feb 19 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1669 - added updatedb package
1670 * Thu Feb 12 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1671 - added postgresql package
1672 * Wed Feb 11 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1673 - corrected the if else logic in the dependancy sections
1674 - changes for 1.34 release
1675 - /etc/bacula/console is now /etc/bacula/bconsole
1676 - /etc/bacula/console.conf is now /etc/bacula/bconsole.conf
1677 - /usr/sbin/btraceback.gdb is now /etc/bacula/btraceback.gdb
1678 - /usr/sbin/smtp is now /usr/sbin/bsmtp
1679 - added new /etc/bacula/drop_mysql_database
1680 - added new /etc/bacula/drop_sqlite_database
1681 - added new /etc/bacula/grant_sqlite_privileges
1682 - added new generic bacula database scripts in /etc/bacula
1683 - added pre-install sections to check for database versions older than 6
1684 - added check for /etc/bacula/console.conf and copy to bconsole.conf
1685 * Sun Feb 08 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1686 - added /etc/bacula/update_sqlite_tables and /etc/bacula/update_mysql_tables for 1.34 release
1687 - added testing for existing databases before executing any of the database creation scripts
1688 - added defines working_dir and sqlite_bindir in place of hard coded paths
1689 * Sat Jan 31 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1690 - added build configuration for SuSE.
1691 - Thanks to Matt Vollmar <matt at panamschool.edu.sv> for his input
1692 * Sat Jan 24 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1693 - added patch for create_sqlite_database to fix the installed bindir
1694 - added execute of create_sqlite_database to post of sqlite package
1695 * Sat Jan 10 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1696 - added virtual package Provides bacula-dir, bacula-sd, bacula-fd
1697 - added bacula-fd as Requires for rescue package
1698 - added build tag for Fedora Core 1
1699 - cleaned up dependancies for all builds
1700 * Thu Jan 1 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
1701 - removed rh_version from package names
1702 - added platform build configuration section to beginning of file
1703 * Tue Nov 25 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1704 - removed make_static_bacula script from rescue package install
1705 * Sun Nov 23 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1706 - Added define at top of file for depkgs version
1707 - Added rescue sub-package
1708 - Moved requires statements into proper sub-package locations
1709 * Mon Oct 27 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1710 - Corrected Requires for Gnome 1.4/2.0 builds
1711 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1712 - Added separate source declaration for depkgs
1713 - added patch for make_catalog_backup script
1714 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
1715 - Misc changes to mysql/sqlite build and rh7/8 menu differences
1716 - Added rh_version to sub-package names
1717 - Added installed but missing file /etc/bacula/gconsole
1718 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
1719 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
1720 - Update spec for version 1.31 and combine client
1721 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>