Author: bluca
Date: Sat Feb 17 11:41:06 2007
New Revision: 122084

Modified:
   packages/cooker/bacula/current/SPECS/bacula.spec

Log:
fix build using --without options

Modified: packages/cooker/bacula/current/SPECS/bacula.spec
==============================================================================
--- packages/cooker/bacula/current/SPECS/bacula.spec    (original)
+++ packages/cooker/bacula/current/SPECS/bacula.spec    Sat Feb 17 11:41:06 2007
@@ -11,6 +11,7 @@
 %define TCPW 1
 %define GUI 1
 %define RESCUE 0
+%define TRAY 1
 
 %{?_with_mysql: %{expand: %%global MYSQL 1}}
 %{?_without_mysql: %{expand: %%global MYSQL 0}}
@@ -28,6 +29,8 @@
 %{?_without_gui: %{expand: %%global GUI 0}}
 %{?_with_rescue: %{expand: %%global RESCUE 1}}
 %{?_without_rescue: %{expand: %%global RESCUE 0}}
+%{?_with_tray: %{expand: %%global TRAY 1}}
+%{?_without_tray: %{expand: %%global TRAY 0}}
 
 %define blurb Bacula - It comes by night and sucks the vital essence from your 
computers.
 
@@ -377,9 +380,11 @@
 Contains the bacula image manager cgi-bin
 %endif
 
+%if %{TRAY}
 %package       tray-monitor
 Summary:       Bacula Tray Monitor
 Group:         Archiving/Backup
+BuildRequires: gtk2-devel
 Requires(post): sed bacula-common = %{epoch}:%{version}-%{release}
 Requires(preun): sed bacula-common = %{epoch}:%{version}-%{release}
 Requires:      usermode, usermode-consoleonly
@@ -391,6 +396,7 @@
 %description   tray-monitor
 %{blurb}
 The tray monitor for bacula.
+%endif
 
 %prep
 
@@ -417,7 +423,12 @@
 bzcat %{SOURCE7} > bacula.pam
 %endif
 
-%define _configure_common --enable-smartalloc 
--sysconfdir=%{_sysconfdir}/%{name} 
--with-working-dir=%{_localstatedir}/%{name} 
--with-scriptdir=%{_libexecdir}/%{name} --with-subsys-dir=/var/lock/subsys 
--with-python --with-openssl --with-readline %{?TCPW: --with-tcp-wrappers}
+%if %{TCPW}
+%define _configure_tcpw --with-tcp-wrappers
+%else
+%define _configure_tcpw %{nil}
+%endif
+%define _configure_common --enable-smartalloc 
--sysconfdir=%{_sysconfdir}/%{name} 
--with-working-dir=%{_localstatedir}/%{name} 
--with-scriptdir=%{_libexecdir}/%{name} --with-subsys-dir=/var/lock/subsys 
--with-python --with-openssl --with-readline %{_configure_tcpw}
 
 %build
 %serverbuild
@@ -469,19 +480,21 @@
 %configure --with-sqlite \
        %_configure_common \
        --without-mysql --without-postgresql --without-sqlite3 \
-       --with-dir-password="#FAKE#DIR#PASSWORD#" \
-       --with-fd-password="#FAKE#FD#PASSWORD#" \
-       --with-sd-password="#FAKE#SD#PASSWORD#" \
-       --with-mon-dir-password="#FAKE#MON#DIR#PASSWORD#" \
-       --with-mon-fd-password="#FAKE#MON#FD#PASSWORD#" \
-       --with-mon-sd-password="#FAKE#MON#SD#PASSWORD#" \
 %if %{GNOME}
        --enable-gnome \
 %endif
 %if %{WXWINDOWS}
        --enable-wx-console \
 %endif
-       --enable-tray-monitor
+%if %{TRAY}
+       --enable-tray-monitor \
+%endif
+       --with-dir-password="#FAKE#DIR#PASSWORD#" \
+       --with-fd-password="#FAKE#FD#PASSWORD#" \
+       --with-sd-password="#FAKE#SD#PASSWORD#" \
+       --with-mon-dir-password="#FAKE#MON#DIR#PASSWORD#" \
+       --with-mon-fd-password="#FAKE#MON#FD#PASSWORD#" \
+       --with-mon-sd-password="#FAKE#MON#SD#PASSWORD#" \
 
 %make
 for i in src/dird/bacula-dir src/stored/bscan src/tools/dbcheck; do
@@ -504,7 +517,17 @@
 %makeinstall sysconfdir=%{buildroot}%{_sysconfdir}/%{name} 
scriptdir=%{buildroot}%{_libexecdir}/%{name} 
working_dir=%{buildroot}%{_localstatedir}/%{name}
 
 # install the catalog scripts and binaries
-for db_type in %{?MYSQL: mysql} %{?PGSQL: postgresql} %{?SQLITE3: sqlite3} 
sqlite; do
+for db_type in \
+%if %{MYSQL}
+       mysql \
+%endif
+%if %{PGSQL}
+       postgresql \
+%endif
+%if %{SQLITE3}
+       sqlite3 \
+%endif
+       sqlite; do
     install -m 755 updatedb/update_${db_type}_tables_?_to_? 
