1.1 --- a/jabberd/jabberd.spec Tue Jul 02 18:20:50 2013 +0200 1.2 +++ b/jabberd/jabberd.spec Tue Jul 02 18:21:58 2013 +0200 1.3 @@ -237,6 +237,7 @@ 1.4 1.5 # remove unnecessary files 1.6 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist 1.7 + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/jabberd-*.conf 1.8 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist 1.9 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a 1.10 1.11 @@ -261,8 +262,42 @@ 1.12 %clean 1.13 1.14 %post 1.15 + if [ $1 -eq 1 ]; then 1.16 + # print information describing initial population of database 1.17 + ( echo "Jabberd stores data in SQL and requires an existing" 1.18 + echo "local or remote installation of PostgreSQL, MySQL, or" 1.19 + echo "SQLite. Please refer to online documentation to carry" 1.20 + echo "out the SQL configuration, something like:" 1.21 + echo "" 1.22 +%if "%{with_sqlite}" == "yes" 1.23 + echo "$RPM_INSTALL_PREFIX/bin/sqlite $RPM_INSTALL_PREFIX/var/jabberd/db/sqlite.db < $RPM_INSTALL_PREFIX/share/jabberd/db-setup.sqlite" 1.24 +%endif 1.25 +%if "%{with_pgsql}" == "yes" 1.26 + echo "template1=> \i $RPM_INSTALL_PREFIX/share/jabberd/db-setup.pgsql" 1.27 +%endif 1.28 +%if "%{with_mysql}" == "yes" 1.29 + echo "mysql> \. $RPM_INSTALL_PREFIX/share/jabberd/db-setup.mysql" 1.30 +%endif 1.31 + ) | %{l_rpmtool} msg -b -t notice 1.32 + fi 1.33 + [ $1 -eq 2 ] || exit 0 1.34 + # print information describing initial population of database 1.35 + ( echo "The jabberd installation is being upgraded. It may be" 1.36 + echo "necessary to upgrade the database structures as well." 1.37 + echo "To carry this out please refer to online documentation" 1.38 + echo "regarding the SQL configuration, something like:" 1.39 + echo "" 1.40 +%if "%{with_sqlite}" == "yes" 1.41 + echo "$RPM_INSTALL_PREFIX/bin/sqlite $RPM_INSTALL_PREFIX/var/jabberd/db/sqlite.db < $RPM_INSTALL_PREFIX/share/jabberd/db-update.sqlite" 1.42 +%endif 1.43 +%if "%{with_pgsql}" == "yes" 1.44 + echo "template1=> \i $RPM_INSTALL_PREFIX/share/jabberd/db-update.pgsql" 1.45 +%endif 1.46 +%if "%{with_mysql}" == "yes" 1.47 + echo "mysql> \. $RPM_INSTALL_PREFIX/share/jabberd/db-update.mysql" 1.48 +%endif 1.49 + ) | %{l_rpmtool} msg -b -t notice 1.50 # after upgrade, restart service 1.51 - [ $1 -eq 2 ] || exit 0 1.52 eval `%{l_rc} jabberd status 2>/dev/null` 1.53 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart 1.54 exit 0