2016-12-05 14:00:26 +01:00
|
|
|
# RPM macros for packages installing a GTK+ IM module
|
|
|
|
#
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# When a package installs a GTK+ IM module, it should use all
|
|
|
|
# three macros:
|
|
|
|
#
|
|
|
|
# - %gtk4_immodule_requires in the preamble
|
|
|
|
# - %gtk4_immodule_post in %post
|
|
|
|
# - %gtk4_immodule_postun in %postun
|
|
|
|
#
|
|
|
|
###
|
|
|
|
|
|
|
|
%gtk4_immodule_requires \
|
2021-03-19 13:51:06 +01:00
|
|
|
Requires(post): glib2-tools \
|
|
|
|
Requires(postun): glib2-tools
|
2016-12-05 14:00:26 +01:00
|
|
|
|
|
|
|
# On install, update the cache
|
|
|
|
%gtk4_immodule_post \
|
2021-03-19 13:51:06 +01:00
|
|
|
if [[ -x %{_bindir}/gio-querymodules-64 ]]; then \
|
|
|
|
%{_bindir}/gio-querymodules-64 %{_libdir}/gtk-4.0/4.0.0/immodules \
|
|
|
|
else \
|
|
|
|
%{_bindir}/gio-querymodules %{_libdir}/gtk-4.0/4.0.0/immodules \
|
|
|
|
fi
|
2016-12-05 14:00:26 +01:00
|
|
|
|
|
|
|
# On uninstall, update the cache. Note: we ignore upgrades (already
|
|
|
|
# handled in %post of the new package).
|
2021-03-19 13:51:06 +01:00
|
|
|
%gtk4_immodule_postun \
|
2016-12-05 14:00:26 +01:00
|
|
|
if [ $1 -eq 0 ]; then \
|
2021-03-19 13:51:06 +01:00
|
|
|
if [[ -x %{_bindir}/gio-querymodules-64 ]]; then \
|
|
|
|
%{_bindir}/gio-querymodules-64 %{_libdir}/gtk-4.0/4.0.0/immodules \
|
|
|
|
else \
|
|
|
|
%{_bindir}/gio-querymodules %{_libdir}/gtk-4.0/4.0.0/immodules \
|
2021-10-05 14:28:30 +02:00
|
|
|
fi \
|
2016-12-05 14:00:26 +01:00
|
|
|
fi
|