summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMunkyu Im <munkyu.im@samsung.com>2015-07-15 20:49:20 +0900
committerJihye Won <jihye.won1@samsung.com>2015-07-17 20:52:16 +0900
commit7aeb132ad96a06b000da4b2bf84db102d5a1f94a (patch)
treedee3b990cf05787d124ea625cff5835ecc4bc976 /package
parent8a6aea4634e69506ee58f54cba99f97d86e13899 (diff)
downloademulator-common-lib-7aeb132ad96a06b000da4b2bf84db102d5a1f94a.tar.gz
emulator-common-lib-7aeb132ad96a06b000da4b2bf84db102d5a1f94a.tar.bz2
emulator-common-lib-7aeb132ad96a06b000da4b2bf84db102d5a1f94a.zip
package: add windows, macos-64 build script
- add windows build script written by jihye won. - add macos build script written by munkyu im. Change-Id: Ifecb28573079c9042d080a6ce2a5a20f9b5a2d39 Signed-off-by: Munkyu Im <munkyu.im@samsung.com> Signed-off-by: Jihye Won <jihye.won1@samsung.com>
Diffstat (limited to 'package')
-rw-r--r--package/build.macos-64215
-rwxr-xr-xpackage/build.windows-32155
-rwxr-xr-xpackage/build.windows-64159
-rw-r--r--package/changelog5
-rw-r--r--package/pkginfo.manifest33
5 files changed, 567 insertions, 0 deletions
diff --git a/package/build.macos-64 b/package/build.macos-64
new file mode 100644
index 0000000..f9bb1ae
--- /dev/null
+++ b/package/build.macos-64
@@ -0,0 +1,215 @@
+#!/bin/sh -e
+BUILD_ARCH=x86_64
+BUILD_PACKAGE="emulator-common-lib"
+BUILD_SW=cocoa
+TMP_DIR="$SRCDIR/data"
+META_MF=meta.mf
+OS_COMMON_DIR="$ROOTDIR/os-common"
+BIN_DIR="$SRCDIR/package/${BUILD_PACKAGE}.package.${TARGET_OS}/data/tools/emulator/bin/"
+# general .mf example
+#Extension: dylib
+#Usage: check-net
+#Version: 8.0 //get from "file" command
+#OS: ubuntu-32
+#Arch: x86_64
+#Package: emulator-lib
+#License:
+
+patch_loader_path()
+{
+
+ cd $BIN_DIR
+
+ # Libs[] is an array.
+ declare -a Libs
+
+ cnt=0
+ for i in $(ls *.dylib)
+ do
+ Libs[cnt]=$i
+ cnt+=1
+ done
+
+ for i in "${Libs[@]}"
+ do
+ Arr=( $(otool -L $i | awk '/\/opt\/local\/lib/ { split($1,lib,"/"); print lib[5] }') )
+ for lib in "${Arr[@]}"
+ do
+ #echo $lib
+ if [ "$i" == "$lib" ]
+ then
+ echo $i
+ install_name_tool -id $i $i
+ else
+ install_name_tool -change /opt/local/lib/$lib @loader_path/$lib $i
+ fi
+ done
+ done
+}
+
+trim_string()
+{
+ trimmed=$1
+ trimmed=${trimmed%% }
+ trimmed=${trimmed## }
+
+ echo "$trimmed"
+}
+
+contains()
+{
+ string="$1"
+ substring="$2"
+ if test "${string#*$substring}" != "$string"
+ then
+ echo $substring is in $string
+ else
+ echo $substring is not in $string
+ exit 1
+ fi
+}
+
+check_swt()
+{
+ # especially check for swt.jar
+ unzip $2
+ TEMP_SWT_WS=$(cat $2/META-INF/MANIFEST.MF | grep "SWT-WS:" | cut -d ':' -f2)
+ SWT_WS=$(trim_string $TEMP_SWT_WS)
+ if [ $SWT_WS != $BUILD_WS ];then
+ echo $SWT_WS is not supported.
+ exit 1
+ fi
+ TEMP_SWT_ARCH=$(cat $2/META-INF/MANIFEST.MF | grep "SWT-Arch:" | cut -d ':' -f2)
+ SWT_ARCH=$(trim_string $TEMP_SWT_ARCH)
+ if [ $SWT_ARCH != $BUILD_ARCH ];then
+ echo $SWT_ARCH is not supported.
+ exit 1
+ fi
+}
+
+# $1: mf file path (e.g. xxx.mf)
+# $2: original binary/library file path (e.g. xxx.dylib)
+check_file()
+{
+ # check arch from mf file
+ ARCHS=$(cat $1 | grep "Arch:" | cut -d ':' -f2)
+ contains "$ARCHS" $BUILD_ARCH
+ # do not use file command if file extension is not dylib.
+ if [ "$EXTENSION" == "dylib" ];then
+ ARCH_RESULT=$(file $2)
+ contains "$ARCH_RESULT" $BUILD_ARCH
+ fi
+ # TODO: some libraries do not have extension. need handling
+ # check OS
+ OSES=$(cat $i | grep "OS:" | cut -d ':' -f2)
+ contains "$OSES" $TARGET_OS
+
+ # copy file if validation passed.
+ echo "move $2 to $TMP_DIR"
+ mv -f "$2" $TMP_DIR
+}
+
+clean()
+{
+ rm -rf $SRCDIR/*.zip
+ rm -rf $SRCDIR/*.tar.gz
+}
+
+prepare()
+{
+ if [ ! -d $TMP_DIR ]
+ then
+ echo "make temp directory for emulator install : ( $TMP_DIR )"
+ mkdir $TMP_DIR
+ fi
+}
+
+# $1: root directory for traversing
+traverse_manifest()
+{
+
+ for i in $(find $1 -iname '*.mf')
+ do
+ # skip if filename is meta.mf it's used for packaging dev
+ if [ "$META_MF" == $(basename "$i") ];then
+ echo "skip $i"
+ continue
+ fi
+
+ TEMP_PACKAGE=$(cat "$i" | grep "Package:" | cut -d ':' -f2)
+ PACKAGES=$(trim_string "$(echo $TEMP_PACKAGE | tr "," "\n")")
+ TEMP_EXTENSION=$(cat "$i" | grep "Extension:" | cut -d ':' -f2)
+ EXTENSIONS=$(trim_string "$(echo $TEMP_EXTENSION | tr "," "\n")")
+ BUILD_OK=0
+ for PACKAGE in $PACKAGES
+ do
+ if [ ! -e "$PACKAGE" ] && [ "$PACKAGE" == $BUILD_PACKAGE ]
+ then
+ # BUILD_OK=1 means this manifest file support current build project
+ BUILD_OK=1
+
+ # find origin file(s) from manifest file
+ TRIM_EXTENSIONS=$(trim_string "$EXTENSIONS")
+ if [ "x" == "$TRIM_EXTENSIONS"x ];then
+ # used for Qt library. they do not have extension.
+ FILE=${i%%.mf}
+ check_file "$i" "$FILE"
+ else
+ for EXTENSION in $EXTENSIONS
+ do
+ echo found \"$PACKAGE\" in $i
+
+ if [ ! -e $EXTENSION ]
+ then
+ FILE=${i%%.mf}.$EXTENSION
+ else
+ FILE=${i%%.mf}
+ fi
+ if [ ! -f "$FILE" ] ;then
+ echo $FILE does not exist.
+ exit 1
+ fi
+ if [ $(basename $i) == swt ];then
+ check_swt "$i" "$FILE"
+ else
+ check_file "$i" "$FILE"
+ fi
+ done
+ fi
+ fi
+ done
+ if [ $BUILD_OK -eq 0 ]
+ then
+ echo "cannot find $BUILD_PACKAGE in $i skipped."
+ fi
+ done
+
+}
+
+build()
+{
+ prepare
+ echo "traverse_manifest $OS_COMMON_DIR"
+ traverse_manifest $OS_COMMON_DIR
+
+ echo "traverse_manifest $ROOTDIR/$TARGET_OS"
+ traverse_manifest $ROOTDIR/$TARGET_OS
+}
+
+install()
+{
+ # make directory structure
+ mkdir -p $BIN_DIR
+ mv -f $TMP_DIR/* $BIN_DIR
+
+ patch_loader_path
+
+ # after done, remove temp
+ rm -rf $TMP_DIR
+}
+
+[ "$1" = "clean" ] && clean
+[ "$1" = "build" ] && build
+[ "$1" = "install" ] && install
+
+echo "success"
diff --git a/package/build.windows-32 b/package/build.windows-32
new file mode 100755
index 0000000..7f126c7
--- /dev/null
+++ b/package/build.windows-32
@@ -0,0 +1,155 @@
+#!/bin/sh -xe
+
+BUILD_ARCH=i386
+BUILD_PACKAGE=emulator-common-lib
+BUILD_WS=win32
+META_MF=meta.mf
+TMP_DIR="$SRCDIR/data"
+OS_COMMON_DIR="$ROOTDIR/os-common"
+BIN_DIR="$SRCDIR/package/${BUILD_PACKAGE}.package.${TARGET_OS}/data/tools/emulator/bin"
+
+clean()
+{
+ rm -rf $SRCDIR/*.zip
+ rm -rf $SRCDIR/*.tar.gz
+}
+
+prepare()
+{
+ if [ ! -d $TMP_DIR ]
+ then
+ echo "make temp directory for emulator install : ( $TMP_DIR )"
+ mkdir $TMP_DIR
+ fi
+}
+
+trim_string()
+{
+ trimmed=$1
+ trimmed=${trimmed%% }
+ trimmed=${trimmed## }
+
+ echo "$trimmed"
+}
+
+contains() {
+ string="$1"
+ substring="$2"
+ if test "${string#*$substring}" != "$string"
+ then
+ echo $substring is in $string
+ else
+ echo $substring is not in $string
+ exit 1
+ fi
+}
+
+# $1: mf file path (e.g. xxx.mf)
+# $2: original binary/library file path (e.g. xxx.dylib)
+check_file()
+{
+ # check arch from mf file
+ ARCHS=$(cat $1 | grep "Arch:" | cut -d ':' -f2)
+ contains "$ARCHS" $BUILD_ARCH
+
+ # check the library or the binary to support build_architecture
+ if [ "$EXTENSION" = "dll" ] && [ "$EXTENSION" = "exe" ] ;then
+ ARCH_RESULT=$(file $2)
+ ARCH_OK=0
+ if test "${ARCH_RESULT#*"32-bit"}" != "$ARCH_RESULT"
+ then
+ echo $ARCH_RESULT is in 32-bit
+ ARCH_OK=1
+ elif test "${ARCH_RESULT#*"PE32"}" != "$ARCH_RESULT"
+ then
+ echo $ARCH_RESULT is in PE32
+ ARCH_OK=1
+ elif test "${ARCH_OK}" == "0"
+ then
+ echo $2 is no architecture.
+ exit 1
+ fi
+ fi
+
+ # check OS
+ OSES=$(cat $i | grep "OS:" | cut -d ':' -f2)
+ contains "$OSES" $TARGET_OS
+
+ # copy file if validation passed.
+ echo "move $2 to $TMP_DIR"
+ mv -f "$2" $TMP_DIR
+}
+
+# $1: root directory for traversing
+traverse_manifest()
+{
+ for i in $(find $1 -iname '*.mf')
+ do
+ # skip if filename is meta.mf it's used for packaging dev
+ if [ "$META_MF" = $(basename $i) ];then
+ echo "skip $i"
+ continue
+ fi
+
+ TEMP_PACKAGE=$(cat "$i" | grep "Package:" | cut -d ':' -f2)
+ PACKAGES=$(trim_string "$(echo $TEMP_PACKAGE | tr "," "\n")")
+ TEMP_EXTENSION=$(cat "$i" | grep "Extension:" | cut -d ':' -f2)
+ EXTENSIONS=$(trim_string "$(echo $TEMP_EXTENSION | tr "," "\n")")
+ BUILD_OK=0
+
+ for PACKAGE in $PACKAGES
+ do
+ if [ ! -e $PACKAGE ] && [ "$PACKAGE" = "$BUILD_PACKAGE" ];then
+ # BUILD_OK=1 means this manifest file support current build project
+ BUILD_OK=1
+
+ # find origin file(s) from manifest file
+ for EXTENSION in $EXTENSIONS
+ do
+ echo found \"$PACKAGE\" in $i
+ if [ ! -e $EXTENSION ];then
+ FILE=${i%%.mf}.$EXTENSION
+ else
+ FILE=${i%%.mf}
+ fi
+ if [ ! -f "$FILE" ] ;then
+ echo $FILE does not exist.
+ exit 1
+ fi
+ check_file "$i" "$FILE"
+ done
+ fi
+ done
+ if [ $BUILD_OK -eq 0 ]
+ then
+ echo "cannot find $BUILD_PACKAGE in $i skipped."
+ fi
+ done
+}
+
+build()
+{
+ prepare
+ echo "traverse_manifest $OS_COMMON_DIR"
+ traverse_manifest $OS_COMMON_DIR
+
+ echo "traverse_manifest $ROOTDIR/$TARGET_OS"
+ traverse_manifest $ROOTDIR/$TARGET_OS
+}
+
+install()
+{
+ cd $TMP_DIR
+
+ # make directory structure
+ mkdir -p $BIN_DIR
+
+ # move all files in temp directory into pacakage directory
+ mv * $BIN_DIR/
+}
+
+[ "$1" = "clean" ] && clean
+[ "$1" = "build" ] && build
+[ "$1" = "install" ] && install
+
+echo "success"
diff --git a/package/build.windows-64 b/package/build.windows-64
new file mode 100755
index 0000000..5999e2e
--- /dev/null
+++ b/package/build.windows-64
@@ -0,0 +1,159 @@
+#!/bin/sh -xe
+
+BUILD_ARCH=x86_64
+BUILD_PACKAGE=emulator-common-lib
+BUILD_WS=win32
+META_MF=meta.mf
+TMP_DIR="$SRCDIR/data"
+OS_COMMON_DIR="$ROOTDIR/os-common"
+BIN_DIR="$SRCDIR/package/${BUILD_PACKAGE}.package.${TARGET_OS}/data/tools/emulator/bin/"
+
+clean()
+{
+ rm -rf $SRCDIR/*.zip
+ rm -rf $SRCDIR/*.tar.gz
+}
+
+prepare()
+{
+ if [ ! -d $TMP_DIR ]
+ then
+ echo "make temp directory for emulator install : ( $TMP_DIR )"
+ mkdir $TMP_DIR
+ fi
+}
+
+trim_string()
+{
+ trimmed=$1
+ trimmed=${trimmed%% }
+ trimmed=${trimmed## }
+
+ echo "$trimmed"
+}
+
+contains() {
+ string="$1"
+ substring="$2"
+ if test "${string#*$substring}" != "$string"
+ then
+ echo $substring is in $string
+ else
+ echo $substring is not in $string
+ exit 1
+ fi
+}
+
+# $1: mf file path (e.g. xxx.mf)
+# $2: original binary/library file path (e.g. xxx.dylib)
+check_file()
+{
+ # check arch from mf file
+ ARCHS=$(cat $1 | grep "Arch:" | cut -d ':' -f2)
+ contains "$ARCHS" $BUILD_ARCH
+
+ # check the library or the binary to support build_architecture
+ if [ "$EXTENSION" = "dll" ] && [ "$EXTENSION" = "exe" ] ;then
+ ARCH_RESULT=$(file $2)
+ ARCH_OK=0
+ if test "${ARCH_RESULT#*"64-bit"}" != "$ARCH_RESULT"
+ then
+ echo $ARCH_RESULT is in 64-bit
+ ARCH_OK=1
+ elif test "${ARCH_RESULT#*"32-bit"}" != "$ARCH_RESULT"
+ then
+ echo $ARCH_RESULT is in 32-bit
+ ARCH_OK=1
+ elif test "${ARCH_RESULT#*"PE32"}" != "$ARCH_RESULT"
+ then
+ echo $ARCH_RESULT is in PE32
+ ARCH_OK=1
+ elif test "${ARCH_OK}" == "0"
+ then
+ echo $2 is no architecture.
+ exit 1
+ fi
+ fi
+
+ # check OS
+ OSES=$(cat $i | grep "OS:" | cut -d ':' -f2)
+ contains "$OSES" $TARGET_OS
+
+ # copy file if validation passed.
+ echo "move $2 to $TMP_DIR"
+ mv -f "$2" $TMP_DIR
+}
+
+# $1: root directory for traversing
+traverse_manifest()
+{
+ for i in $(find $1 -iname '*.mf')
+ do
+ # skip if filename is meta.mf it's used for packaging dev
+ if [ "$META_MF" = $(basename $i) ];then
+ echo "skip $i"
+ continue
+ fi
+
+ TEMP_PACKAGE=$(cat "$i" | grep "Package:" | cut -d ':' -f2)
+ PACKAGES=$(trim_string "$(echo $TEMP_PACKAGE | tr "," "\n")")
+ TEMP_EXTENSION=$(cat "$i" | grep "Extension:" | cut -d ':' -f2)
+ EXTENSIONS=$(trim_string "$(echo $TEMP_EXTENSION | tr "," "\n")")
+ BUILD_OK=0
+
+ for PACKAGE in $PACKAGES
+ do
+ if [ ! -e $PACKAGE ] && [ "$PACKAGE" = "$BUILD_PACKAGE" ];then
+ # BUILD_OK=1 means this manifest file support current build project
+ BUILD_OK=1
+
+ # find origin file(s) from manifest file
+ for EXTENSION in $EXTENSIONS
+ do
+ echo found \"$PACKAGE\" in $i
+ if [ ! -e $EXTENSION ];then
+ FILE=${i%%.mf}.$EXTENSION
+ else
+ FILE=${i%%.mf}
+ fi
+ if [ ! -f "$FILE" ] ;then
+ echo $FILE does not exist.
+ exit 1
+ fi
+ check_file "$i" "$FILE"
+ done
+ fi
+ done
+ if [ $BUILD_OK -eq 0 ]
+ then
+ echo "cannot find $BUILD_PACKAGE in $i skipped."
+ fi
+ done
+}
+
+build()
+{
+ prepare
+ echo "traverse_manifest $OS_COMMON_DIR"
+ traverse_manifest $OS_COMMON_DIR
+
+ echo "traverse_manifest $ROOTDIR/$TARGET_OS"
+ traverse_manifest $ROOTDIR/$TARGET_OS
+}
+
+install()
+{
+ cd $TMP_DIR
+
+ # make directory structure
+ mkdir -p $BIN_DIR
+
+ # move all files in temp directory into pacakage directory
+ mv * $BIN_DIR/
+}
+
+[ "$1" = "clean" ] && clean
+[ "$1" = "build" ] && build
+[ "$1" = "install" ] && install
+
+echo "success"
diff --git a/package/changelog b/package/changelog
new file mode 100644
index 0000000..bbdf823
--- /dev/null
+++ b/package/changelog
@@ -0,0 +1,5 @@
+* 1.4.0
+- add macos-64 build scripts for packaging emulator-common-lib
+== Munkyu Im <munkyu.im@samsung.com> 2015-07-15
+- add windows build scripts for packaging emulator-common-lib
+== Jihye Won <jihye.won1@samsung.com> 2015-07-16
diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest
new file mode 100644
index 0000000..699d242
--- /dev/null
+++ b/package/pkginfo.manifest
@@ -0,0 +1,33 @@
+Version : 1.4.0
+Maintainer: Sangho Park <sangho1206.park@samsung.com>
+Source: emulator
+
+Package : emulator-common-lib
+OS : macos-64
+Build-host-os : macos-64
+Build-dependency: 2.4-emulator-library-pool [ ubuntu-32 ]
+Description : common libraries for Tizen Emulator.
+
+Package : emulator-common-lib
+OS : ubuntu-32
+Build-host-os : ubuntu-32
+Build-dependency: 2.4-emulator-library-pool [ ubuntu-32 ]
+Description : common libraries for Tizen Emulator.
+
+Package : emulator-common-lib
+OS : ubuntu-64
+Build-host-os : ubuntu-64
+Build-dependency: 2.4-emulator-library-pool [ ubuntu-32 ]
+Description : common libraries for Tizen Emulator.
+
+Package : emulator-common-lib
+OS : windows-32
+Build-host-os : windows-32
+Build-dependency: 2.4-emulator-library-pool [ ubuntu-32 ]
+Description : common libraries for Tizen Emulator.
+
+Package : emulator-common-lib
+OS : windows-64
+Build-host-os : windows-64
+Build-dependency: 2.4-emulator-library-pool [ ubuntu-32 ]
+Description : common libraries for Tizen Emulator.