4 check_lib_version happydoc $PATH
5 if [ "$?" -ne "0" ]; then
9 if [ "$?" -eq "0" ]; then
10 ver=`happydoc | grep "HappyDoc version 2.1" | sort -u | awk '{print $NF}'`
11 if [ "$ver" == "2.1" ]; then
19 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
20 #$DELIM ${PRODUCT_TYPE} $DELIM
21 export PATH=\${INSTALL_ROOT}/${PRODUCT}/bin:\${PATH}
22 export PYTHONPATH=\${INSTALL_ROOT}/${PRODUCT}/lib/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
25 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
26 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
29 # looks for the native product and collects it's environment (used by make_env())
31 happydoc="`find_in_path happydoc ${PATH}`"
32 if [ -n "${happydoc}" ] ; then
33 ver=`happydoc | grep "HappyDoc version 2.1" | sort -u | awk '{print $NF}'`
34 cat > ${INSTALL_WORK}/try_native.py <<EOF
39 except ImportError, r :
42 python ${INSTALL_WORK}/try_native.py
43 if [ $? -eq 0 ] && [ "$ver" == "2.1" ] ; then
44 tmp="${happydoc} ${happydoc} \${PATH} ${PATH}";
45 path=`sort_path ${tmp}`
46 pythonpath=`python -c "import happydoclib; print happydoclib.__file__" 2>/dev/null`
47 pythonpath=`dirname $pythonpath`
48 pythonpath=`dirname $pythonpath`
49 tmp="${pythonpath} ${pythonpath} \${PYTHONPATH} ${PYTHONPATH}";
50 pythonpath=`sort_path ${tmp}`
51 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
52 #$DELIM ${PRODUCT_TYPE} $DELIM
54 export PYTHONPATH=${pythonpath}
57 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
58 rm -f ${INSTALL_WORK}/try_native.py
62 rm -f ${INSTALL_WORK}/try_native.py
67 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
73 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
74 source ${INSTALL_WORK}/$SHRC
76 check_jb tar xfz ${SOURCE_DIR}/HappyDoc_r2_1.tar.gz -C ${INSTALL_WORK}
79 makedir ${PRODUCT_DIR}
80 check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install --prefix=${PRODUCT_DIR}
81 #file_pth=${PRODUCT_DIR}/lib/python\${PYTHON_VERSION}/site-packages/happydoclib.pth
82 #if [ ! -f ${file_pth} ] ; then
84 # cat > ${file_pth} <<EOF
89 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
90 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
96 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
97 source ${INSTALL_WORK}/$SHRC
99 check_jb tar xfz ${SOURCE_DIR}/HappyDoc-r2_1.tar.gz -C ${INSTALL_ROOT}
105 export INSTALL_WORK=$2;
106 export SOURCE_DIR=$3;
107 export INSTALL_ROOT=$4;
108 export PRODUCT_SEQUENCE=$5;
109 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="happydoc" ; fi
110 export PRODUCT="HappyDoc-r2_1"
111 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
112 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}