summaryrefslogtreecommitdiff
path: root/network/yate/doinst.sh
diff options
context:
space:
mode:
authorMichales Michaloudes <korgie@gmail.com>2013-06-30 00:00:18 -0500
committerErik Hanson <erik@slackbuilds.org>2013-06-30 00:16:38 -0500
commit69646a8cc504ff506d5be8d7a150d5163fd53d08 (patch)
treed834b17f58184a6a35e61984e718c4289a25d46e /network/yate/doinst.sh
parent7c675a86a64b9ea6159cc32eac6e91fbd0a6faae (diff)
downloadslackbuilds-69646a8cc504ff506d5be8d7a150d5163fd53d08.tar.gz
network/yate: Added (Yet Another Telephony Engine)
Signed-off-by: Erik Hanson <erik@slackbuilds.org>
Diffstat (limited to 'network/yate/doinst.sh')
-rw-r--r--network/yate/doinst.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/network/yate/doinst.sh b/network/yate/doinst.sh
new file mode 100644
index 0000000000..cb44d46a56
--- /dev/null
+++ b/network/yate/doinst.sh
@@ -0,0 +1,50 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+schema_install() {
+ SCHEMA="$1"
+ GCONF_CONFIG_SOURCE="xml::etc/gconf/gconf.xml.defaults" \
+ chroot . gconftool-2 --makefile-install-rule \
+ /etc/gconf/schemas/$SCHEMA \
+ 1>/dev/null
+}
+
+schema_install blah.schemas
+preserve_perms etc/rc.d/rc.INIT.new
+config etc/configfile.new
+
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -x /usr/bin/update-mime-database ]; then
+ /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
+