1 |
# $Header: /magellan-cvs/mage/include/gnome2.minc,v 1.13 2008/04/10 21:56:38 niro Exp $ |
# $Id$ |
2 |
|
|
3 |
# shall we run scrollkeeper ? (per default no) |
# shall we run scrollkeeper ? (default no) |
4 |
: ${SCROLLKEEPER_UPDATE="0"} |
: ${SCROLLKEEPER_UPDATE="0"} |
5 |
|
|
6 |
|
# shall we export full pre|postinstall (default no, using minimal set) |
7 |
|
: ${GNOME_FULL_PROCESSOR_FUNCTIONS="0"} |
8 |
|
|
9 |
|
# required includes |
10 |
|
minclude glib2 gtk2 fdo-mime |
11 |
|
|
12 |
gn2_reload_gconf() |
gn2_reload_gconf() |
13 |
{ |
{ |
14 |
local pids |
local pids |
55 |
{ |
{ |
56 |
# than run scrollkeeper |
# than run scrollkeeper |
57 |
if [ -x ${MROOT}/usr/bin/scrollkeeper-update ] && |
if [ -x ${MROOT}/usr/bin/scrollkeeper-update ] && |
58 |
[[ ${SCROLLKEEPER_UPDATE} = 1 ]] |
[[ ${SCROLLKEEPER_UPDATE} = 1 ]] |
59 |
then |
then |
60 |
echo "Updating scrollkeeper ..." |
echo "Updating scrollkeeper ..." |
61 |
${MROOT}/usr/bin/scrollkeeper-update -q -p ${MROOT}/var/lib/scrollkeeper |
${MROOT}/usr/bin/scrollkeeper-update -q -p ${MROOT}/var/lib/scrollkeeper |
62 |
fi |
fi |
63 |
} |
} |
64 |
|
gn2_minimal_postinstall() |
|
gn2_update_desktop_db() |
|
|
{ |
|
|
# update desktop db |
|
|
if [ -x ${MROOT}/usr/bin/update-desktop-database ] |
|
|
then |
|
|
echo "Updating desktop mime database ..." |
|
|
${MROOT}/usr/bin/update-desktop-database -q ${MROOT}/usr/share/applications |
|
|
fi |
|
|
} |
|
|
|
|
|
gn2_update_mime_db() |
|
|
{ |
|
|
# update mime db |
|
|
if [ -x ${MROOT}/usr/bin/update-mime-database ] |
|
|
then |
|
|
echo "Updating shared mime info database ..." |
|
|
${MROOT}/usr/bin/update-mime-database ${MROOT}/usr/share/mime |
|
|
fi |
|
|
} |
|
|
|
|
|
gn2_update_icon_cache() |
|
|
{ |
|
|
local icons |
|
|
|
|
|
if [ -x ${MROOT}/usr/bin/gtk-update-icon-cache ] |
|
|
then |
|
|
if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/icons ] |
|
|
then |
|
|
echo "Searching icon directories ..." |
|
|
pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null |
|
|
icons=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null) |
|
|
popd &> /dev/null |
|
|
else |
|
|
icons="usr/share/icons/hicolor" |
|
|
fi |
|
|
|
|
|
# abort here, if no icons where found |
|
|
[[ -z ${icons} ]] && return |
|
|
|
|
|
echo "Updating icons cache ..." |
|
|
local i |
|
|
for i in ${icons} |
|
|
do |
|
|
if [[ -f ${MROOT}/${i}/index.theme ]] |
|
|
then |
|
|
${MROOT}/usr/bin/gtk-update-icon-cache -qf ${MROOT}/${i} |
|
|
fi |
|
|
done |
|
|
fi |
|
|
} |
|
|
|
|
|
gn2_update_schemas() |
|
65 |
{ |
{ |
66 |
if [ -x ${MROOT}/usr/bin/glib-compile-schemas ] |
gn2_update_gconf |
67 |
then |
gn2_update_scrollkeeper |
|
echo "Updating glib schemas ..." |
|
|
${MROOT}/usr/bin/glib-compile-schemas ${MROOT}/usr/share/glib-2.0/schemas |
|
|
fi |
|
68 |
} |
} |
69 |
|
|
70 |
gn2_update_gio() |
gn2_minimal_postremove() |
71 |
{ |
{ |
72 |
if [ -x ${MROOT}/usr/bin/gio-querymodules ] |
gn2_update_scrollkeeper |
|
then |
|
|
echo "Updating glib gio modules ..." |
|
|
${MROOT}/usr/bin/gio-querymodules ${MROOT}/usr/$(mlibdir)/gio/modules |
|
|
fi |
|
73 |
} |
} |
74 |
|
|
75 |
gn2_postinstall() |
gn2_postinstall() |
76 |
{ |
{ |
77 |
gn2_update_gconf |
gn2_update_gconf |
78 |
gn2_update_scrollkeeper |
gn2_update_scrollkeeper |
79 |
gn2_update_schemas |
glib2_update_schemas |
80 |
gn2_update_gio |
glib2_update_gio |
81 |
gn2_update_desktop_db |
fdo-mime_update_desktop_db |
82 |
gn2_update_mime_db |
fdo-mime_update_mime_db |
83 |
gn2_update_icon_cache |
gtk2_update_icon_cache |
84 |
} |
} |
85 |
|
|
86 |
gn2_postremove() |
gn2_postremove() |
87 |
{ |
{ |
88 |
gn2_update_scrollkeeper |
gn2_update_scrollkeeper |
89 |
gn2_update_schemas |
glib2_update_schemas |
90 |
gn2_update_gio |
glib2_update_gio |
91 |
gn2_update_desktop_db |
fdo-mime_update_desktop_db |
92 |
gn2_update_mime_db |
fdo-mime_update_mime_db |
93 |
gn2_update_icon_cache |
gtk2_update_icon_cache |
94 |
} |
} |
95 |
|
|
96 |
export_inherits gn2 postinstall postremove |
if [[ ${GNOME_FULL_PROCESSOR_FUNCTIONS} = 1 ]] |
97 |
|
then |
98 |
|
export_inherits gn2 postinstall postremove |
99 |
|
else |
100 |
|
export_inherits gn2_minimal postinstall postremove |
101 |
|
fi |