[Tizen] Remove profile build dependencies 69/111969/8 accepted/tizen/common/20170223.182641 accepted/tizen/ivi/20170220.224124 accepted/tizen/mobile/20170220.223525 accepted/tizen/tv/20170220.223919 accepted/tizen/wearable/20170220.224029 submit/tizen/20170220.003759 submit/tizen_common/20170223.092744
authorhk57.kim <hk57.kim@samsung.com>
Wed, 25 Jan 2017 07:19:53 +0000 (16:19 +0900)
committerjerry kim <hk57.kim@samsung.com>
Wed, 15 Feb 2017 05:46:42 +0000 (21:46 -0800)
- This is for Tizen 4.0.
- Added backward-compatibility that does not deteriorate 4.0 Configurability

- When you SR this, you need to create JIRA-TRE issue of:
  : add dali-toolkit-extension-tv for TV

(It's add, not replace.)

Change-Id: I14f4aa56b860e20bdda4f4c20838e5a784c76188
Signed-off-by: hk57.kim <hk57.kim@samsung.com>
build/tizen/configure.ac
packaging/dali-toolkit.spec

index f12ab89..c1c6632 100755 (executable)
@@ -89,7 +89,7 @@ fi
 
 # Tizen Profile options
 AC_ARG_ENABLE([profile],
-              [AC_HELP_STRING([--enable-profile=UBUNTU,MOBILE,WEARABLE,TV],
+              [AC_HELP_STRING([--enable-profile=UBUNTU,TIZEN],
                             [Select the variant of tizen])],
               [dali_profile=$enableval],
               [dali_profile=UBUNTU])
@@ -99,10 +99,10 @@ AC_ARG_WITH(style,
               [AC_HELP_STRING([--with-style],
                             [Select the style folder to use])],
               [dali_style=$withval],
-              [dali_style=480x800])
+              [dali_style=720x1280])
 
 # Ensure valid profile selected
-if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xMOBILE" -a "x$dali_profile" != "xWEARABLE" -a "x$dali_profile" != "xTV" ; then
+if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xTIZEN"; then
   AC_MSG_ERROR([$enable_profile is an invalid profile])
 fi
 
index d8dc151..4d35dee 100644 (file)
@@ -22,7 +22,7 @@ BuildRequires:  dali-adaptor-devel
 
 #need libtzplatform-config for directory if tizen version is 3.x
 
-%if "%{tizen_version_major}" == "3"
+%if 0%{?tizen_version_major} >= 3
 BuildRequires:  pkgconfig(libtzplatform-config)
 %endif
 
@@ -34,14 +34,12 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 %define profile %{tizen_profile_name}
 %endif
 
-%if "%{profile}" == "tv"
-%define dali_toolkit_profile TV
-%define dali_style_folder 1920x1080
-%else
-%define dali_toolkit_profile MOBILE
+# tv
+# %define dali_style_folder 1920x1080
+
+# common
 %define dali_style_folder 720x1280
 # dali_style to be provided by build system as with dali_toolkit_profile or by passing --define 'dali_style 470x800' to the rpm build command
-%endif
 
 %if "%{?dali_style}"
   %define dali_style_folder %{dali_style}
@@ -51,6 +49,16 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
 user interface functionality.
 
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if tv ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
+%package extension-tv
+Summary:    style files for Tizen TV (1920x1080)
+Requires:   %{name} = %{version}-%{release}
+%description extension-tv
+dali-toolkit style files for Tizen TV (1920x1080)
+%endif
+
 ##############################
 # devel
 ##############################
@@ -112,7 +120,7 @@ autoreconf --install
 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
 
-%configure --enable-profile=%{dali_toolkit_profile} \
+%configure --enable-profile=TIZEN \
            --with-style=%{dali_style_folder} \
 %if 0%{?enable_debug}
            --enable-debug \
@@ -126,7 +134,7 @@ make %{?jobs:-j%jobs}
 ##############################
 %install
 rm -rf %{buildroot}
-cd build/tizen
+pushd build/tizen
 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
 
 # LICENSE
@@ -143,6 +151,23 @@ do
   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
 done
 } &> /dev/null
+popd
+
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if tv ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
+# 720x1280/images/*.png files are exactly same with 1920x1080/images/*.png
+# if not, copy them as same as dali-toolkit/styles/1920x1080/*.json
+# cp dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
+cp dali-toolkit/styles/1920x1080/*.json %{buildroot}%{dali_toolkit_style_files}/1920x1080
+
+# Do not let style package files be overwritten by the main package
+#pushd %{buildroot}%{dali_toolkit_style_files}/1920x1080
+#for FILE in *.json; do rm -f ../"${FILE}"; done
+#popd
+
+%endif
 
 ##############################
 # Post Install
@@ -172,6 +197,8 @@ exit 0
 %{dali_toolkit_image_files}/*
 %{dali_toolkit_sound_files}/*
 %{dali_toolkit_style_files}/*
+%exclude %{dali_toolkit_style_files}/1920x1080
+# 720x1280/images/*.png files are exactly same with 1920x1080/images/*.png
 %{_datadir}/license/%{name}
 %{_datadir}/locale/*/LC_MESSAGES/*
 
@@ -179,3 +206,29 @@ exit 0
 %defattr(-,root,root,-)
 %{dev_include_path}/%{name}/*
 %{_libdir}/pkgconfig/*.pc
+
+# This is for backward-compatibility. This does not deteriorate 4.0 Configurability
+# if tv ||"undefined"
+%if "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
+%post extension-tv
+pushd %{dali_toolkit_style_files}/1920x1080
+for FILE in *.json; do mv 1920x1080/"${FILE}" ../"${FILE}"; done
+popd
+
+%preun extension-tv
+case "$1" in
+  0)
+    # This is an un-installation.
+    pushd %{dali_toolkit_style_files}
+       for FILE in *.json; do mv 1920x1080/"${FILE}"; done
+       popd
+  ;;
+  1)
+    # This is an upgrade.
+    # Do nothing.
+    :
+  ;;
+esac
+%files extension-tv
+%{dali_toolkit_style_files}/1920x1080/*
+%endif