235 # strip installation |
235 # strip installation |
236 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
236 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
237 |
237 |
238 # remove unnecessary files |
238 # remove unnecessary files |
239 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist |
239 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist |
|
240 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/jabberd-*.conf |
240 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist |
241 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist |
241 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a |
242 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a |
242 |
243 |
243 # install runcommand script |
244 # install runcommand script |
244 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
245 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
259 %files -f files |
260 %files -f files |
260 |
261 |
261 %clean |
262 %clean |
262 |
263 |
263 %post |
264 %post |
|
265 if [ $1 -eq 1 ]; then |
|
266 # print information describing initial population of database |
|
267 ( echo "Jabberd stores data in SQL and requires an existing" |
|
268 echo "local or remote installation of PostgreSQL, MySQL, or" |
|
269 echo "SQLite. Please refer to online documentation to carry" |
|
270 echo "out the SQL configuration, something like:" |
|
271 echo "" |
|
272 %if "%{with_sqlite}" == "yes" |
|
273 echo "$RPM_INSTALL_PREFIX/bin/sqlite $RPM_INSTALL_PREFIX/var/jabberd/db/sqlite.db < $RPM_INSTALL_PREFIX/share/jabberd/db-setup.sqlite" |
|
274 %endif |
|
275 %if "%{with_pgsql}" == "yes" |
|
276 echo "template1=> \i $RPM_INSTALL_PREFIX/share/jabberd/db-setup.pgsql" |
|
277 %endif |
|
278 %if "%{with_mysql}" == "yes" |
|
279 echo "mysql> \. $RPM_INSTALL_PREFIX/share/jabberd/db-setup.mysql" |
|
280 %endif |
|
281 ) | %{l_rpmtool} msg -b -t notice |
|
282 fi |
|
283 [ $1 -eq 2 ] || exit 0 |
|
284 # print information describing initial population of database |
|
285 ( echo "The jabberd installation is being upgraded. It may be" |
|
286 echo "necessary to upgrade the database structures as well." |
|
287 echo "To carry this out please refer to online documentation" |
|
288 echo "regarding the SQL configuration, something like:" |
|
289 echo "" |
|
290 %if "%{with_sqlite}" == "yes" |
|
291 echo "$RPM_INSTALL_PREFIX/bin/sqlite $RPM_INSTALL_PREFIX/var/jabberd/db/sqlite.db < $RPM_INSTALL_PREFIX/share/jabberd/db-update.sqlite" |
|
292 %endif |
|
293 %if "%{with_pgsql}" == "yes" |
|
294 echo "template1=> \i $RPM_INSTALL_PREFIX/share/jabberd/db-update.pgsql" |
|
295 %endif |
|
296 %if "%{with_mysql}" == "yes" |
|
297 echo "mysql> \. $RPM_INSTALL_PREFIX/share/jabberd/db-update.mysql" |
|
298 %endif |
|
299 ) | %{l_rpmtool} msg -b -t notice |
264 # after upgrade, restart service |
300 # after upgrade, restart service |
265 [ $1 -eq 2 ] || exit 0 |
|
266 eval `%{l_rc} jabberd status 2>/dev/null` |
301 eval `%{l_rc} jabberd status 2>/dev/null` |
267 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart |
302 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart |
268 exit 0 |
303 exit 0 |
269 |
304 |
270 %preun |
305 %preun |