aboutsummaryrefslogtreecommitdiff
path: root/libs/libsafe/doinst64.sh
diff options
context:
space:
mode:
authorrudson <rudson@370017ae-e619-0410-ac65-c121f96126d4>2006-11-15 20:06:03 +0000
committerrudson <rudson@370017ae-e619-0410-ac65-c121f96126d4>2006-11-15 20:06:03 +0000
commit597c153e31f8c662e4f915da2ea301eab9896c03 (patch)
treef6a53a57a889f36a44f7c69203e14c2b17fd960e /libs/libsafe/doinst64.sh
parenta8b553c51989c307f7aadb04ab73a7164ac0259b (diff)
downloadslackbuilds-597c153e31f8c662e4f915da2ea301eab9896c03.tar.gz
slackbuilds-597c153e31f8c662e4f915da2ea301eab9896c03.tar.bz2
movendo libs...
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@647 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'libs/libsafe/doinst64.sh')
-rw-r--r--libs/libsafe/doinst64.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/libs/libsafe/doinst64.sh b/libs/libsafe/doinst64.sh
new file mode 100644
index 00000000..a5d753a9
--- /dev/null
+++ b/libs/libsafe/doinst64.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# libmove sourcelib targetlib
+#
+# This allows you to move a new shared library into place,
+# even on a running system.
+libmove() {
+ LIBSOURCE=$1
+ LIBTARGET=$2
+ LIBFOO="`dirname $LIBTARGET`/libfoo.so.0.0.0"
+ # link duplicate of target lib so we can safely copy over it:
+ if [ -r $LIBTARGET ]; then
+ cp -a $LIBTARGET $LIBFOO
+ if [ -x /sbin/ldconfig ]; then
+ ldconfig -l $LIBFOO 2> /dev/null
+ fi
+ fi
+ mv $LIBSOURCE $LIBTARGET
+ if [ -x /sbin/ldconfig ]; then
+ ldconfig -l $LIBTARGET 2> /dev/null
+ fi
+ rm -f $LIBFOO
+}
+
+# Before using libmove, try to install everything we can:
+( cd lib64/incoming
+ for file in * ; do
+ if [ ! -r ../$file ]; then
+ cp -a $file ..
+ fi
+ done )
+# Prepare the library for use with ldconfig:
+if [ -x sbin/ldconfig ]; then
+ chroot . /sbin/ldconfig
+fi
+
+( cd lib64/incoming
+ for file in * ; do
+ libmove $file ../$file
+ done )
+#### Now, get rid of the temporary directory:
+rm -rf lib64/incoming
+
+# add the library to /etc/ld.so.preload:
+if fgrep libsafe.so.2 etc/ld.so.preload 1> /dev/null 2> /dev/null ; then
+ GOOD=we_found_it
+else
+ echo "/lib64/libsafe.so.2" >> etc/ld.so.preload
+fi
+
+# Prepare the library for use with ldconfig:
+if [ -x sbin/ldconfig ]; then
+ chroot . /sbin/ldconfig
+else # In case there's no ldconfig, make the links manually:
+ ( cd lib64 ; rm -rf libsafe.so.2 )
+ ( cd lib64 ; ln -sf libsafe.so.2.0.9 libsafe.so.2 )
+fi