]> git.sur5r.net Git - bacula/bacula/commitdiff
Add wxconsole to rpm build.
authorScott Barninger <scott@barninger.com>
Sun, 16 Apr 2006 16:01:51 +0000 (16:01 +0000)
committerScott Barninger <scott@barninger.com>
Sun, 16 Apr 2006 16:01:51 +0000 (16:01 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2922 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/configure.in
bacula/configure
bacula/platforms/mandrake/bacula.spec.in
bacula/platforms/redhat/bacula.spec.in
bacula/platforms/suse/bacula.spec.in
bacula/scripts/wxconsole.console_apps.in [new file with mode: 0644]
bacula/scripts/wxconsole.desktop.consolehelper.in [new file with mode: 0644]
bacula/scripts/wxconsole.desktop.xsu.in [new file with mode: 0644]
bacula/scripts/wxconsole.pamd [new file with mode: 0644]

index b8b0012f6c2cc208669bada81967cae0cf5e4a42..271c602aa2b60b5ef9c2a90eb079134ee67aba8f 100644 (file)
@@ -1940,6 +1940,9 @@ AC_OUTPUT([autoconf/Make.common \
           scripts/bacula-tray-monitor.desktop \
           scripts/logwatch/Makefile \
           scripts/logwatch/logfile.bacula.conf \
+           scripts/wxconsole.console_apps \
+           scripts/wxconsole.desktop.consolehelper \
+           scripts/wxconsole.desktop.xsu \
           src/Makefile \
           src/host.h \
           src/console/Makefile \
index a31d0fd27a5d1fa794b61f34a6c0ab789fac3b61..2fc506b4e6d0da67f2b4f4627e9a0cf7f73f78e2 100755 (executable)
@@ -29834,7 +29834,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then
    exit 1
 fi
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ac_config_files="$ac_config_files autoconf/Make.common Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/pygtk-console/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile po/Makefile.in $PFILES"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ac_config_files="$ac_config_files autoconf/Make.common Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/pygtk-console/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile po/Makefile.in $PFILES"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -30406,6 +30406,9 @@ do
   "scripts/bacula-tray-monitor.desktop" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-tray-monitor.desktop" ;;
   "scripts/logwatch/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/Makefile" ;;
   "scripts/logwatch/logfile.bacula.conf" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/logfile.bacula.conf" ;;
+  "scripts/wxconsole.console_apps" ) CONFIG_FILES="$CONFIG_FILES scripts/wxconsole.console_apps" ;;
+  "scripts/wxconsole.desktop.consolehelper" ) CONFIG_FILES="$CONFIG_FILES scripts/wxconsole.desktop.consolehelper" ;;
+  "scripts/wxconsole.desktop.xsu" ) CONFIG_FILES="$CONFIG_FILES scripts/wxconsole.desktop.xsu" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
   "src/host.h" ) CONFIG_FILES="$CONFIG_FILES src/host.h" ;;
   "src/console/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/console/Makefile" ;;
index ff92632a4e4e09af5624d262e0a2364c2c0aacff..a6367f4e89b7356043cfdfc8b7f2dbc11d60872b 100644 (file)
@@ -137,6 +137,11 @@ exit 1
 # specifically disallow gconsole if desired
 %{?nobuild_gconsole:%define gconsole 0}
 
+# Should we build wxconsole, only wxWidgets >=2.6 is supported
+# currently only SuSE 10 and FC4
+%define wxconsole 0
+%{?build_wxconsole:%define wxconsole 1}
+
 Summary: Bacula - The Network Backup Solution
 Name: bacula
 Version: @VERSION@
@@ -295,6 +300,10 @@ BuildRequires: rh-postgresql-devel >= 7
 BuildRequires: postgresql-devel >= 7
 %endif
 
+%if %{wxconsole}
+BuildRequires: wxGTK-devel >= 2.6
+%endif
+
 %description
 Bacula - It comes by night and sucks the vital essence from your computers.
 
@@ -594,6 +603,37 @@ This is the Gnome Console package. It is an add-on to the client or
 server packages.
 %endif
 
+%if %{wxconsole}
+%package wxconsole
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+Requires: wxGTK >= 2.6, libstdc++, openssl
+%endif
+
+%if %{wxconsole} && %{su10}
+Requires: gtk2 >= 2.8
+%endif
+
+%if %{wxconsole} && %{fc4}  
+Requires: gtk2 >= 2.6
+%endif
+
+%if %{wxconsole}
+%description wxconsole
+Bacula - It comes by night and sucks the vital essence from your computers.
+
+Bacula is a set of computer programs that permit you (or the system 
+administrator) to manage backup, recovery, and verification of computer 
+data across a network of computers of different kinds. In technical terms, 
+it is a network client/server based backup program. Bacula is relatively 
+easy to use and efficient, while offering many advanced storage management 
+features that make it easy to find and recover lost or damaged files. 
+Bacula source code has been released under the GPL version 2 license.
+
+This is the WXWindows Console package. It is an add-on to the client or
+server packages.
+%endif
+
 %prep
 
 %setup
@@ -682,6 +722,9 @@ make
 %endif
 %if %{postgresql}
         --with-postgresql \
+%endif
+%if %{wxconsole}
+       --enable-wx-console \
 %endif
         --with-working-dir=%{working_dir} \
         --with-pid-dir=/var/run \
@@ -795,6 +838,10 @@ cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/b
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
+%if %{wxconsole} && %{su10}
+cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
+cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
+%endif
 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
 %define iftrick 1
 %else
@@ -811,6 +858,13 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
+%if %{wxconsole} && %{iftrick}
+cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
+cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
+cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
+cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
+ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
+%endif
 
 # install sqlite
 %if %{sqlite}
@@ -845,6 +899,11 @@ touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
 rm -f src/filed/static-bacula-fd
 
+%if %{wxconsole}
+mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
+mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
+%endif
+
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
@@ -1317,7 +1376,56 @@ if [ -d /etc/bacula ]; then
 fi
 %endif
 
+%if %{wxconsole}
+%files wxconsole
+%defattr(-,root,root)
+/usr/sbin/wxconsole
+%attr(-, root, %{daemon_group}) %dir /etc/bacula
+%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
+/usr/share/pixmaps/wxwin16x16.xpm
+%endif
+
+%if %{wxconsole}
+/usr/share/applications/wxconsole.desktop
+%endif
+
+%if %{wxconsole} && ! %{su9} && ! %{su10}
+# add the console helper files
+%config(noreplace,missingok) /etc/pam.d/wxconsole
+%config(noreplace,missingok) /etc/security/console.apps/wxconsole
+/usr/bin/wxconsole
+%endif
+
+%if %{wxconsole}
+%pre wxconsole
+# create the daemon group
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+        echo "The group %{daemon_group} has been added to %{group_file}."
+        echo "See the manual chapter \"Running Bacula\" for details."
+fi
+
+%post wxconsole
+# generate passwords if needed
+if [ -d /etc/bacula ]; then
+        cd /etc/bacula
+        for file in *.conf; do
+                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
+                        need_password=`grep $string $file 2>/dev/null`
+                        if [ -n "$need_password" ]; then
+                                pass=`openssl rand -base64 33`
+                                sed "s-$string-$pass-g" $file > $file.new
+                                cp -f $file.new $file; rm -f $file.new
+                        fi
+                done
+        done
+fi
+%endif
+
 %changelog
+* Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add wxconsole package
 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - 1.38.8 release
 - dependency update for Mandriva
index ff92632a4e4e09af5624d262e0a2364c2c0aacff..a6367f4e89b7356043cfdfc8b7f2dbc11d60872b 100644 (file)
@@ -137,6 +137,11 @@ exit 1
 # specifically disallow gconsole if desired
 %{?nobuild_gconsole:%define gconsole 0}
 
