Updating version to 6.5
[sdk/emulator/qemu.git] / package / build.common
1 # build_common
2 prepare_common()
3 {
4         if [ "$JAVA_HOME" = "" ]
5         then
6                 echo "Make sure that you have installed JDK"
7                 echo "and then set installed JDK/bin path into JAVA_HOME"
8                 echo "as a system environment variable on your PC!!"
9                 exit 1
10         fi
11 }
12
13 build_common()
14 {
15         prepare_common
16         prepare
17
18         TIZEN_SDK_DEV_PATH=${ROOTDIR}
19         PATH=${TIZEN_SDK_DEV_PATH}/bin:${PATH}
20
21         cd ${SRCDIR}/tizen
22
23         TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ./emulator_configure.sh x86_64
24
25         make clean
26         PATH=${PATH} make all -j8
27         make install
28
29         if [ $? -eq 0 ]
30         then
31                 echo "x86 build success"
32         else
33                 echo "x86 build failure"
34                 exit 1
35         fi
36 }
37
38 # install_common
39 install_common()
40 {
41         TIZEN_VERSIONS="6.5"
42
43         for VER in ${TIZEN_VERSIONS} ; do
44                 # emulator
45                 EMULATOR_COMMON_DIR=$SRCDIR/package/$VER-emulator-qemu-common.package.${TARGET_OS}/data/platforms/tizen-$VER/common
46                 mkdir -p $EMULATOR_COMMON_DIR
47                 # we have nothing for common now
48
49                 EMULATOR_X86_DIR=$SRCDIR/package/$VER-emulator-qemu-x86.package.${TARGET_OS}/data/platforms/tizen-$VER/common
50
51                 mkdir -p $EMULATOR_X86_DIR
52                 cp -pPR $SRCDIR/tizen/emulator $EMULATOR_X86_DIR/emulator
53
54                 # make install/remove script, depending on the version
55                 ORIGIN_INSTALL_FILE=$SRCDIR/package/emulator-qemu-x86.install.$TARGET_OS_CATEGORY
56                 ORIGIN_REMOVE_FILE=$SRCDIR/package/emulator-qemu-x86.remove.$TARGET_OS_CATEGORY
57                 TARTGET_INSTALL_FILE=$SRCDIR/package/$VER-emulator-qemu-x86.install.$TARGET_OS_CATEGORY
58                 TARTGET_REMOVE_FILE=$SRCDIR/package/$VER-emulator-qemu-x86.remove.$TARGET_OS_CATEGORY
59                 if [ -e "$ORIGIN_INSTALL_FILE" ] ; then
60                         cp -p "$ORIGIN_INSTALL_FILE" "$TARTGET_INSTALL_FILE"
61                         # Replace existing version to inputted version.
62                         # To apply some variables to 'sed' command,
63                         # you must enclose expressions in double quotes("").
64                         # -i'' option means that does not make backup file, it must have an extension in macOS.
65                         sed -i'' -e "s/tizen-x.x/tizen-$VER/g" "$TARTGET_INSTALL_FILE"
66                 fi
67                 if [ -e "$ORIGIN_REMOVE_FILE" ] ; then
68                         cp -p "$ORIGIN_REMOVE_FILE" "$TARTGET_REMOVE_FILE"
69                         # Replace existing version to inputted version.
70                         # Now it is not necessary. Uncomment the line below if necessary.
71                         #sed -i'' -e "s/tizen-x.x/tizen-$VER/g" "$TARTGET_INSTALL_FILE"
72                 fi
73         done
74 }