%{buildroot}%{_libexecdir}/%{name}
     for f in create_${db_type}_database drop_${db_type}_database 
drop_${db_type}_tables \
        grant_${db_type}_privileges make_${db_type}_tables 
update_${db_type}_tables ; do
@@ -622,6 +645,7 @@
 #cp -p src/console/bconsole.conf 
%{buildroot}%{_sysconfdir}/%{name}/wx-console.conf
 %endif
 
+%if %{TRAY}
 cat << EOF > %{buildroot}%{_menudir}/%{name}-tray-monitor
 ?package(%{name}-tray-monitor): \
 command="%{_bindir}/bacula-tray-monitor" \
@@ -653,6 +677,7 @@
 EOF
 install -m0644 bacula.pam %{buildroot}%{_sysconfdir}/pam.d/bacula-tray-monitor
 ln -s consolehelper %{buildroot}%{_bindir}/bacula-tray-monitor
+%endif
 
 # Remove some left-over in the compil process to the correct path
 %__rm -f %{buildroot}/%{_libdir}/%{name}/{start,stop}mysql 
@@ -723,6 +748,7 @@
 %preun dir-common
 %_preun_service bacula-dir
 
+%if %{MYSQL}
 %post dir-mysql
 umask 077
 for f in create_mysql_database drop_mysql_database drop_mysql_tables \
@@ -762,7 +788,9 @@
 fi
 chown -R bacula:bacula %{_localstatedir}/%{name}
 chmod -R u+rX,go-rwx %{_localstatedir}/%{name}
+%endif
 
+%if %{PGSQL}
 %post dir-pgsql
 umask 077
 for f in create_postgresql_database drop_postgresql_database 
drop_postgresql_tables \
@@ -802,7 +830,9 @@
 fi
 chown -R bacula:bacula %{_localstatedir}/%{name}
 chmod -R u+rX,go-rwx %{_localstatedir}/%{name}
+%endif
 
+%if %{SQLITE3}
 %post dir-sqlite3
 umask 077
 for f in create_sqlite3_database drop_sqlite3_database drop_sqlite3_tables \
@@ -839,6 +869,7 @@
 fi
 chown -R bacula:bacula %{_localstatedir}/%{name}
 chmod -R u+rX,go-rwx %{_localstatedir}/%{name}
+%endif
 
 %post dir-sqlite
 umask 077
@@ -929,7 +960,7 @@
 %endif
 %endif
 
-%if %{GUI}
+%if %{TRAY}
 %post tray-monitor
 %post_fix_config tray-monitor
 %update_menus
@@ -965,12 +996,16 @@
 %{_mandir}/man8/btraceback.8*
 %exclude %{_libexecdir}/%{name}/bacula
 %if ! %{GNOME}
-%exclude %{_mandir}/man1/gnome-console.1*
+%exclude %{_mandir}/man1/bacula-console-gnome.1*
+%endif
+%if ! %{TRAY}
+%exclude %{_mandir}/man1/bacula-tray-monitor.1*
 %endif
 %if ! %{WXWINDOWS}
-%exclude %{_mandir}/man1/wx-console.1*
+%exclude %{_mandir}/man1/bacula-wxconsole.1*
 %endif
 
+
 %files dir-common
 %defattr(644, root, root, 755)
 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
@@ -1009,6 +1044,7 @@
 %{_libexecdir}/%{name}/make_sqlite_tables
 %{_libexecdir}/%{name}/update_sqlite_tables*
 
+%if %{MYSQL}
 %files dir-mysql
 %{_sbindir}/bacula-dir-mysql
 %{_sbindir}/dbcheck-mysql
@@ -1019,7 +1055,9 @@
 %{_libexecdir}/%{name}/grant_mysql_privileges
 %{_libexecdir}/%{name}/make_mysql_tables
 %{_libexecdir}/%{name}/update_mysql_tables*
+%endif
 
+%if %{PGSQL}
 %files dir-pgsql
 %{_sbindir}/bacula-dir-postgresql
 %{_sbindir}/dbcheck-postgresql
@@ -1030,7 +1068,9 @@
 %{_libexecdir}/%{name}/grant_postgresql_privileges
 %{_libexecdir}/%{name}/make_postgresql_tables
 %{_libexecdir}/%{name}/update_postgresql_tables*
+%endif
 
+%if %{SQLITE3}
 %files dir-sqlite3
 %{_sbindir}/bacula-dir-sqlite3
 %{_sbindir}/dbcheck-sqlite3
@@ -1041,6 +1081,7 @@
 %{_libexecdir}/%{name}/grant_sqlite3_privileges
 %{_libexecdir}/%{name}/make_sqlite3_tables
 %{_libexecdir}/%{name}/update_sqlite3_tables*
+%endif
 
 %files fd
 %defattr(755, root, root)
@@ -1132,6 +1173,7 @@
 %{_sysconfdir}/create_cdimage_table.pl
 %endif
 
+%if %{TRAY}
 %files tray-monitor
 %defattr(644, root, root, 755)
 %doc LICENSE
@@ -1146,3 +1188,4 @@
 %{_menudir}/bacula-tray-monitor
 %{_datadir}/applications/mandriva-%{name}-tray-monitor.desktop
 %{_mandir}/man1/bacula-tray-monitor.1*
+%endif

Reply via email to