Packaging resources depending on resolution 67/128467/2
authorminho.sun <minho.sun@samsung.com>
Fri, 28 Apr 2017 01:44:07 +0000 (10:44 +0900)
committerminho.sun <minho.sun@samsung.com>
Wed, 10 May 2017 09:17:54 +0000 (18:17 +0900)
Packaging resources depending on resolution.
dali-toolkit rpm doesn't have default resources anymore.

To use default resources, install dali-toolkit-resources_*.rpm.

Change-Id: I9e4d96dfbbb18f00a2bbca0970b575c1f1b85033
Signed-off-by: minho.sun <minho.sun@samsung.com>
dali-toolkit-resources.manifest [new file with mode: 0644]
packaging/dali-toolkit.spec

diff --git a/dali-toolkit-resources.manifest b/dali-toolkit-resources.manifest
new file mode 100644 (file)
index 0000000..97e8c31
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
index 00be5955692bfcdf44749ee8fe7eb08700c97b19..71e77229c7b58f2443046fd4e6fbff1760fc520b 100644 (file)
@@ -53,6 +53,36 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
 user interface functionality.
 
+##############################
+# resource
+##############################
+%package resources_480x800
+Summary:    default resource files for 480x800
+Requires:   %{name} = %{version}-%{release}
+Conflicts:  %{name}-resources_720x1280
+Conflicts:  %{name}-resources_1920x1080
+%description resources_480x800
+dali-toolkit default resource files for 480x800
+Contain po / sounds / common images / style / style images
+
+%package resources_720x1280
+Summary:    default resource files for 720x1280
+Requires:   %{name} = %{version}-%{release}
+Conflicts:  %{name}-resources_480x800
+Conflicts:  %{name}-resources_1920x1080
+%description resources_720x1280
+dali-toolkit default resource files for 720x1280
+Contain po / sounds / common images / style / style images
+
+%package resources_1920x1080
+Summary:    default resource files for 1920x1080
+Requires:   %{name} = %{version}-%{release}
+Conflicts:  %{name}-resources_480x800
+Conflicts:  %{name}-resources_720x1280
+%description resources_1920x1080
+dali-toolkit default resource files for 1920x1080
+Contain po / sounds / common images / style / style images
+
 ##############################
 # devel
 ##############################
@@ -128,10 +158,9 @@ 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}"
 
-
 # PO
 {
 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
@@ -142,6 +171,19 @@ do
   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
 done
 } &> /dev/null
+popd
+
+# Remove default style and style images which are for Linux build
+rm -rf %{buildroot}%{dali_toolkit_style_files}/*
+
+# Make folder to contain style and style images
+# After making folder, copy local style and style images to new folder
+mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
+cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
+mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
+cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
+mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
+cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
 
 ##############################
 # Post Install
@@ -150,6 +192,44 @@ done
 /sbin/ldconfig
 exit 0
 
+%post resources_480x800
+pushd %{dali_toolkit_style_files}/480x800
+for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
+popd
+
+%post resources_720x1280
+pushd %{dali_toolkit_style_files}/720x1280
+for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
+rm -rf ./*
+popd
+
+%post resources_1920x1080
+pushd %{dali_toolkit_style_files}/1920x1080
+for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
+popd
+
+##############################
+# Pre Uninstall
+##############################
+
+%preun resources_480x800
+pushd %{dali_toolkit_style_files}
+mv images ./480x800
+mv *.json ./480x800
+popd
+
+%preun resources_720x1280
+pushd %{dali_toolkit_style_files}
+mv images ./720x1280
+mv *.json ./720x1280
+popd
+
+%preun resources_1920x1080
+pushd %{dali_toolkit_style_files}
+mv images ./1920x1080
+mv *.json ./1920x1080
+popd
+
 ##############################
 # Post Uninstall
 ##############################
@@ -157,6 +237,21 @@ exit 0
 /sbin/ldconfig
 exit 0
 
+%postun resources_480x800
+pushd %{dali_toolkit_style_files}
+rm -rf 480x800
+popd
+
+%postun resources_720x1280
+pushd %{dali_toolkit_style_files}
+rm -rf 720x1280
+popd
+
+%postun resources_1920x1080
+pushd %{dali_toolkit_style_files}
+rm -rf 1920x1080
+popd
+
 ##############################
 # Files in Binary Packages
 ##############################
@@ -168,13 +263,33 @@ exit 0
 %endif
 %defattr(-,root,root,-)
 %{_libdir}/lib%{name}.so*
-%{dali_toolkit_image_files}/*
-%{dali_toolkit_sound_files}/*
-%{dali_toolkit_style_files}/*
 %license LICENSE
-%{_datadir}/locale/*/LC_MESSAGES/*
 
 %files devel
 %defattr(-,root,root,-)
 %{dev_include_path}/%{name}/*
 %{_libdir}/pkgconfig/*.pc
+
+%files resources_480x800
+%manifest dali-toolkit-resources.manifest
+%defattr(-,root,root,-)
+%{dali_toolkit_image_files}/*
+%{dali_toolkit_sound_files}/*
+%{dali_toolkit_style_files}/480x800/*
+%{_datadir}/locale/*/LC_MESSAGES/*
+
+%files resources_720x1280
+%manifest dali-toolkit-resources.manifest
+%defattr(-,root,root,-)
+%{dali_toolkit_image_files}/*
+%{dali_toolkit_sound_files}/*
+%{dali_toolkit_style_files}/720x1280/*
+%{_datadir}/locale/*/LC_MESSAGES/*
+
+%files resources_1920x1080
+%manifest dali-toolkit-resources.manifest
+%defattr(-,root,root,-)
+%{dali_toolkit_image_files}/*
+%{dali_toolkit_sound_files}/*
+%{dali_toolkit_style_files}/1920x1080/*
+%{_datadir}/locale/*/LC_MESSAGES/*