#!/bin/sh # /usr/local/bin might not be on the default PATH, so append it to make sure # that we can find any dependencies that we've installed there export PATH="$PATH:/usr/local/bin" path_list=`echo -n "$PATH" | sed s/:/\ /g` find_prog() { prog_name="" for path_dir in $path_list; do if [ -x "$path_dir/$1" ]; then prog_name="$path_dir/$1" return 0 fi done return 1 } echo "compiling Python files ..." install_root_dir="$2/CIPRES" cipres_root_dir="$install_root_dir/CIPRES-Root" python2.4 -c "import compileall; compileall.compile_dir('$cipres_root_dir/lib/python2.4/site-packages')" || exit 1 echo "writing install.properties ..." prop_file_name="$INSTALLER_TEMP/install.properties" find_prog "perl" echo "cipres.perlInterpreter.path=$prog_name" > "$prop_file_name" find_prog "python2.4" echo "cipres.pythonInterpreter.path=$prog_name" >> "$prop_file_name" find_prog "omniidl" omniorb_bin_dir=`dirname $prog_name` omniorb_lib_dir="`dirname $omniorb_bin_dir`/lib" # if the build of omniORB that we're going to use supports SSL connections, we # need to include the location of the OpenSSL libraries in the omniORB library # path property if [ -e "$omniorb_lib_dir/libomnisslTP.4.0.dylib" ]; then omniorb_lib_path="$omniorb_lib_dir /usr/lib" else omniorb_lib_path="$omniorb_lib_dir" fi echo "cipres.omniORBpy.pythonpath.path=$omniorb_lib_dir/python2.4/site-packages" >> "$prop_file_name" echo "cipres.omniORB.lib.path=$omniorb_lib_path" >> "$prop_file_name" cipres_version=`cat $cipres_root_dir/include/cipres/config.h | grep PACKAGE_VERSION | awk '{ print $3 }' | sed s/\"//g` echo "cipres.version=$cipres_version" >> "$prop_file_name" cp "$prop_file_name" "$cipres_root_dir/share/cipres/resources/" || exit 1 # the CIPRES package doesn't require administrative or root permissions, so any # files that it installs will be owned by the user running the installation. # However, if this package is contained in a distribution package that also # contains other packages that do require admin or root permissions, then the # ownership of the files from the CIPRES package will remain unchanged from # what they are in the payload of the package, which is the behavior of the # Installer when handling packages that require elevated privileges. We don't # have any guarantees that the user account that owns the files in the package # is appropriate or even exists on the target system, so we fix the problem by # setting the ownership here echo "setting ownership of $install_root_dir to $USER ..." chown -R "$USER" "$install_root_dir" || exit 1 exit 0