[Title] Refactored to use SDK build system
authordonghee yang <donghee.yang@samsung.com>
Mon, 10 Jun 2013 16:55:47 +0000 (01:55 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Mon, 10 Jun 2013 16:55:47 +0000 (01:55 +0900)
19 files changed:
InstallManager-64.nsi [new file with mode: 0644]
InstallManager.nsi [new file with mode: 0644]
binaries/windows-32/InstManager.exe [new file with mode: 0644]
binaries/windows-32/InstManagerC.exe [new file with mode: 0644]
binaries/windows-64/InstManager.exe [new file with mode: 0644]
binaries/windows-64/InstManagerC.exe [new file with mode: 0644]
installer_ori [moved from package/installer_ori with 100% similarity]
makeBin
makeExe [new file with mode: 0755]
makeImageLinux [moved from package/makeImageLinux with 100% similarity]
makeImageWindows [moved from package/makeImageWindows with 100% similarity]
makeInstaller
makeLocal [moved from package/makeLocal with 100% similarity]
package/InstallManagerP [deleted file]
package/build.linux
package/build.macos [new file with mode: 0755]
package/build.windows [new file with mode: 0755]
package/install-manager.install.linux
package/pkginfo.manifest

diff --git a/InstallManager-64.nsi b/InstallManager-64.nsi
new file mode 100644 (file)
index 0000000..f61469b
--- /dev/null
@@ -0,0 +1,59 @@
+outfile "tizen-sdk-develop-64.exe"\r
+\r
+Name "Tizen-SDK"\r
+\r
+ShowInstDetails show\r
+\r
+Icon "SDK_icon.ico"\r
+\r
+!include FileFunc.nsh\r
+!include LogicLib.nsh\r
+!insertmacro GetParameters\r
+!insertmacro GetOptions\r
+\r
+section\r
+  ${GetParameters} $R0\r
+  SetRegView 64\r
+\r
+  StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"\r
+  StrCpy $2 0\r
+  ReadRegStr $2 HKLM "$1" "CurrentVersion"\r
+  StrCmp $2 "" DetectTry2\r
+  ReadRegStr $5 HKLM "$1\$2" "JavaHome"\r
+  StrCmp $5 "" DetectTry2\r
+  goto done\r
+\r
+  DetectTry2:\r
+  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
+  StrCmp $2 "" NoJava\r
+  ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"\r
+  StrCmp $5 "" NoJava done\r
+\r
+  done:\r
+  StrCpy $INSTDIR "$TEMP\tizensdk"\r
+  SetOutPath $INSTDIR\r
+  SetOverwrite on\r
+  File /r "build\*.*"\r
+  DetailPrint "install manager will be executed"\r
+  ExecWait '"$INSTDIR\javacheck.bat"' $1\r
+  ${If} $1 == 1\r
+    goto NoEnv\r
+  ${EndIf}\r
+  ${If} $R0 == ""\r
+    Exec "$INSTDIR\InstManager.exe"\r
+  ${Else}\r
+    Exec "$INSTDIR\InstManagerC.exe $R0"\r
+  ${EndIf}\r
+  SetAutoClose true\r
+  return\r
+\r
+  NoEnv:\r
+  MessageBox MB_ICONEXCLAMATION "Cannot execute Java even if it was installed. Check environment variables or Java version(over 1.6) please."  \r
+  SetAutoClose true\r
+  return\r
+\r
+  NoJava:\r
+  MessageBox MB_ICONEXCLAMATION "You must have either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) in version 6 installed on your computer."\r
+  SetAutoClose true\r
+  return\r
+sectionEnd\r
diff --git a/InstallManager.nsi b/InstallManager.nsi
new file mode 100644 (file)
index 0000000..3bbcbb6
--- /dev/null
@@ -0,0 +1,58 @@
+outfile "tizen-sdk-develop-32.exe"\r
+\r
+Name "Tizen-SDK"\r
+\r
+ShowInstDetails show\r
+\r
+Icon "SDK_icon.ico"\r
+\r
+!include FileFunc.nsh\r
+!include LogicLib.nsh\r
+!insertmacro GetParameters\r
+!insertmacro GetOptions\r
+\r
+section\r
+  ${GetParameters} $R0\r
+\r
+  StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"\r
+  StrCpy $2 0\r
+  ReadRegStr $2 HKLM "$1" "CurrentVersion"\r
+  StrCmp $2 "" DetectTry2\r
+  ReadRegStr $5 HKLM "$1\$2" "JavaHome"\r
+  StrCmp $5 "" DetectTry2\r
+  goto done\r
+\r
+  DetectTry2:\r
+  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
+  StrCmp $2 "" NoJava\r
+  ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"\r
+  StrCmp $5 "" NoJava done\r
+\r
+  done:\r
+  StrCpy $INSTDIR "$TEMP\tizensdk"\r
+  SetOutPath $INSTDIR\r
+  SetOverwrite on\r
+  File /r "build\*.*"\r
+  DetailPrint "install manager will be executed"\r
+  ExecWait '"$INSTDIR\javacheck.bat"' $1\r
+  ${If} $1 == 1\r
+    goto NoEnv\r
+  ${EndIf}\r
+  ${If} $R0 == ""\r
+    Exec "$INSTDIR\InstManager.exe"\r
+  ${Else}\r
+    Exec "$INSTDIR\InstManagerC.exe $R0"\r
+  ${EndIf}\r
+  SetAutoClose true\r
+  return\r
+\r
+  NoEnv:\r
+  MessageBox MB_ICONEXCLAMATION "Cannot execute Java even if it was installed. Check environment variables or Java version(over 1.6) please."  \r
+  SetAutoClose true\r
+  return\r
+\r
+  NoJava:\r
+  MessageBox MB_ICONEXCLAMATION "You must have either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) in version 6 installed on your computer."\r
+  SetAutoClose true\r
+  return\r
+sectionEnd\r
diff --git a/binaries/windows-32/InstManager.exe b/binaries/windows-32/InstManager.exe
new file mode 100644 (file)
index 0000000..03a1343
Binary files /dev/null and b/binaries/windows-32/InstManager.exe differ
diff --git a/binaries/windows-32/InstManagerC.exe b/binaries/windows-32/InstManagerC.exe
new file mode 100644 (file)
index 0000000..f50f366
Binary files /dev/null and b/binaries/windows-32/InstManagerC.exe differ
diff --git a/binaries/windows-64/InstManager.exe b/binaries/windows-64/InstManager.exe
new file mode 100644 (file)
index 0000000..904736f
Binary files /dev/null and b/binaries/windows-64/InstManager.exe differ
diff --git a/binaries/windows-64/InstManagerC.exe b/binaries/windows-64/InstManagerC.exe
new file mode 100644 (file)
index 0000000..c939059
Binary files /dev/null and b/binaries/windows-64/InstManagerC.exe differ
similarity index 100%
rename from package/installer_ori
rename to installer_ori
diff --git a/makeBin b/makeBin
index 2ef9266..fd9ecff 100755 (executable)
--- a/makeBin
+++ b/makeBin
@@ -1,18 +1,4 @@
 #!/bin/sh
-
-if [ ! -f installmanager.conf ]
-then
-       echo "installmanager.conf file do not exist."
-       exit 1
-fi
-
-if [ $# -ne 1 ]
-then
-       echo "Check your parameter. This scrpt need 1 parameter.(binary file name) "
-       echo "ex)./makeNetwork tizen_sdk_network"
-       exit 1
-fi
-
 ##zip files
 tarGzFile=InstallManager.tar.gz
 
@@ -22,7 +8,7 @@ tar cvfz ${tarGzFile} InstallManager.sh InstallManager.jar installmanager.conf
 #currentDate=`date '+%Y%m%d%H%M'`
 binFile=$1.bin
 
-${SRCDIR}/makeInstaller InstallManager.tar.gz ${binFile}
+${SRCDIR}/makeInstaller InstallManager.tar.gz 
 
 rm -rf ${tarGzFile}
 
diff --git a/makeExe b/makeExe
new file mode 100755 (executable)
index 0000000..4e780be
--- /dev/null
+++ b/makeExe
@@ -0,0 +1,27 @@
+#!/bin/bash
+if [ "`which makensis 2>/dev/null`" ] ; then
+    echo "Checking NSIS... OK"
+else
+    echo "Checking NSIS... IS NOT INSTALLED"
+    exit 1
+fi
+
+# build exe
+makensis $1
+
+# sign if defined
+if [ "$SIGNTOOL_PATH" != "" ]  && [ -f "$SIGNTOOL_PATH" ]
+then
+       if [ "$SIGNFILE_PATH" != "" ] && [ -f "$SIGNFILE_PATH" ]
+       then
+               if [ "$SIGNFILE_PATH" != "" ] && [ -f "$SIGNFILE_PATH" ]
+               then
+                       "$SIGNTOOL_PATH" "sign" "//f" "$SIGNFILE_PATH" "//p" "${SIGNPASSWORD}" "//t" "http://timestamp.verisign.com/scripts/timestamp.dll" "$SRCDIR/inst-manager.exe"
+               else
+                       echo "Skip signing... Signing password is not defined!"
+       else
+               echo "Skip signing... Signing file does not exist!"
+       fi
+else
+       echo "Skip signing... Signing tool does not exist!"
+fi
similarity index 100%
rename from package/makeImageLinux
rename to makeImageLinux
similarity index 100%
rename from package/makeImageWindows
rename to makeImageWindows
index 2220685..86ee615 100755 (executable)
@@ -7,16 +7,9 @@ if test -t 0 -a -t 1 -a -n "$TPUT"; then
 else    CI=''; CE=''; CX=''; CN=''
 fi
 
-### 1. check argument ###
-if [ $# != 2 ]; then
-        echo "$CE usage : ./makeInstaller.sh <SDK.zip> <SDK.bin> $CN"
-        echo "$CE ex) ./makeInstaller.sh tizen-sdk.tar.gz tizen-sdk.bin $CN"
-        exit 1
-fi
-
 CUR_DIR=`pwd`
 ZIP_FILE=$1
-OUTPUT_FILE=$2
+OUTPUT_FILE=inst-manager.bin
 cp ${SRCDIR}/installer_stub installerstub_cp
 INSTALLSTUB="installerstub_cp"
 
similarity index 100%
rename from package/makeLocal
rename to makeLocal
diff --git a/package/InstallManagerP b/package/InstallManagerP
deleted file mode 100755 (executable)
index 483eff1..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#/bin/bash
-current_path=`pwd`
-
-if [ -e InstallManager.jar ]
-then
-       java -jar InstallManager.jar -partner
-elif [ -e $HOME/tizen-sdk-data/tizensdkpath ] 
-then
-       tizenpath=`grep TIZEN_SDK_INSTALLED_PATH $HOME/tizen-sdk-data/tizensdkpath`
-       SDK_PATH=`echo $tizenpath | cut -f2 -d"="`
-       if [ "x$SDK_PATH" != "x" ]
-       then
-               cd $SDK_PATH/install-manager
-               if [ -e InstallManager.jar ]
-               then
-                       java -jar InstallManager.jar -partner
-               fi
-       fi
-fi
-
-exit 0
-
index 1e45e17..9cc9192 100755 (executable)
@@ -10,7 +10,7 @@ buildConfigFile() {
        releaseNoteUrl="https://developer.tizen.org/downloads/sdk/2.0-release-notes"
 
        echo "Repository: "${packageServer} >> ${configFile}
-       echo "Version: "${version} >> ${configFile}
+       echo "Version: "${VERSION} >> ${configFile}
        echo "Distribution: "${distribution} >> ${configFile}
        echo "Release-Note: "${releaseNoteUrl} >> ${configFile}
 }
@@ -43,7 +43,7 @@ buildInstallManager() {
 }
 
 ##build installmanager.bin
-copyBinary() {
+makeExecutable() {
        case ${TARGET_OS} in
         ubuntu-32|fedora-32|tizen-32)
                        cp -rf $SRCDIR/InstallManager_java/dist/linux32/InstallManager.jar ${buildDir}/
@@ -68,7 +68,7 @@ copyBinary() {
        cp -rf $SRCDIR/InstallManager.sh ${buildDir}/
 
        cd ${buildDir}
-       ${SRCDIR}/makeBin ${targetBinary}
+       ${SRCDIR}/makeBin
        cd ${SRCDIR}
 }
 
@@ -78,9 +78,7 @@ clean()
        rm -rf $SRCDIR/*.zip
        rm -rf $SRCDIR/*.tar.gz
        rm -rf $SRCDIR/InstallManager_java/dist
-       rm -rf $buildDir/*.bin
-       rm -rf $buildDir/*.conf
-       rm -rf $buildDir/*.jar
+       rm -rf $buildDir
 }
 
 
@@ -90,7 +88,7 @@ build()
        mkdir -p ${buildDir}
        buildConfigFile
        buildInstallManager
-       copyBinary
+       makeExecutable
 }
 
 install()
diff --git a/package/build.macos b/package/build.macos
new file mode 100755 (executable)
index 0000000..1e45e17
--- /dev/null
@@ -0,0 +1,103 @@
+#!/bin/bash -ex
+buildDir="${SRCDIR}/build"
+targetBinary="inst-manager"
+
+##make config file
+buildConfigFile() {
+       configFile="${buildDir}/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() {
+       cd ${buildDir}
+       case ${TARGET_OS} in
+        ubuntu-32|fedora-32|tizen-32)
+                       $SRCDIR/build.sh "linux-32"
+        ;;
+        ubuntu-64|fedora-64|tizen-64)
+                       $SRCDIR/build.sh "linux-64"
+        ;;
+        windows-32)
+                       $SRCDIR/build.sh "windows-32"
+               ;;
+        windows-64)
+                       $SRCDIR/build.sh "windows-64"
+        ;;
+        macos-64)
+                       $SRCDIR/build.sh "macos-64"
+        ;;
+        *)
+                       echo "The OS \"${TARGET_OS}\" is not supported yet!"
+                       exit 1
+        ;;
+       esac
+       cd ${SRCDIR}
+}
+
+##build installmanager.bin
+copyBinary() {
+       case ${TARGET_OS} in
+        ubuntu-32|fedora-32|tizen-32)
+                       cp -rf $SRCDIR/InstallManager_java/dist/linux32/InstallManager.jar ${buildDir}/
+        ;;
+        ubuntu-64|fedora-64|tizen-64)
+                       cp -rf $SRCDIR/InstallManager_java/dist/linux64/InstallManager.jar ${buildDir}/
+        ;;
+        windows-32)
+                       cp -rf $SRCDIR/InstallManager_java/dist/windows32/InstallManager.jar ${buildDir}/
+               ;;
+        windows-64)
+                       cp -rf $SRCDIR/InstallManager_java/dist/windows64/InstallManager.jar ${buildDir}/
+        ;;
+        macos-64)
+                       cp -rf $SRCDIR/InstallManager_java/dist/macos/InstallManager.jar ${buildDir}/
+        ;;
+        *)
+                       echo "The OS \"${TARGET_OS}\" is not supported yet!"
+                       exit 1
+        ;;
+       esac
+       cp -rf $SRCDIR/InstallManager.sh ${buildDir}/
+
+       cd ${buildDir}
+       ${SRCDIR}/makeBin ${targetBinary}
+       cd ${SRCDIR}
+}
+
+
+clean()
+{
+       rm -rf $SRCDIR/*.zip
+       rm -rf $SRCDIR/*.tar.gz
+       rm -rf $SRCDIR/InstallManager_java/dist
+       rm -rf $buildDir/*.bin
+       rm -rf $buildDir/*.conf
+       rm -rf $buildDir/*.jar
+}
+
+
+build()
+{
+       rm -rf ${buildDir}
+       mkdir -p ${buildDir}
+       buildConfigFile
+       buildInstallManager
+       copyBinary
+}
+
+install()
+{
+       BINDIR="$SRCDIR/package/install-manager.package.$BUILD_TARGET_OS/data/install-manager"
+
+       mkdir -p $BINDIR 
+
+       cp -r ${buildDir}/${targetBinary}.bin ${BINDIR}
+}
diff --git a/package/build.windows b/package/build.windows
new file mode 100755 (executable)
index 0000000..711b030
--- /dev/null
@@ -0,0 +1,106 @@
+#!/bin/bash -ex
+buildDir="${SRCDIR}/build"
+targetBinary="inst-manager"
+
+##make config file
+buildConfigFile() {
+       configFile="${buildDir}/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() {
+       cd ${buildDir}
+       case ${TARGET_OS} in
+        ubuntu-32|fedora-32|tizen-32)
+                       $SRCDIR/build.sh "linux-32"
+        ;;
+        ubuntu-64|fedora-64|tizen-64)
+                       $SRCDIR/build.sh "linux-64"
+        ;;
+        windows-32)
+                       $SRCDIR/build.sh "windows-32"
+               ;;
+        windows-64)
+                       $SRCDIR/build.sh "windows-64"
+        ;;
+        macos-64)
+                       $SRCDIR/build.sh "macos-64"
+        ;;
+        *)
+                       echo "The OS \"${TARGET_OS}\" is not supported yet!"
+                       exit 1
+        ;;
+       esac
+       cd ${SRCDIR}
+}
+
+##build installmanager.bin
+makeExecutable() {
+       case ${TARGET_OS} in
+        windows-32)
+                       cp -rf $SRCDIR/InstallManager_java/dist/windows32/InstallManager.jar ${buildDir}/
+                       cp -rf $SRCDIR/windows-32/InstManager.exe ${buildDir}/
+                       cp -rf $SRCDIR/windows-32/InstManagerC.exe ${buildDir}/
+               ;;
+        windows-64)
+                       cp -rf $SRCDIR/InstallManager_java/dist/windows64/InstallManager.jar ${buildDir}/
+                       cp -rf $SRCDIR/windows-32/InstManager.exe ${buildDir}/
+                       cp -rf $SRCDIR/windows-32/InstManagerC.exe ${buildDir}/
+        ;;
+        *)
+                       echo "The OS \"${TARGET_OS}\" is not supported yet!"
+                       exit 1
+        ;;
+       esac
+       cp -rf $SRCDIR/javacheck.bat ${buildDir}/
+
+       # make exe
+       cd ${SRCDIR}
+       case ${TARGET_OS} in
+        windows-32)
+                       ./makeExe ${SRCDIR}/InstallManager.nsi
+               ;;
+        windows-64)
+                       ./makeExe ${SRCDIR}/InstallManager-64.nsi
+        ;;
+        *)
+        ;;
+       esac
+
+}
+
+
+clean()
+{
+       rm -rf $SRCDIR/*.zip
+       rm -rf $SRCDIR/*.exe
+       rm -rf $SRCDIR/InstallManager_java/dist
+       rm -rf $buildDir
+}
+
+
+build()
+{
+       rm -rf ${buildDir}
+       mkdir -p ${buildDir}
+       buildConfigFile
+       buildInstallManager
+       makeExecutable
+}
+
+install()
+{
+       BINDIR="$SRCDIR/package/install-manager.package.$BUILD_TARGET_OS/data/install-manager"
+
+       mkdir -p $BINDIR 
+
+       cp -r ${buildDir}/${targetBinary}.bin ${BINDIR}
+}
index 8f02600..01e756c 100755 (executable)
@@ -3,11 +3,7 @@
 SHORTCUT_DIR_PATH=${HOME}/.local/share
 APPLICATION_DIR_PATH=${SHORTCUT_DIR_PATH}/applications
 DESKTOP_FILE_PATH=${APPLICATION_DIR_PATH}/tizen-sdk-installmanager.desktop
-if [ -n "${PARTNER}" ] ; then
-       DESKTOP_EXECUTE_FILE_PATH=${INSTALLED_PATH}/install-manager/InstallManagerP
-else
-       DESKTOP_EXECUTE_FILE_PATH=${INSTALLED_PATH}/install-manager/InstallManager
-fi
+DESKTOP_EXECUTE_FILE_PATH=${INSTALLED_PATH}/install-manager/InstallManager
 DESKTOP_ICON_FILE_PATH=${INSTALLED_PATH}/install-manager/tizen-sdk-installmanager.png
 DESKTOP_NAME="Install Manager"
 DESKTOP_COMMENT="Install Manager for Tizen SDK"
index 26aba24..e12d348 100644 (file)
@@ -1,16 +1,28 @@
-Package: install-manager
+Source: install-manager
 Version: 1.20.0
+Maintainer: Shihyun Kim<shihyun.kim@samsung.com>, Yongsung Kim<yongsung1.kim@samsung.com>
+
+Package: install-manager
 OS: ubuntu-32
 Build-host-os: ubuntu-32
-Maintainer: Shihyun Kim<shihyun.kim@samsung.com>, Yongsung Kim<yongsung1.kim@samsung.com>
-Source: install-manager
 Description: InstallManager
 
 Package: install-manager
-Version: 1.20.0
+OS: ubuntu-64
+Build-host-os: ubuntu-64
+Description: InstallManager
+
+Package: install-manager
 OS: windows-32
-Build-host-os: ubuntu-32
-Maintainer: Shihyun Kim<shihyun.kim@samsung.com>, Yongsung Kim<yongsung1.kim@samsung.com>
-Source: install-manager
+Build-host-os: windows-32
 Description: InstallManager
 
+Package: install-manager
+OS: windows-64
+Build-host-os: windows-64
+Description: InstallManager
+
+Package: install-manager
+OS: macos-64
+Build-host-os: macos-64
+Description: InstallManager