Kaydet (Commit) 3f58729c authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS sb83 (1.20.14); FILE MERGED

2008/02/20 14:51:44 sb 1.20.14.5: #i84200# fixed -l switch
2008/02/06 14:22:13 sb 1.20.14.4: #i84200# further adaptions to new three-layer products; dropped unnecessary sfw stuff (already addressed via vcl RPATH)
2007/12/19 10:42:00 sb 1.20.14.3: #i84200# align with install_linux.sh in that -a can also be used for a fresh installation
2007/12/10 15:07:01 sb 1.20.14.2: #i84200# Added an -a switch to install multiple products next to each other; use sh -e for better error checking.
2007/12/03 13:33:57 sb 1.20.14.1: #i84200# Allow for multiple BASEDIRs.
üst dca08e99
#!/bin/bash #!/bin/bash
ADD="no"
LINK="no" LINK="no"
UPDATE="no" UPDATE="no"
USAGE="Usage: $0 [-l] [-h] <pkg-source-dir> <office-installation-dir>" USAGE="Usage: $0 [-a] [-l] [-h] <pkg-source-dir> <office-installation-dir>"
help() help()
{ {
...@@ -18,6 +19,7 @@ help() ...@@ -18,6 +19,7 @@ help()
echo " <office-installation-dir>: directory to where the office and the pkg database will get installed into" echo " <office-installation-dir>: directory to where the office and the pkg database will get installed into"
echo echo
echo "Optional Parameter:" echo "Optional Parameter:"
echo " -a : add to an existing <office-installation-dir>"
echo " -l : create a link \"soffice\" in $HOME" echo " -l : create a link \"soffice\" in $HOME"
echo " -h : output this help" echo " -h : output this help"
} }
...@@ -94,10 +96,11 @@ then ...@@ -94,10 +96,11 @@ then
exit 2 exit 2
fi fi
while getopts "lh" VALUE while getopts "alh" VALUE
do do
echo $VALUE echo $VALUE
case $VALUE in case $VALUE in
a) ADD="yes"; break;;
h) help; exit 0;; h) help; exit 0;;
l) LINK="yes"; break;; l) LINK="yes"; break;;
?) echo $USAGE; exit 2;; ?) echo $USAGE; exit 2;;
...@@ -195,11 +198,14 @@ then ...@@ -195,11 +198,14 @@ then
exit 2 exit 2
fi fi
else else
rmdir ${INSTALL_ROOT} 2>/dev/null if [ "$ADD" = "no" ]
if [ -d ${INSTALL_ROOT} ]
then then
printf "\n$0: ${INSTALL_ROOT} exists and is not empty.\n" rmdir ${INSTALL_ROOT} 2>/dev/null
exit 2 if [ -d ${INSTALL_ROOT} ]
then
printf "\n$0: ${INSTALL_ROOT} exists and is not empty.\n"
exit 2
fi
fi fi
mkdir -p ${INSTALL_ROOT}/var/sadm/install/admin mkdir -p ${INSTALL_ROOT}/var/sadm/install/admin
fi fi
...@@ -225,9 +231,10 @@ fi ...@@ -225,9 +231,10 @@ fi
mkdir -p ${INSTALL_ROOT}/usr/lib mkdir -p ${INSTALL_ROOT}/usr/lib
cat > ${INSTALL_ROOT}/usr/lib/postrun << \EOF cat > ${INSTALL_ROOT}/usr/lib/postrun << \EOF
#!/bin/sh #!/bin/sh
set -e
# Override UserInstallation in bootstraprc for unopkg .. # Override UserInstallation in bootstraprc for unopkg ..
UserInstallation='$ORIGIN/../UserInstallation' UserInstallation='$BRAND_BASE_DIR/../UserInstallation'
export UserInstallation export UserInstallation
if [ -x /usr/bin/mktemp ] if [ -x /usr/bin/mktemp ]
...@@ -238,7 +245,7 @@ else ...@@ -238,7 +245,7 @@ else
fi fi
sed -e 's|"/|"${PKG_INSTALL_ROOT}/|g' > $CMD sed -e 's|"/|"${PKG_INSTALL_ROOT}/|g' > $CMD
/bin/sh $CMD /bin/sh -e $CMD
rm -f $CMD rm -f $CMD
EOF EOF
chmod +x ${INSTALL_ROOT}/usr/lib/postrun 2>/dev/null chmod +x ${INSTALL_ROOT}/usr/lib/postrun 2>/dev/null
...@@ -266,14 +273,11 @@ tail +$linenum $0 > $GETUID_SO ...@@ -266,14 +273,11 @@ tail +$linenum $0 > $GETUID_SO
# #
if [ "$UPDATE" = "yes" ] if [ "$UPDATE" = "yes" ]
then then
OFFICE_DIR=${INSTALL_ROOT}`pkgparam -f ${INSTALL_ROOT}/var/sadm/pkg/*core01/pkginfo BASEDIR 2>/dev/null` # restore original "bootstraprc" prior to patching
for i in ${PKG_LIST}; do
# restore original "bootstraprc" and "soffice" prior to patching my_dir=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} "$i" BASEDIR`
if [ "${OFFICE_DIR}" != "" ] find "$my_dir" -type f -name bootstraprc.orig -exec sh -ce 'mv "$0" `dirname "$0"`/bootstraprc' {} \;
then done
mv -f ${OFFICE_DIR}/program/bootstraprc.orig ${OFFICE_DIR}/program/bootstraprc
mv -f ${OFFICE_DIR}/program/soffice.orig ${OFFICE_DIR}/program/soffice
fi
# copy INST_RELEASE file # copy INST_RELEASE file
if [ ! -f ${INSTALL_ROOT}/var/sadm/system/admin/INST_RELEASE ] if [ ! -f ${INSTALL_ROOT}/var/sadm/system/admin/INST_RELEASE ]
...@@ -300,17 +304,6 @@ else ...@@ -300,17 +304,6 @@ else
mkdir -m 0755 -p ${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR` 2>/dev/null mkdir -m 0755 -p ${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR` 2>/dev/null
done done
#
# Determine office installation directory
#
for i in ${PKG_LIST}; do
echo $i | grep core01 > /dev/null
if [ $? = 0 ]; then
OFFICE_DIR=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} $i BASEDIR`
fi
done
if [ ! "${INSTALL_ROOT:0:1}" = "/" ]; then if [ ! "${INSTALL_ROOT:0:1}" = "/" ]; then
INSTALL_ROOT=`cd ${INSTALL_ROOT}; pwd` INSTALL_ROOT=`cd ${INSTALL_ROOT}; pwd`
fi fi
...@@ -343,26 +336,15 @@ fi ...@@ -343,26 +336,15 @@ fi
if [ "$LINK" = "yes" ] if [ "$LINK" = "yes" ]
then then
echo
echo "Creating link from $OFFICE_DIR/program/soffice to $HOME/soffice"
rm -f $HOME/soffice 2>/dev/null rm -f $HOME/soffice 2>/dev/null
ln -s $OFFICE_DIR/program/soffice $HOME/soffice find `cd "$INSTALL_ROOT" && pwd` -name soffice -type f -perm -u+x -exec /bin/sh -ce 'ln -sf "$0" "$HOME/soffice" && echo "Creating link from $0 to $HOME/soffice"' {} \;
fi fi
# patch the "bootstraprc" to create a self-containing installation # patch the "bootstraprc" to create a self-containing installation
if [ "${OFFICE_DIR}" != "" ]; then for i in ${PKG_LIST}; do
mv ${OFFICE_DIR}/program/bootstraprc ${OFFICE_DIR}/program/bootstraprc.orig my_dir=${INSTALL_ROOT}`pkgparam -d ${PACKAGE_PATH} "$i" BASEDIR`
sed 's/UserInstallation=$SYSUSERCONFIG.*/UserInstallation=$ORIGIN\/..\/UserInstallation/g' \ find "$my_dir" -type f -name bootstraprc -exec sh -ce 'test ! -f "$0".orig && mv "$0" "$0".orig && sed '\''s,^UserInstallation=$SYSUSERCONFIG.*,UserInstallation=$BRAND_BASE_DIR/../UserInstallation,'\'' "$0".orig > "$0"' {} \;
${OFFICE_DIR}/program/bootstraprc.orig > ${OFFICE_DIR}/program/bootstraprc done
fi
# patch the LD_LIBRARY_PATH in the "soffice" script so that it finds a suitable libfreetype
if [ "${OFFICE_DIR}" != "" ]; then
mv ${OFFICE_DIR}/program/soffice ${OFFICE_DIR}/program/soffice.orig
sed 's| LD_LIBRARY_PATH=\"\$sd_prog\"| LD_LIBRARY_PATH=/usr/sfw/lib:"$sd_prog":"$sd_prog/../../../usr/sfw/lib"|' \
${OFFICE_DIR}/program/soffice.orig > ${OFFICE_DIR}/program/soffice
chmod a+x ${OFFICE_DIR}/program/soffice
fi
# if an unpack directory exists, it can be removed now # if an unpack directory exists, it can be removed now
if [ ! -z "$UNPACKDIR" ] if [ ! -z "$UNPACKDIR" ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment