Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=mate.git;a=commitdiff;h=80247db6c6fac95b7cdf9e9234f18d8e0ea5a053

commit 80247db6c6fac95b7cdf9e9234f18d8e0ea5a053
Author: Pingax <pin...@frugalware.fr>
Date:   Mon Oct 3 10:42:01 2011 +0200

* Added scripts for mate to make life easier

diff --git a/source/include/mate-scriptlet.install 
b/source/include/mate-scriptlet.install
new file mode 100644
index 0000000..eb48cf6
--- /dev/null
+++ b/source/include/mate-scriptlet.install
@@ -0,0 +1,114 @@
+schemas=($_F_mate_schemas)
+entries=($_F_mate_entries)
+
+UpdateDesktopDatabase()
+{
+       if [ -f /usr/bin/update-desktop-database ]
+       then
+               echo -n "updating desktop database..."
+               if update-desktop-database > /dev/null 2>&1 ; then
+                       echo " done."
+               else
+                       echo " failed."
+               fi
+       fi
+       if [ -f /usr/bin/update-desktop-database-3.0 ]
+       then
+               echo -n "updating desktop database gtk+3..."
+               if update-desktop-database > /dev/null 2>&1 ; then
+                       echo " done."
+               else
+                       echo " failed."
+               fi
+       fi
+}
+UpdateIconCache()
+{
+       if [ -f /usr/bin/gtk-update-icon-cache ]
+       then
+               echo -n "updating hicolor icon cache..."
+               if gtk-update-icon-cache -f -t /usr/share/icons/hicolor > 
/dev/null 2>&1 ; then
+                       echo " done."
+               else
+                       echo " failed."
+               fi
+       fi
+       if [ -f /usr/bin/gtk-update-icon-cache-3.0 ]
+       then
+               echo -n "updating hicolor icon cache gtk+3..."
+               if gtk-update-icon-cache-3.0 -f -t /usr/share/icons/hicolor > 
/dev/null 2>&1 ; then
+                       echo " done."
+               else
+                       echo " failed."
+               fi
+       fi
+}
+post_install()
+{
+       if [ ${#schemas[*]} -gt 0 ]; then
+               echo -n "installing mateconf schemas... "
+               for schema in "${schemas[@]}" ; do
+                       MATECONF_CONFIG_SOURCE=`/usr/bin/mateconftool-2 
--get-default-source` \
+                               /usr/bin/mateconftool-2 --makefile-install-rule 
"$schema" > /dev/null 2>&1
+               done
+               if [ -e /bin/pidof ]; then
+                       kill -HUP `pidof /usr/libexec/mconfd-2` > /dev/null 2>&1
+               fi
+               echo "done."
+       fi
+       if [ ${#entries[*]} -gt 0 ]; then
+               echo -n "loading mateconf entries... "
+               for entry in "${entries[@]}" ; do
+                       mateconftool-2 --direct 
--config-source=`/usr/bin/mateconftool-2 --get-default-source` --load $entry > 
/dev/null 2>&1
+               done
+               if [ -e /bin/pidof ]; then
+                       kill -HUP `pidof /usr/libexec/mateconfd-2` > /dev/null 
2>&1
+               fi
+               echo "done."
+       fi
+       if [ -n "$_F_mate_glib" ]; then
+               echo -n "loading schema glib entries... "
+               glib-compile-schemas /usr/share/glib-2.0/schemas
+               echo "done."
+       fi
+}
+
+
+post_upgrade()
+{
+       post_install $1
+}
+
+pre_remove() {
+       if [ -n "$_F_mate_glib" ]; then
+               echo -n "loading schema glib entries... "
+               glib-compile-schemas /usr/share/glib-2.0/schemas
+               echo "done."
+       fi
+       if [ ${#schemas[*]} -gt 0 ]; then
+               echo -n "updating mateconf schemas... "
+               for schema in "${schemas[@]}" ; do
+                       MATECONF_CONFIG_SOURCE=`/usr/bin/mateconftool-2 
--get-default-source` \
+                               /usr/bin/mateconftool-2 --makefile-install-rule 
"$schema" > /dev/null 2>&1
+               done
+               if [ -e /bin/pidof ]; then
+                       kill -HUP `pidof /usr/libexec/mateconfd-2` > /dev/null 
2>&1
+               fi
+               echo "done."
+       fi
+       if [ ${#entries[*]} -gt 0 ]; then
+               echo -n "unloading mateconf entries... "
+               for entry in "${entries[@]}" ; do
+                       mateconftool-2 --direct 
--config-source=`/usr/bin/mateconftool-2 --get-default-source` --unload $entry 
> /dev/null 2>&1
+               done
+               if [ -e /bin/pidof ]; then
+                       kill -HUP `pidof /usr/libexec/mateconfd-2` > /dev/null 
2>&1
+               fi
+               echo "done."
+       fi
+}
+
+op=$1
+shift
+
+$op $*
diff --git a/source/include/mate-scriptlet.sh b/source/include/mate-scriptlet.sh
new file mode 100644
index 0000000..5fa1ec4
--- /dev/null
+++ b/source/include/mate-scriptlet.sh
@@ -0,0 +1,131 @@
+#!/bin/sh
+
+###
+# = mate-scriptlet.sh(3)
+# Pingax <pin...@frugalware.fr>
+#
+# == NAME
+# mate-scriptlet.sh - for Frugalware
+#
+# == SYNOPSIS
+# Common schema for Mate packages using scriplets.
+#
+# == EXAMPLE
+# --------------------------------------------------
+# pkgname=mate-vfs
+# pkgver=2011.08.31
+# pkgrel=1
+# pkgdesc="The MATE Virtual File System"
+# url="http://matsusoft.com.ar/projects";
+# archs=('i686' 'x86_64')
+# depends=('mate-conf' 'avahi' 'libsmbclient' 'mate-mime-data')
+# makedepends=('intltool' 'mate-common')
+#_F_mate_schemas=('/etc/mateconf/schemas/desktop_default_applications.schemas' 
\
+#      '/etc/mateconf/schemas/desktop_mate_url_handlers.schemas' \
+#      '/etc/mateconf/schemas/system_dns_sd.schemas' \
+#      '/etc/mateconf/schemas/system_http_proxy.schemas' \
+#      '/etc/mateconf/schemas/system_smb.schemas')
+# up2date=$pkgver
+# 
source="http://netcologne.dl.sourceforge.net/project/matede/$pkgver/$pkgname.tar.gz";
+# _F_cd_path=$pkgname
+# Finclude mate-scriptlet
+# sha1sums=('781a7829de9f6511305bffaa9bc67f22aaaa9049')
+# --------------------------------------------------
+
+if [ -z "$_F_mate_scriptlet" ]; then
+       _F_mate_scriptlet="src/mate-scriptlet.install"
+fi
+
+if [ -n "$_F_mate_schemas" ]; then
+       Fconfopts="$Fconfopts --disable-schemas-install"
+fi
+if [ -n "$_F_mate_scrollkeeper" ]; then
+       Fconfopts="$Fconfopts --disable-scrollkeeper"
+fi
+if [ -n "$_F_mate_desktop" ]; then
+       Fconfopts="$Fconfopts --enable-desktop-update=no"
+fi
+if [ -n "$_F_mate_mime" ]; then
+       Fconfopts="$Fconfopts --disable-update-mimedb --enable-mime-update=no"
+fi
+
+###
+# == OVERWRITTEN VARIABLES
+# * install
+###
+install="$_F_mate_scriptlet"
+
+###
+# == APPENDED VARIABLES
+# * genscriptlet to options()
+###
+options=(${options[@]} 'genscriptlet')
+
+###
+# == PROVIDED FUNCTIONS
+# * Fbuild_slice_scrollkeeper() removes scrollkeeper-update from Makefile.in
+# and omf.make
+###
+Fbuild_slice_scrollkeeper()
+{
+       find . -name Makefile.in -exec sed -i -e 's/-scrollkeeper-update.*//' 
{} \;
+       if [ -f omf.make ]; then
+               sed -i -e 's/-scrollkeeper-update.*//' omf.make
+       fi
+}
+
+###
+# * Fbuild_mate_scriptlet() generates a scriptlet for the given package from
+# the template according to the declared options
+###
+Fbuild_mate_scriptlet()
+{
+       local i str
+
+       cp $Fincdir/mate-scriptlet.install $Fsrcdir
+       if [ -n "$_F_mate_schemas" ]; then
+               for i in "${_F_mate_schemas[@]}"
+               do
+                       if [ -z "$str" ]; then
+                               str="'$i'\n"
+                       else
+                               str="$str\t'$i'\n"
+                       fi
+               done
+       fi
+       Fsed '$_F_mate_schemas' "$str" ${Fsrcdir%/src}/$_F_mate_scriptlet
+       str=''
+       if [ -n "$_F_mate_entries" ]; then
+               for i in "${_F_mate_entries[@]}"
+               do
+                       if [ -z "$str" ]; then
+                               str="'$i'\n"
+                       else
+                               str="$str\t'$i'\n"
+                       fi
+               done
+       fi
+       Fsed '$_F_mate_entries' "$str" ${Fsrcdir%/src}/$_F_mate_scriptlet
+       Fsed '$_F_mate_glib' "$_F_mate_glib" ${Fsrcdir%/src}/$_F_mate_scriptlet
+       Fsed '$_F_mate_desktop' "$_F_mate_desktop" 
${Fsrcdir%/src}/$_F_mate_scriptlet
+       Fsed '$_F_mate_scrollkeeper' "$_F_mate_scrollkeeper" 
${Fsrcdir%/src}/$_F_mate_scriptlet
+       Fsed '$_F_mate_mime' "$_F_mate_mime" ${Fsrcdir%/src}/$_F_mate_scriptlet
+       Fsed '$_F_mate_iconcache' "$_F_mate_iconcache" 
${Fsrcdir%/src}/$_F_mate_scriptlet
+}
+
+###
+# * build() just includes Fbuild_slice_scrollkeeper and Fbuild_mate_scriptlet
+# in the default build() (and disables the schema installation on make install)
+###
+build()
+{
+       Fbuild_slice_scrollkeeper
+       Fpatchall
+       Fmake
+       if [ -n "$_F_mate_schemas" ]; then
+               Fmakeinstall MATECONF_DISABLE_SCHEMA_INSTALL=1
+       else
+               Fmakeinstall
+       fi
+       Fbuild_mate_scriptlet
+}
diff --git a/source/include/mate.sh b/source/include/mate.sh
new file mode 100644
index 0000000..a8b49ea
--- /dev/null
+++ b/source/include/mate.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+###
+# = mate.sh(3)
+# Anthony Jorion <pin...@frugalware.fr>
+#
+# == NAME
+# mate.sh - for Frugalware
+#
+# == SYNOPSIS
+# Common schema for MATE packages.
+#
+# == EXAMPLE
+# --------------------------------------------------
+# pkgname=mate-vfs
+# pkgver=2011.08.31
+# pkgrel=1
+# pkgdesc="The MATE Virtual File System"
+# url="http://matsusoft.com.ar/projects";
+# archs=('i686' 'x86_64')
+# depends=('mate-conf' 'avahi' 'libsmbclient' 'mate-mime-data')
+# makedepends=('intltool' 'mate-common')
+# Finclude mate
+# sha1sums=('781a7829de9f6511305bffaa9bc67f22aaaa9049')
+
+# --------------------------------------------------
+#
+
+###
+# == OVERWRITTEN VARIABLES
+# * up2date
+# * source()
+# * url
+###
+_F_gnome_name=$pkgname
+source="http://netcologne.dl.sourceforge.net/project/matede/$pkgver/$pkgname.tar.gz";
+up2date=$pkgver
+url="http://matsusoft.com.ar/projects";
+_F_cd_path=$_F_gnome_name
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to