# HG changeset patch # User Michael Schloh von Bennewitz # Date 1372782118 -7200 # Node ID de3379343a7c0395bd14f2e636112b5d50788e93 # Parent 25504c2d46b19444ffe36bda178702aef40196e2 Remove superfluous init scripts and introduce SQL population logic. diff -r 25504c2d46b1 -r de3379343a7c jabberd/jabberd.spec --- a/jabberd/jabberd.spec Tue Jul 02 18:20:50 2013 +0200 +++ b/jabberd/jabberd.spec Tue Jul 02 18:21:58 2013 +0200 @@ -237,6 +237,7 @@ # remove unnecessary files rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/jabberd-*.conf rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a @@ -261,8 +262,42 @@ %clean %post + if [ $1 -eq 1 ]; then + # print information describing initial population of database + ( echo "Jabberd stores data in SQL and requires an existing" + echo "local or remote installation of PostgreSQL, MySQL, or" + echo "SQLite. Please refer to online documentation to carry" + echo "out the SQL configuration, something like:" + echo "" +%if "%{with_sqlite}" == "yes" + echo "$RPM_INSTALL_PREFIX/bin/sqlite $RPM_INSTALL_PREFIX/var/jabberd/db/sqlite.db < $RPM_INSTALL_PREFIX/share/jabberd/db-setup.sqlite" +%endif +%if "%{with_pgsql}" == "yes" + echo "template1=> \i $RPM_INSTALL_PREFIX/share/jabberd/db-setup.pgsql" +%endif +%if "%{with_mysql}" == "yes" + echo "mysql> \. $RPM_INSTALL_PREFIX/share/jabberd/db-setup.mysql" +%endif + ) | %{l_rpmtool} msg -b -t notice + fi + [ $1 -eq 2 ] || exit 0 + # print information describing initial population of database + ( echo "The jabberd installation is being upgraded. It may be" + echo "necessary to upgrade the database structures as well." + echo "To carry this out please refer to online documentation" + echo "regarding the SQL configuration, something like:" + echo "" +%if "%{with_sqlite}" == "yes" + echo "$RPM_INSTALL_PREFIX/bin/sqlite $RPM_INSTALL_PREFIX/var/jabberd/db/sqlite.db < $RPM_INSTALL_PREFIX/share/jabberd/db-update.sqlite" +%endif +%if "%{with_pgsql}" == "yes" + echo "template1=> \i $RPM_INSTALL_PREFIX/share/jabberd/db-update.pgsql" +%endif +%if "%{with_mysql}" == "yes" + echo "mysql> \. $RPM_INSTALL_PREFIX/share/jabberd/db-update.mysql" +%endif + ) | %{l_rpmtool} msg -b -t notice # after upgrade, restart service - [ $1 -eq 2 ] || exit 0 eval `%{l_rc} jabberd status 2>/dev/null` [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart exit 0