[Tizen] Restore behavior of Uploaded and LoadingFinished signal
[platform/core/uifw/dali-toolkit.git] / packaging / dali-toolkit.spec
1 Name:       dali-toolkit
2 Summary:    The OpenGLES Canvas Core Library Toolkit
3 Version:    1.2.41
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache-2.0 and BSD-3-Clause and MIT
7 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-toolkit.git;a=summary
8 Source0:    %{name}-%{version}.tar.gz
9
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12
13 BuildRequires:  pkgconfig
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(dali-core)
16 BuildRequires: gettext
17
18 # dali-toolkit only need to know the interfaces(APIs) of dali-adaptor(the devel package).
19 # It doesn't need to know which adaptor will be used by applications.
20 # Applications or dali-addon will decide which one they will use.
21 BuildRequires:  dali-adaptor-devel
22
23 #need libtzplatform-config for directory if tizen version is 3.x
24
25 %if 0%{?tizen_version_major} >= 3
26 BuildRequires:  pkgconfig(libtzplatform-config)
27 %endif
28
29 #############################
30 # profile setup
31 #############################
32
33 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
34 %define profile %{tizen_profile_name}
35 %endif
36
37 # tv
38 # %define dali_style_folder 1920x1080
39
40 # common
41 %define dali_style_folder 720x1280
42 # 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
43
44 %if "%{?dali_style}"
45   %define dali_style_folder %{dali_style}
46 %endif
47
48 %description
49 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
50 user interface functionality.
51
52 ##############################
53 # resource
54 ##############################
55 %package resources_480x800
56 Summary:    default resource files for 480x800
57 Requires:   %{name} = %{version}-%{release}
58 Conflicts:  %{name}-resources_720x1280
59 Conflicts:  %{name}-resources_1920x1080
60 %description resources_480x800
61 dali-toolkit default resource files for 480x800
62 Contain po / sounds / common images / style / style images
63
64 %package resources_720x1280
65 Summary:    default resource files for 720x1280
66 Requires:   %{name} = %{version}-%{release}
67 Conflicts:  %{name}-resources_480x800
68 Conflicts:  %{name}-resources_1920x1080
69 %description resources_720x1280
70 dali-toolkit default resource files for 720x1280
71 Contain po / sounds / common images / style / style images
72
73 %package resources_1920x1080
74 Summary:    default resource files for 1920x1080
75 Requires:   %{name} = %{version}-%{release}
76 Conflicts:  %{name}-resources_480x800
77 Conflicts:  %{name}-resources_720x1280
78 %description resources_1920x1080
79 dali-toolkit default resource files for 1920x1080
80 Contain po / sounds / common images / style / style images
81
82 ##############################
83 # devel
84 ##############################
85 %package devel
86 Summary:    Application development package for the OpenGLES Canvas toolkit
87 Group:      Development/Building
88 Requires:   %{name} = %{version}-%{release}
89
90 %description devel
91 Application development package for the OpenGLES Canvas toolkit - headers and package config
92
93 ##############################
94 # Preparation
95 ##############################
96 %prep
97 %setup -q
98
99 #Use TZ_PATH when tizen version is 3.x
100
101 %if "%{tizen_version_major}" == "2"
102 %define dali_data_rw_dir            /opt/usr/share/dali/
103 %define dali_data_ro_dir            /usr/share/dali/
104 %else
105 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
106 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
107 %endif
108
109 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
110 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
111 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
112 %define dev_include_path %{_includedir}
113
114 # PO
115 {
116 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
117 for language in *.po
118 do
119   language=${language%.po}
120   msgfmt -o ${language}.mo ${language}.po
121 done
122 } &> /dev/null
123
124 ##############################
125 # Build
126 ##############################
127 %build
128 PREFIX="/usr"
129 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
130 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
131
132 %if 0%{?enable_coverage}
133 CXXFLAGS+=" --coverage "
134 LDFLAGS+=" --coverage "
135 %endif
136
137 libtoolize --force
138 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
139 autoreconf --install
140 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
141 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
142
143 %configure --enable-profile=TIZEN \
144            --with-style=%{dali_style_folder} \
145 %if 0%{?enable_debug}
146            --enable-debug \
147 %endif
148            --enable-i18n=yes
149
150 make %{?jobs:-j%jobs}
151
152 ##############################
153 # Installation
154 ##############################
155 %install
156 rm -rf %{buildroot}
157 pushd build/tizen
158 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
159
160 # PO
161 {
162 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
163 for language in *.mo
164 do
165   language=${language%.mo}
166   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
167   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
168 done
169 } &> /dev/null
170 popd
171
172 # Remove default style and style images which are for Linux build
173 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
174
175 # Make folder to contain style and style images
176 # After making folder, copy local style and style images to new folder
177 mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
178 cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
179 mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
180 cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
181 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
182 cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
183
184 # Copy default feedback theme
185 cp dali-toolkit/styles/default-feedback-theme.json %{buildroot}%{dali_toolkit_style_files}
186
187 ##############################
188 # Post Install
189 ##############################
190 %post
191 /sbin/ldconfig
192 exit 0
193
194 %post resources_480x800
195 pushd %{dali_toolkit_style_files}/480x800
196 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
197 popd
198
199 %post resources_720x1280
200 pushd %{dali_toolkit_style_files}/720x1280
201 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
202 rm -rf ./*
203 popd
204
205 %post resources_1920x1080
206 pushd %{dali_toolkit_style_files}/1920x1080
207 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
208 popd
209
210 ##############################
211 # Pre Uninstall
212 ##############################
213
214 %preun resources_480x800
215 pushd %{dali_toolkit_style_files}
216 mv images ./480x800
217 mv *.json ./480x800
218 popd
219
220 %preun resources_720x1280
221 pushd %{dali_toolkit_style_files}
222 mv images ./720x1280
223 mv *.json ./720x1280
224 popd
225
226 %preun resources_1920x1080
227 pushd %{dali_toolkit_style_files}
228 mv images ./1920x1080
229 mv *.json ./1920x1080
230 popd
231
232 ##############################
233 # Post Uninstall
234 ##############################
235 %postun
236 /sbin/ldconfig
237 exit 0
238
239 %postun resources_480x800
240 pushd %{dali_toolkit_style_files}
241 rm -rf 480x800
242 popd
243
244 %postun resources_720x1280
245 pushd %{dali_toolkit_style_files}
246 rm -rf 720x1280
247 popd
248
249 %postun resources_1920x1080
250 pushd %{dali_toolkit_style_files}
251 rm -rf 1920x1080
252 popd
253
254 ##############################
255 # Files in Binary Packages
256 ##############################
257 %files
258 %if 0%{?enable_dali_smack_rules}
259 %manifest dali-toolkit.manifest-smack
260 %else
261 %manifest dali-toolkit.manifest
262 %endif
263 %defattr(-,root,root,-)
264 %{_libdir}/lib%{name}.so*
265 %license LICENSE
266
267 %files devel
268 %defattr(-,root,root,-)
269 %{dev_include_path}/%{name}/*
270 %{_libdir}/pkgconfig/*.pc
271
272 %files resources_480x800
273 %manifest dali-toolkit-resources.manifest
274 %defattr(-,root,root,-)
275 %{dali_toolkit_image_files}/*
276 %{dali_toolkit_sound_files}/*
277 %{dali_toolkit_style_files}/480x800/*
278 %{dali_toolkit_style_files}/default-feedback-theme.json
279 %{_datadir}/locale/*/LC_MESSAGES/*
280
281 %files resources_720x1280
282 %manifest dali-toolkit-resources.manifest
283 %defattr(-,root,root,-)
284 %{dali_toolkit_image_files}/*
285 %{dali_toolkit_sound_files}/*
286 %{dali_toolkit_style_files}/720x1280/*
287 %{dali_toolkit_style_files}/default-feedback-theme.json
288 %{_datadir}/locale/*/LC_MESSAGES/*
289
290 %files resources_1920x1080
291 %manifest dali-toolkit-resources.manifest
292 %defattr(-,root,root,-)
293 %{dali_toolkit_image_files}/*
294 %{dali_toolkit_sound_files}/*
295 %{dali_toolkit_style_files}/1920x1080/*
296 %{dali_toolkit_style_files}/default-feedback-theme.json
297 %{_datadir}/locale/*/LC_MESSAGES/*