From 1ee9040e059a9e902388324f6fb853c24590226c Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Fri, 16 Jun 2006 13:58:05 +0000 Subject: Add new macros --- macros.in | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/macros.in b/macros.in index 7f2dd7d..b317282 100644 --- a/macros.in +++ b/macros.in @@ -45,6 +45,13 @@ # Update Menu %_update_menus_bin %{_bindir}/update-menus +# Various programs used in rpm scripts +%_update_desktop_database_bin %{_bindir}/update-desktop-database +%_update_mime_database_bin %{_bindir}/update-mime-database +%_update_icon_cache_bin %{_bindir}/gtk-update-icon-cache +%_gconftool_bin %{_bindir}/gconftool-2 +%_scrollkeeper_bin %{_bindir}/scrollkeeper-update + %__service /sbin/service %__chkconfig /sbin/chkconfig @@ -169,6 +176,49 @@ %clean_gcjdb if [ -x %{_rebuildgcjdb_bin} ]; then %{_rebuildgcjdb_bin} || true ; fi \ %{nil} +# Rebuild .desktop / MIME mapping database +%update_desktop_database if [ -x %{_update_desktop_database_bin} ]; then \ +%{_update_desktop_database_bin} %{_datadir}/applications > /dev/null || \ +true ; fi \ +%{nil} + +%clean_desktop_database if [ "$1" = "0" -a -x %{_update_desktop_database_bin} ]; then \ +%{_update_desktop_database_bin} %{_datadir}/applications > /dev/null || true ; fi \ +%{nil} + +# Rebuild freedesktop.org MIME magic/extension database +%update_mime_database if [ -x %{_update_mime_database_bin} ]; then \ +%{_update_mime_database_bin} %{_datadir}/mime > /dev/null || true ; fi \ +%{nil} + +%clean_mime_database if [ "$1" = "0" -a -x %{_update_mime_database_bin} ]; \ +then %{_update_mime_database_bin} %{_datadir}/mime > /dev/null || true ; fi \ +%{nil} + +# Rebuild icon cache +%update_icon_cache() if [ -x %{_update_icon_cache_bin} ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true; fi \ +%{nil} + +%clean_icon_cache() if [ "$1" = "0" -a -x %{_update_icon_cache_bin} ]; then \ +%{_update_icon_cache_bin} --force --quiet %{_iconsdir}/%{1} || true ; fi \ +%{nil} + +# Install GConf schemas +%post_install_gconf_schemas() if [ -x %{_gconftool_bin} ]; then \ +export GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` && \ +for SCHEMA in %{*} ; do \ + %{_gconftool_bin} --makefile-install-rule %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas > /dev/null || true \ +done ; fi \ +%{nil} + +%preun_uninstall_gconf_schemas() if [ "$1" = "0" -a -x %{_gconftool_bin} ]; then \ +export GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` && \ +for SCHEMA in %{*} ; do \ + %{_gconftool_bin} --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/$SCHEMA.schemas > /dev/null || true \ +done ; fi \ +%{nil} + # From rpm-helper %_create_ghostfile_helper /usr/share/rpm-helper/create-file -- cgit v1.2.1