#!/bin/sh usage () { echo "`basename $0`: post-process a shared library" echo "Usage: `basename $0` FILENAME" } # assert that we have one argument on the command line if [ $# != 1 ]; then usage exit 1 fi # set the context for the library on Security Enhanced Linux if chcon --version >/dev/null 2>/dev/null ; then chcon -t textrel_shlib_t >/dev/null 2>/dev/null $1 fi # the install name must be absolute on Mac OS X if [ "`uname`" = "Darwin" ]; then libname=$(basename "$1") basedir=$(cd $(dirname "$1"); pwd) install_name_tool -id $basedir/$libname $1 fi true