3 # shlib-install - install a shared library and do any necessary host-specific
4 # post-installation configuration (like ldconfig)
6 # usage: shlib-install [-D] -O host_os -d installation-dir -i install-prog [-U] library
14 INSTALLDIR
=/usr
/local
/lib
17 PROGNAME
=`basename $0`
18 USAGE
="$PROGNAME [-D] -O host_os -d installation-dir -i install-prog [-U] library"
22 while [ $# -gt 0 ]; do
24 -O) shift; host_os
="$1"; shift ;;
25 -d) shift; INSTALLDIR
="$1"; shift ;;
26 -i) shift; INSTALLPROG
="$1" ; shift ;;
27 -D) echo=echo ; shift ;;
28 -U) uninstall
=true
; shift ;;
29 -*) echo "$USAGE" >&2 ; exit 2;;
34 # set install target name
37 if [ -z "$LIBNAME" ]; then
49 if [ -z "$uninstall" ]; then
50 ${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
51 if [ -f "$INSTALLDIR/$LIBNAME" ]; then
52 ${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}${OLDSUFF}
58 if [ -z "$uninstall" ] ; then
59 ${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
61 ${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
64 # post-install/uninstall
67 *.
*.
[0-9].
[0-9]) # libname.so.M.N
68 LINK2
=`echo $LIBNAME | sed 's:\(.*\..*\.[0-9]\)\.[0-9]:\1:'` # libname.so.M
69 LINK1
=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]\.[0-9]:\1:'` # libname.so
71 *.
*.
[0-9]) # libname.so.M
72 LINK1
=`echo $LIBNAME | sed 's:\(.*\..*\)\.[0-9]:\1:'` # libname.so
77 # Create symlinks to the installed library. This section is incomplete.
81 # libname.so.M -> libname.so.M.N
82 ${echo} ${RM} ${INSTALLDIR}/$LINK2
83 if [ -z "$uninstall" ]; then
84 ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK2
87 # libname.so -> libname.so.M.N
88 ${echo} ${RM} ${INSTALLDIR}/$LINK1
89 if [ -z "$uninstall" ]; then
90 ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
94 solaris2
*|aix4.
[2-9]*|hpux1
*)
95 # libname.so -> libname.so.M
96 ${echo} ${RM} ${INSTALLDIR}/$LINK1
97 if [ -z "$uninstall" ]; then
98 ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
This page took 0.032665 seconds and 5 git commands to generate.