#!/bin/bash -ex
+packageDirPath="${SRCDIR}/package"
+targetBinary="tizen-sdk-${TARGET_OS}"
+
+##make config file
+buildConfigFile() {
+ configFile="${packageDirPath}/installmanager.conf"
+ packageServer="http://download.tizen.org/sdk/packages/"
+ distribution="official"
+ releaseNoteUrl="https://developer.tizen.org/downloads/sdk/2.0-release-notes"
+
+ echo "Repository: "${packageServer} >> ${configFile}
+ echo "Version: "${version} >> ${configFile}
+ echo "Distribution: "${distribution} >> ${configFile}
+ echo "Release-Note: "${releaseNoteUrl} >> ${configFile}
+}
+
+##build installmanager.jar
+buildInstallManager() {
+ version="`cat $SRCDIR/package/pkginfo.manifest | grep "Version:" | head -n 1 | cut -d ':' -f2- | tr -d ' '`"
+ $SRCDIR/build.sh $version
+}
+
+##build installmanager.bin
+buildBinary() {
+ cd ${packageDirPath}
+
+ case ${TARGET_OS} in
+ ubuntu-32)
+ cp -r $SRCDIR/InstallManager_java/dist/linux32/InstallManager.jar ${packageDirPath}
+ ;;
+ windows-32)
+ cp -r $SRCDIR/InstallManager_java/dist/windows32/InstallManager.jar ${packageDirPath}
+ ;;
+ ubuntu-64)
+ ;;
+ windows-64)
+ ;;
+ macos-64)
+ ;;
+ *)
+ echo "${platform} is not support yet."
+ ;;
+ esac
+
+ ./makeNetwork ${targetBinary}
+
+}
clean()
{
rm -rf $SRCDIR/*.zip
rm -rf $SRCDIR/*.tar.gz
rm -rf $SRCDIR/InstallManager_java/dist
+ rm -rf $packageDirPath/*.bin
+ rm -rf $packageDirPath/*.conf
+ rm -rf $packageDirPath/*.jar
}
build()
{
- version="`cat $SRCDIR/package/pkginfo.manifest | grep "Version:" | head -n 1 | cut -d ':' -f2- | tr -d ' '`"
- $SRCDIR/build.sh $version
+ buildConfigFile
+ buildInstallManager
+ buildBinary
}
install()
{
- BINDIR=$SRCDIR/package/install-manager.package.$BUILD_TARGET_OS/data
+ BINDIR="$SRCDIR/package/install-manager.package.$BUILD_TARGET_OS/data/install-manager"
+
mkdir -p $BINDIR
- if [ "$BUILD_TARGET_OS" = "linux" ]
- then
- cp -r $SRCDIR/InstallManager_java/dist/linux/InstallManager.jar $BINDIR
- cp -r $SRCDIR/InstallManager_java/src/res/desktop_directory/tizen-sdk-installmanager.png $BINDIR
- cp -r $SRCDIR/InstallManager_java/src/res/desktop_directory/tizen-sdk-menu.png $BINDIR
- cp -r $SRCDIR/InstallManager_java/InstallManager $BINDIR
- cp -r $SRCDIR/InstallManager_java/installmanager.conf.net.linux $BINDIR/installmanager.conf
- else
- cp -r $SRCDIR/InstallManager_java/dist/windows/InstallManager.jar $BINDIR
- cp -r $SRCDIR/InstallManager_java/src/res/desktop_directory/tizen-sdk-installmanager.ico $BINDIR
- cp -r $SRCDIR/InstallManager_java/src/res/desktop_directory/tizen-sdk-menu.ico $BINDIR
- cp -r $SRCDIR/InstallManager_java/installmanager.conf.net.win $BINDIR/installmanager.conf
- fi
+
+ cp -r ${packageDirPath}/${targetBinary}.bin ${BINDIR}
}
+
$1
echo "$1 success"
--- /dev/null
+#!/bin/bash
+
+ORI_FILE_md5sum=$$$$__CHKSUM_REPLACE__$$$$
+ORI_FILE_LEN=$$$$__FILE_LENGTH_REPLACE__$$$$
+
+TPUT="`which tput`"
+if test -t 0 -a -t 1 -a -n "$TPUT"; then
+ CI="`$TPUT setf 6 || true`"; CE="`$TPUT setf 4 || true`"
+ CX="`$TPUT setf 2 || true`"; CN="`$TPUT sgr0 || true`"
+else CI=''; CE=''; CX=''; CN=''
+fi
+
+###### Get system information ######
+AVAIL_SPACE=`df -k . | tail -n -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
+DISPLAY_MODE=$DISPLAY
+
+OS_BLOCKSIZE=`df -k . |head -n 1 | awk '{if ( $4 ~ /%/) { print $1 } else { print $2 } }'`
+OS_BIT=`getconf LONG_BIT`
+OS_VERSION=`cat /etc/lsb-release | grep DISTRIB_RELEASE | awk -F= '{print $2}'`
+
+JAVA_VERSION=`java -version 2>&1 | sed -n "/^java version/p"`
+JAVA_BIT_FLAG=`java -version 2>&1 | egrep -e 64-Bit`
+if [ -z "${JAVA_BIT_FLAG}" ]; then
+ JAVA_BIT=32
+else
+ JAVA_BIT=64
+fi
+####################################
+
+#### Init Environment Variables ####
+CUR_DIR=`pwd`
+#OUT_PATH="/tmp/tizensdk"
+OUT_PATH="${HOME}/tizen-sdk-data/install-manager"
+
+# list for pre installation check. Write including 'space'
+INSTALLATION_CHECK="procps gettext libdbus-1-3 libcurl3 expect gtk2-engines-pixbuf grep zip make libgnome2-0"
+pkg_list=""
+
+# ubuntu version 10.x and 11.x and 12.x and 32bit
+if [ "10.04" = ${OS_VERSION} ] || [ "10.10" = ${OS_VERSION} ]; then
+ INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-arm-static"
+elif [ "11.04" = ${OS_VERSION} ] || [ "11.10" = ${OS_VERSION} ]; then
+ INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static"
+elif [ "12.04" = ${OS_VERSION} ] || [ "12.10" = ${OS_VERSION} ]; then
+ INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static libwebkitgtk-1.0-0"
+fi
+
+NVIDIA_CHECK=`lspci | grep nVidia`
+MESA_CHECK=`dpkg -l | egrep -e libgl1-mesa-glx' '`
+####################################
+
+## check the available space ##
+if [ $AVAIL_SPACE -lt 5452596 ]; then
+ echo "${CE} Available blocks: $AVAIL_SPACE($OS_BLOCKSIZE) Needed blocks: about 5.2GB "
+ echo " Please free up the required Disk Space and try again. $CN"
+ exit 1
+fi
+
+## check the root user ##
+if [ `whoami` = "root" ] ; then
+ echo "${CE} Do not install as 'root' user or 'su' commands. ${CN}"
+ exit 1
+fi
+
+## check the default java as OpenJDK ##
+CHECK_OPENJDK=`java -version 2>&1 | egrep -e OpenJDK`
+if [ -n "${CHECK_OPENJDK}" ] ; then
+ echo "${CE} OpenJDK is not supported. Try again with Oracle JDK. ${CN}"
+ exit 1
+fi
+
+## check the java installation ##
+if [ -z "${JAVA_VERSION}" ] ; then
+ echo "${CE} SDK runs on Eclipse, which requires JRE, JRE 6 or newer package is required. ${CN}"
+ exit 1
+fi
+
+## check the pre installation packages ##
+for INPUT_PKG_NAME in ${INSTALLATION_CHECK}
+do
+ CHECK_FLAG=`dpkg -l ${INPUT_PKG_NAME} 2>/dev/null | grep -e "^ii"`
+ if [ -z "${CHECK_FLAG}" ] ; then
+ pkg_list="${pkg_list}\"${INPUT_PKG_NAME}\" "
+ fi
+done
+if [ -n "$pkg_list" ] ; then
+ echo "${CN} If you want to install TIZEN-SDK, you must install${CE} ${pkg_list} ${CN}package(s)."
+ exit 1
+fi
+
+# platform bit and jdk bit equality is checked.
+if [ ${OS_BIT} != ${JAVA_BIT} ]; then
+ echo "The bit of java is different from the bit of your OS."
+ exit 1
+fi
+
+## check the mesa driver for emulator ##
+if [ "10.10" = ${OS_VERSION} ] && [ -n "${NVIDIA_CHECK}" ] && [ -z "${MESA_CHECK}" ] ; then
+ echo "We recommend that you use the Mesa OpenGL implementation in Ubuntu 10.10 and nVidia enviroment."
+ echo "Please install${CE} libgl1-mesa-glx ${CN}package."
+ exit 1
+fi
+
+## check the GUI Enviroment ##
+if [ -z "${DISPLAY_MODE}" ]; then
+ echo "$CE If you want to install TIZEN-SDK, you must execute installer in GUI Environment. $CN"
+ exit 1
+fi
+
+mkdir -p ${OUT_PATH}
+cd ${CUR_DIR}
+tail -n +"${ORI_FILE_LEN}" "$0" | tee >(md5sum>${OUT_PATH}/checksum) | tar xmz -C ${OUT_PATH}/
+
+OUT_FILE_md5sum=`cat "$OUT_PATH/checksum" | awk '{ print $1 }'`
+if [ "${OUT_FILE_md5sum}" != "${ORI_FILE_md5sum}" ]; then
+ echo "$CE The download file appears to be corrupted. "
+ echo " Please do not attempt to install this archive file. $CN"
+ rm -rf ${OUT_PATH}
+ exit 1
+fi
+
+##Excute InstallManager
+cd $OUT_PATH
+./InstallManager $*
+
+##source bashrc
+source ${HOME}/.bashrc
+
+exit 0