glib2/macros.glib2

53 lines
2.1 KiB
Plaintext
Raw Normal View History

# RPM macros for packages installing a GSettings schema or GIO module
#
# When a package installs a GSettings schemas, it should use all
# three macros:
#
# - %glib2_gsettings_schema_requires in the preamble
# - %glib2_gsettings_schema_post in %post
# - %glib2_gsettings_schema_postun in %postun
#
# When a package installs a GIO module, it should use all
# three macros:
#
# - %glib2_gio_module_requires in the preamble
# - %glib2_gio_module_post in %post
# - %glib2_gio_module_postun in %postun
#
%glib2_gsettings_schema_requires \
Requires(post): glib2-tools \
Requires(postun): glib2-tools
%glib2_gsettings_schema_post \
%{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas
# Note: we ignore upgrades (already handled in %post of the new package).
%glib2_gsettings_schema_postun \
if [ $1 -eq 0 ]; then \
%{_bindir}/glib-compile-schemas %{_datadir}/glib-2.0/schemas \
fi
%glib2_gio_module_requires \
Requires(post): glib2-tools \
Requires(postun): glib2-tools
# On install, update the cache
%glib2_gio_module_post \
%if "%{_lib}" == "lib64" \
%{_bindir}/gio-querymodules-64 %{_libdir}/gio/modules \
%else \
%{_bindir}/gio-querymodules %{_libdir}/gio/modules \
%endif
# On uninstall, update the cache. Note: we ignore upgrades (already
# handled in %post of the new package).
%glib2_gio_module_postun \
if [ $1 -eq 0 ]; then \
%if "%_lib" == "lib64" \
%{_bindir}/gio-querymodules-64 %{_libdir}/gio/modules \
%else \
%{_bindir}/gio-querymodules %{_libdir}/gio/modules \
%endif \
fi