2010-08-27 17:14:50 +02:00
|
|
|
# RPM macros for packages installing a GTK+ IM module
|
|
|
|
#
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# When a package installs a GTK+ IM module, it should use all
|
|
|
|
# three macros:
|
|
|
|
#
|
|
|
|
# - %gtk2_immodule_requires in the preamble
|
|
|
|
# - %gtk2_immodule_post in %post
|
|
|
|
# - %gtk2_immodule_postun in %postun
|
|
|
|
#
|
|
|
|
###
|
|
|
|
|
2010-10-15 12:46:12 +02:00
|
|
|
%gtk2_immodule_requires \
|
|
|
|
Requires(post): gtk2 \
|
2010-08-27 17:14:50 +02:00
|
|
|
Requires(postun): gtk2
|
|
|
|
|
|
|
|
# On install, update the cache
|
2010-10-15 12:46:12 +02:00
|
|
|
%gtk2_immodule_post \
|
|
|
|
%if "%_lib" == "lib64" \
|
|
|
|
%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules \
|
|
|
|
%else \
|
|
|
|
%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules \
|
2010-08-27 17:14:50 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
# On uninstall, update the cache. Note: we ignore upgrades (already
|
|
|
|
# handled in %post of the new package).
|
2010-10-15 12:46:12 +02:00
|
|
|
%gtk2_immodule_postun \
|
|
|
|
if [ $1 -eq 0 ]; then \
|
|
|
|
%if "%_lib" == "lib64" \
|
|
|
|
%{_bindir}/gtk-query-immodules-2.0-64 > %{_sysconfdir}/gtk-2.0/gtk64.immodules \
|
|
|
|
%else \
|
|
|
|
%{_bindir}/gtk-query-immodules-2.0 > %{_sysconfdir}/gtk-2.0/gtk.immodules \
|
|
|
|
%endif \
|
2010-08-27 17:14:50 +02:00
|
|
|
fi
|