+# Should we build wxconsole, only wxWidgets >=2.6 is supported
+# currently only SuSE 10 and FC4
+%define wxconsole 0
+%{?build_wxconsole:%define wxconsole 1}
+
 Summary: Bacula - The Network Backup Solution
 Name: bacula
 Version: @VERSION@
@@ -295,6 +300,10 @@ BuildRequires: rh-postgresql-devel >= 7
 BuildRequires: postgresql-devel >= 7
 %endif
 
+%if %{wxconsole}
+BuildRequires: wxGTK-devel >= 2.6
+%endif
+
 %description
 Bacula - It comes by night and sucks the vital essence from your computers.
 
@@ -594,6 +603,37 @@ This is the Gnome Console package. It is an add-on to the client or
 server packages.
 %endif
 
+%if %{wxconsole}
+%package wxconsole
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+Requires: wxGTK >= 2.6, libstdc++, openssl
+%endif
+
+%if %{wxconsole} && %{su10}
+Requires: gtk2 >= 2.8
+%endif
+
+%if %{wxconsole} && %{fc4}  
+Requires: gtk2 >= 2.6
+%endif
+
+%if %{wxconsole}
+%description wxconsole
+Bacula - It comes by night and sucks the vital essence from your computers.
+
+Bacula is a set of computer programs that permit you (or the system 
+administrator) to manage backup, recovery, and verification of computer 
+data across a network of computers of different kinds. In technical terms, 
+it is a network client/server based backup program. Bacula is relatively 
+easy to use and efficient, while offering many advanced storage management 
+features that make it easy to find and recover lost or damaged files. 
+Bacula source code has been released under the GPL version 2 license.
+
+This is the WXWindows Console package. It is an add-on to the client or
+server packages.
+%endif
+
 %prep
 
 %setup
@@ -682,6 +722,9 @@ make
 %endif
 %if %{postgresql}
         --with-postgresql \
+%endif
+%if %{wxconsole}
+       --enable-wx-console \
 %endif
         --with-working-dir=%{working_dir} \
         --with-pid-dir=/var/run \
@@ -795,6 +838,10 @@ cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/b
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
+%if %{wxconsole} && %{su10}
+cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
+cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
+%endif
 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
 %define iftrick 1
 %else
@@ -811,6 +858,13 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
+%if %{wxconsole} && %{iftrick}
+cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
+cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
+cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
+cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
+ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
+%endif
 
 # install sqlite
 %if %{sqlite}
@@ -845,6 +899,11 @@ touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
 rm -f src/filed/static-bacula-fd
 
+%if %{wxconsole}
+mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
+mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
+%endif
+
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
@@ -1317,7 +1376,56 @@ if [ -d /etc/bacula ]; then
 fi
 %endif
 
+%if %{wxconsole}
+%files wxconsole
+%defattr(-,root,root)
+/usr/sbin/wxconsole
+%attr(-, root, %{daemon_group}) %dir /etc/bacula
+%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
+/usr/share/pixmaps/wxwin16x16.xpm
+%endif
+
+%if %{wxconsole}
+/usr/share/applications/wxconsole.desktop
+%endif
+
+%if %{wxconsole} && ! %{su9} && ! %{su10}
+# add the console helper files
+%config(noreplace,missingok) /etc/pam.d/wxconsole
+%config(noreplace,missingok) /etc/security/console.apps/wxconsole
+/usr/bin/wxconsole
+%endif
+
+%if %{wxconsole}
+%pre wxconsole
+# create the daemon group
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+        echo "The group %{daemon_group} has been added to %{group_file}."
+        echo "See the manual chapter \"Running Bacula\" for details."
+fi
+
+%post wxconsole
+# generate passwords if needed
+if [ -d /etc/bacula ]; then
+        cd /etc/bacula
+        for file in *.conf; do
+                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
+                        need_password=`grep $string $file 2>/dev/null`
+                        if [ -n "$need_password" ]; then
+                                pass=`openssl rand -base64 33`
+                                sed "s-$string-$pass-g" $file > $file.new
+                                cp -f $file.new $file; rm -f $file.new
+                        fi
+                done
+        done
+fi
+%endif
+
 %changelog
+* Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add wxconsole package
 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - 1.38.8 release
 - dependency update for Mandriva
index ff92632a4e4e09af5624d262e0a2364c2c0aacff..a6367f4e89b7356043cfdfc8b7f2dbc11d60872b 100644 (file)
@@ -137,6 +137,11 @@ exit 1
 # specifically disallow gconsole if desired
 %{?nobuild_gconsole:%define gconsole 0}
 
+# Should we build wxconsole, only wxWidgets >=2.6 is supported
+# currently only SuSE 10 and FC4
+%define wxconsole 0
+%{?build_wxconsole:%define wxconsole 1}
+
 Summary: Bacula - The Network Backup Solution
 Name: bacula
 Version: @VERSION@
@@ -295,6 +300,10 @@ BuildRequires: rh-postgresql-devel >= 7
 BuildRequires: postgresql-devel >= 7
 %endif
 
+%if %{wxconsole}
+BuildRequires: wxGTK-devel >= 2.6
+%endif
+
 %description
 Bacula - It comes by night and sucks the vital essence from your computers.
 
@@ -594,6 +603,37 @@ This is the Gnome Console package. It is an add-on to the client or
 server packages.
 %endif
 
+%if %{wxconsole}
+%package wxconsole
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+Requires: wxGTK >= 2.6, libstdc++, openssl
+%endif
+
+%if %{wxconsole} && %{su10}
+Requires: gtk2 >= 2.8
+%endif
+
+%if %{wxconsole} && %{fc4}  
+Requires: gtk2 >= 2.6
+%endif
+
+%if %{wxconsole}
+%description wxconsole
+Bacula - It comes by night and sucks the vital essence from your computers.
+
+Bacula is a set of computer programs that permit you (or the system 
+administrator) to manage backup, recovery, and verification of computer 
+data across a network of computers of different kinds. In technical terms, 
+it is a network client/server based backup program. Bacula is relatively 
+easy to use and efficient, while offering many advanced storage management 
+features that make it easy to find and recover lost or damaged files. 
+Bacula source code has been released under the GPL version 2 license.
+
+This is the WXWindows Console package. It is an add-on to the client or
+server packages.
+%endif
+
 %prep
 
 %setup
@@ -682,6 +722,9 @@ make
 %endif
 %if %{postgresql}
         --with-postgresql \
+%endif
+%if %{wxconsole}
+       --enable-wx-console \
 %endif
         --with-working-dir=%{working_dir} \
         --with-pid-dir=/var/run \
@@ -795,6 +838,10 @@ cp -p scripts/bacula.desktop.gnome2.xsu $RPM_BUILD_ROOT/usr/share/applications/b
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
+%if %{wxconsole} && %{su10}
+cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
+cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
+%endif
 %if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{mdk}
 %define iftrick 1
 %else
@@ -811,6 +858,13 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
 cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
 cp -p scripts/bacula-tray-monitor.desktop $RPM_BUILD_ROOT/usr/share/applications/bacula-tray-monitor.desktop
 %endif
+%if %{wxconsole} && %{iftrick}
+cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
+cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
+cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
+cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
+ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
+%endif
 
 # install sqlite
 %if %{sqlite}
@@ -845,6 +899,11 @@ touch $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/rpm_release
 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT/etc/bacula/rescue/linux/cdrom/bacula/bin/bacula-fd
 rm -f src/filed/static-bacula-fd
 
+%if %{wxconsole}
+mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
+mv $RPM_BUILD_ROOT/etc/bacula/wx-console.conf $RPM_BUILD_ROOT/etc/bacula/wxconsole.conf
+%endif
+
 # now clean up permissions that are left broken by the install
 chmod o-r $RPM_BUILD_ROOT/etc/bacula/query.sql
 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
@@ -1317,7 +1376,56 @@ if [ -d /etc/bacula ]; then
 fi
 %endif
 
+%if %{wxconsole}
+%files wxconsole
+%defattr(-,root,root)
+/usr/sbin/wxconsole
+%attr(-, root, %{daemon_group}) %dir /etc/bacula
+%attr(-, root, %{daemon_group}) %config(noreplace) /etc/bacula/wxconsole.conf
+/usr/share/pixmaps/wxwin16x16.xpm
+%endif
+
+%if %{wxconsole}
+/usr/share/applications/wxconsole.desktop
+%endif
+
+%if %{wxconsole} && ! %{su9} && ! %{su10}
+# add the console helper files
+%config(noreplace,missingok) /etc/pam.d/wxconsole
+%config(noreplace,missingok) /etc/security/console.apps/wxconsole
+/usr/bin/wxconsole
+%endif
+
+%if %{wxconsole}
+%pre wxconsole
+# create the daemon group
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+        echo "The group %{daemon_group} has been added to %{group_file}."
+        echo "See the manual chapter \"Running Bacula\" for details."
+fi
+
+%post wxconsole
+# generate passwords if needed
+if [ -d /etc/bacula ]; then
+        cd /etc/bacula
+        for file in *.conf; do
+                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
+                        need_password=`grep $string $file 2>/dev/null`
+                        if [ -n "$need_password" ]; then
+                                pass=`openssl rand -base64 33`
+                                sed "s-$string-$pass-g" $file > $file.new
+                                cp -f $file.new $file; rm -f $file.new
+                        fi
+                done
+        done
+fi
+%endif
+
 %changelog
+* Sun Apr 16 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add wxconsole package
 * Fri Apr 14 2006 D. Scott Barninger <barninger@fairfieldcomputers.com>
 - 1.38.8 release
 - dependency update for Mandriva
diff --git a/bacula/scripts/wxconsole.console_apps.in b/bacula/scripts/wxconsole.console_apps.in
new file mode 100644 (file)
index 0000000..c0670ca
--- /dev/null
@@ -0,0 +1,3 @@
+USER=root
+PROGRAM=@sbindir@/wxconsole
+SESSION=true
diff --git a/bacula/scripts/wxconsole.desktop.consolehelper.in b/bacula/scripts/wxconsole.desktop.consolehelper.in
new file mode 100644 (file)
index 0000000..9000464
--- /dev/null
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Bacula WX Console
+Comment=Bacula Director Console
+Icon=/usr/share/pixmaps/wxwin16x16.xpm
+Exec=/usr/bin/wxconsole -c @sysconfdir@/wxconsole.conf
+Terminal=false
+Type=Application
+Encoding=UTF-8
+X-Desktop-File-Install-Version=0.3
+Categories=System;Application;Utility;X-Red-Hat-Base;
diff --git a/bacula/scripts/wxconsole.desktop.xsu.in b/bacula/scripts/wxconsole.desktop.xsu.in
new file mode 100644 (file)
index 0000000..a273b2d
--- /dev/null
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Bacula WX Console
+Comment=Bacula Director Console
+Icon=/usr/share/pixmaps/wxwin16x16.xpm
+Exec=gnomesu -t "Query" -c "@sbindir@/wxconsole -c @sysconfdir@/wxconsole.conf" -d -e -m "In order to run the bacula wx console as root, ^additional information is required."
+Terminal=false
+Type=Application
+Encoding=UTF-8
+X-Desktop-File-Install-Version=0.3
+Categories=System;Application;Utility;X-Red-Hat-Base;
diff --git a/bacula/scripts/wxconsole.pamd b/bacula/scripts/wxconsole.pamd
new file mode 100644 (file)
index 0000000..15cb90f
--- /dev/null
@@ -0,0 +1,7 @@
+#%PAM-1.0
+auth       sufficient   pam_rootok.so
+auth       sufficient   pam_timestamp.so
+auth       required     pam_stack.so service=system-auth
+session    optional     pam_xauth.so
+session    optional     pam_timestamp.so
+account    required     pam_permit.so