glib2/macros.glib2
Vincent Untz ddb18ca885 Accepting request 43774 from home:vuntz:branches:GNOME:Factory
Copy from home:vuntz:branches:GNOME:Factory/glib2 via accept of submit request 43774 revision 11.
Request was accepted with message:
auto-approving myself, to make it easier for the next batch of reviews

OBS-URL: https://build.opensuse.org/request/show/43774
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/glib2?expand=0&rev=85
2010-07-22 21:42:32 +00:00

53 lines
2.1 KiB
Plaintext

# 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