From: Scott Barninger Date: Sat, 17 Nov 2007 15:50:41 +0000 (+0000) Subject: Update to sqlite3. X-Git-Tag: Release-7.0.0~5385 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=abf37db9e39a5648d498350f0b1939212f09ffc0;p=bacula%2Fbacula Update to sqlite3. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5950 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/platforms/mandrake/bacula.spec.in b/bacula/platforms/mandrake/bacula.spec.in index be0145cca0..b0fc6d21c2 100644 --- a/bacula/platforms/mandrake/bacula.spec.in +++ b/bacula/platforms/mandrake/bacula.spec.in @@ -186,7 +186,7 @@ exit 1 %define db_backend mysql %endif %if %{sqlite} -%define db_backend sqlite +%define db_backend sqlite3 %endif %if %{postgresql} %define db_backend postgresql @@ -673,7 +673,7 @@ This build requires MySQL to be installed separately as the catalog database. This build requires PostgreSQL to be installed separately as the catalog database. %endif %if %{sqlite} -This build incorporates sqlite as the catalog database, statically compiled. +This build incorporates sqlite3 as the catalog database, statically compiled. %endif %if %{python} This build includes python scripting support. @@ -1138,7 +1138,7 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap" cwd=${PWD} cd %{depkgs} %if %{sqlite} -make sqlite +make sqlite3 %endif %if ! %{client_only} make mtx @@ -1151,17 +1151,19 @@ cd ${cwd} # patches for the bundled sqlite scripts # patch the make_sqlite_tables script for installation bindir -patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +#patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch # patch the create_sqlite_database script for installation bindir -# not necessary after 1.39.26 no longer references sqlite binary #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch +patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch # patch the make_catalog_backup script for installation bindir patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch # patch the update_sqlite_tables script for installation bindir -patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch +#patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch +patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch # patch the bacula-dir init script to remove sqlite service %if %{sqlite} && %{su9} @@ -1236,7 +1238,7 @@ make --with-mysql \ %endif %if %{sqlite} - --with-sqlite=${cwd}/%{depkgs}/sqlite \ + --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \ %endif %if %{postgresql} --with-postgresql \ @@ -1475,9 +1477,9 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat # install sqlite %if %{sqlite} -cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite -cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h -cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a +cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3 +cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h +cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a %endif # install the logrotate file @@ -1566,15 +1568,15 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %if %{sqlite} %files sqlite %defattr(-,root,root) -%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite_tables -%{sqlite_bindir}/libsqlite.a -%{sqlite_bindir}/sqlite.h -%{sqlite_bindir}/sqlite +%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database +%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables +%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables +%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables +%{sqlite_bindir}/libsqlite3.a +%{sqlite_bindir}/sqlite3.h +%{sqlite_bindir}/sqlite3 %endif %if %{postgresql} @@ -1668,8 +1670,8 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` %if %{sqlite} %pre sqlite # test for bacula database older than version 9 -if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then - DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1` +if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite* ];then + DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite* 2>/dev/null %{working_dir}/bacula.db | tail -n 1` %endif %if %{postgresql} @@ -1799,24 +1801,24 @@ fi %if %{sqlite} # test for an existing database if [ -s %{working_dir}/bacula.db ]; then - DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1` + DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1` # check to see if we need to upgrade a 1.38 or lower database if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then echo "This release requires an upgrade to your bacula database." echo "Backing up your current database..." - echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 + echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - %{script_dir}/update_sqlite_tables + %{script_dir}/update_sqlite3_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi else # create the database and tables echo "Hmm, doesn't look like you have an existing database." echo "Creating SQLite database..." - %{script_dir}/create_sqlite_database + %{script_dir}/create_sqlite3_database chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db echo "Creating the SQLite tables..." - %{script_dir}/make_sqlite_tables + %{script_dir}/make_sqlite3_tables fi %endif @@ -2142,6 +2144,8 @@ fi %endif %changelog +* Sat Nov 17 2007 D. Scott Barninger +- switch to sqlite3 * Sun Nov 11 2007 D. Scott Barninger - add new files required by rescue makefile * Sat Nov 10 2007 D. Scott Barninger diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index be0145cca0..b0fc6d21c2 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -186,7 +186,7 @@ exit 1 %define db_backend mysql %endif %if %{sqlite} -%define db_backend sqlite +%define db_backend sqlite3 %endif %if %{postgresql} %define db_backend postgresql @@ -673,7 +673,7 @@ This build requires MySQL to be installed separately as the catalog database. This build requires PostgreSQL to be installed separately as the catalog database. %endif %if %{sqlite} -This build incorporates sqlite as the catalog database, statically compiled. +This build incorporates sqlite3 as the catalog database, statically compiled. %endif %if %{python} This build includes python scripting support. @@ -1138,7 +1138,7 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap" cwd=${PWD} cd %{depkgs} %if %{sqlite} -make sqlite +make sqlite3 %endif %if ! %{client_only} make mtx @@ -1151,17 +1151,19 @@ cd ${cwd} # patches for the bundled sqlite scripts # patch the make_sqlite_tables script for installation bindir -patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +#patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch # patch the create_sqlite_database script for installation bindir -# not necessary after 1.39.26 no longer references sqlite binary #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch +patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch # patch the make_catalog_backup script for installation bindir patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch # patch the update_sqlite_tables script for installation bindir -patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch +#patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch +patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch # patch the bacula-dir init script to remove sqlite service %if %{sqlite} && %{su9} @@ -1236,7 +1238,7 @@ make --with-mysql \ %endif %if %{sqlite} - --with-sqlite=${cwd}/%{depkgs}/sqlite \ + --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \ %endif %if %{postgresql} --with-postgresql \ @@ -1475,9 +1477,9 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat # install sqlite %if %{sqlite} -cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite -cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h -cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a +cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3 +cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h +cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a %endif # install the logrotate file @@ -1566,15 +1568,15 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %if %{sqlite} %files sqlite %defattr(-,root,root) -%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite_tables -%{sqlite_bindir}/libsqlite.a -%{sqlite_bindir}/sqlite.h -%{sqlite_bindir}/sqlite +%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database +%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables +%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables +%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables +%{sqlite_bindir}/libsqlite3.a +%{sqlite_bindir}/sqlite3.h +%{sqlite_bindir}/sqlite3 %endif %if %{postgresql} @@ -1668,8 +1670,8 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` %if %{sqlite} %pre sqlite # test for bacula database older than version 9 -if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then - DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1` +if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite* ];then + DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite* 2>/dev/null %{working_dir}/bacula.db | tail -n 1` %endif %if %{postgresql} @@ -1799,24 +1801,24 @@ fi %if %{sqlite} # test for an existing database if [ -s %{working_dir}/bacula.db ]; then - DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1` + DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1` # check to see if we need to upgrade a 1.38 or lower database if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then echo "This release requires an upgrade to your bacula database." echo "Backing up your current database..." - echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 + echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - %{script_dir}/update_sqlite_tables + %{script_dir}/update_sqlite3_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi else # create the database and tables echo "Hmm, doesn't look like you have an existing database." echo "Creating SQLite database..." - %{script_dir}/create_sqlite_database + %{script_dir}/create_sqlite3_database chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db echo "Creating the SQLite tables..." - %{script_dir}/make_sqlite_tables + %{script_dir}/make_sqlite3_tables fi %endif @@ -2142,6 +2144,8 @@ fi %endif %changelog +* Sat Nov 17 2007 D. Scott Barninger +- switch to sqlite3 * Sun Nov 11 2007 D. Scott Barninger - add new files required by rescue makefile * Sat Nov 10 2007 D. Scott Barninger diff --git a/bacula/platforms/suse/bacula.spec.in b/bacula/platforms/suse/bacula.spec.in index be0145cca0..b0fc6d21c2 100644 --- a/bacula/platforms/suse/bacula.spec.in +++ b/bacula/platforms/suse/bacula.spec.in @@ -186,7 +186,7 @@ exit 1 %define db_backend mysql %endif %if %{sqlite} -%define db_backend sqlite +%define db_backend sqlite3 %endif %if %{postgresql} %define db_backend postgresql @@ -673,7 +673,7 @@ This build requires MySQL to be installed separately as the catalog database. This build requires PostgreSQL to be installed separately as the catalog database. %endif %if %{sqlite} -This build incorporates sqlite as the catalog database, statically compiled. +This build incorporates sqlite3 as the catalog database, statically compiled. %endif %if %{python} This build includes python scripting support. @@ -1138,7 +1138,7 @@ export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap" cwd=${PWD} cd %{depkgs} %if %{sqlite} -make sqlite +make sqlite3 %endif %if ! %{client_only} make mtx @@ -1151,17 +1151,19 @@ cd ${cwd} # patches for the bundled sqlite scripts # patch the make_sqlite_tables script for installation bindir -patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +#patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch +patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch # patch the create_sqlite_database script for installation bindir -# not necessary after 1.39.26 no longer references sqlite binary #patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch +patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch # patch the make_catalog_backup script for installation bindir patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch # patch the update_sqlite_tables script for installation bindir -patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch +#patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch +patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch # patch the bacula-dir init script to remove sqlite service %if %{sqlite} && %{su9} @@ -1236,7 +1238,7 @@ make --with-mysql \ %endif %if %{sqlite} - --with-sqlite=${cwd}/%{depkgs}/sqlite \ + --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \ %endif %if %{postgresql} --with-postgresql \ @@ -1475,9 +1477,9 @@ ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat # install sqlite %if %{sqlite} -cp -p %{depkgs}/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite -cp -p %{depkgs}/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h -cp -p %{depkgs}/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a +cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3 +cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h +cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a %endif # install the logrotate file @@ -1566,15 +1568,15 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt %if %{sqlite} %files sqlite %defattr(-,root,root) -%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_database -%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite_privileges -%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite_tables -%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite_tables -%{sqlite_bindir}/libsqlite.a -%{sqlite_bindir}/sqlite.h -%{sqlite_bindir}/sqlite +%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database +%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database +%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges +%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables +%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables +%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables +%{sqlite_bindir}/libsqlite3.a +%{sqlite_bindir}/sqlite3.h +%{sqlite_bindir}/sqlite3 %endif %if %{postgresql} @@ -1668,8 +1670,8 @@ DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1` %if %{sqlite} %pre sqlite # test for bacula database older than version 9 -if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then - DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1` +if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite* ];then + DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite* 2>/dev/null %{working_dir}/bacula.db | tail -n 1` %endif %if %{postgresql} @@ -1799,24 +1801,24 @@ fi %if %{sqlite} # test for an existing database if [ -s %{working_dir}/bacula.db ]; then - DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite 2>/dev/null %{working_dir}/bacula.db | tail -n 1` + DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null %{working_dir}/bacula.db | tail -n 1` # check to see if we need to upgrade a 1.38 or lower database if [ "$DB_VER" -lt "10" ] && [ "$DB_VER" -ge "9" ]; then echo "This release requires an upgrade to your bacula database." echo "Backing up your current database..." - echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 + echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | bzip2 > %{working_dir}/bacula_backup.sql.bz2 echo "Upgrading bacula database ..." - %{script_dir}/update_sqlite_tables + %{script_dir}/update_sqlite3_tables echo "If bacula works correctly you can remove the backup file %{working_dir}/bacula_backup.sql.bz2" fi else # create the database and tables echo "Hmm, doesn't look like you have an existing database." echo "Creating SQLite database..." - %{script_dir}/create_sqlite_database + %{script_dir}/create_sqlite3_database chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db echo "Creating the SQLite tables..." - %{script_dir}/make_sqlite_tables + %{script_dir}/make_sqlite3_tables fi %endif @@ -2142,6 +2144,8 @@ fi %endif %changelog +* Sat Nov 17 2007 D. Scott Barninger +- switch to sqlite3 * Sun Nov 11 2007 D. Scott Barninger - add new files required by rescue makefile * Sat Nov 10 2007 D. Scott Barninger