summaryrefslogtreecommitdiffstats
path: root/libraries/libinstpatch/doinst.sh
diff options
context:
space:
mode:
author Michales Michaloudes2011-08-02 13:54:49 +0200
committer Niels Horn2011-08-02 13:54:49 +0200
commit0f664d787dae81172b4548e61b3bf45c137bd61c (patch)
tree67dcb2c617ef21145a2b5d4abb6b0bea7c65637c /libraries/libinstpatch/doinst.sh
parentb7af29bae74b9eed1c39e93f084ba26fd147dfcd (diff)
downloadslackbuilds-0f664d787dae81172b4548e61b3bf45c137bd61c.tar.gz
libraries/libinstpatch: Added (digital sample processing library)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'libraries/libinstpatch/doinst.sh')
-rw-r--r--libraries/libinstpatch/doinst.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/libraries/libinstpatch/doinst.sh b/libraries/libinstpatch/doinst.sh
new file mode 100644
index 0000000000..cb44d46a56
--- /dev/null
+++ b/libraries/libinstpatch/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
+