summaryrefslogblamecommitdiff
path: root/java/shujit/pkg-install
blob: 0d02b136245943a2581a10180f8cf2d70c514936 (plain) (tree)































                                                                        
#!/bin/sh
#
# $FreeBSD$
#

[ "$2" = "POST-INSTALL" ] || exit 0

linkfile="${PKG_PREFIX}/etc/shujit-links"
:>"${linkfile}"

sed 's/[[:space:]]*#.*//' ${PKG_PREFIX}/etc/javavms | while read vm
do
    case "$vm" in
    *linux*)
	# Linux JDKs are not supported
	;;
    *)
	java_home="${vm%%/bin/*}"
	case "$java_home" in
	*jdk1.1.8*)
	    libdir="${java_home}/lib/i386/green_threads"
	    ;;
	*)
	    libdir="${java_home}/jre/lib/i386"
	    ;;
	esac
	echo "Installing link in ${libdir}"
	ln -fs "${PKG_PREFIX}/lib/libshujit.so" "${libdir}/libshujit.so"
        echo "${libdir}/libshujit.so" >>"${linkfile}"
	;;
    esac
done