Merge "Ensure text-controller returns false when it doesn't use key." into devel...
[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.49
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 %description
38 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
39 user interface functionality.
40
41 ##############################
42 # resource
43 ##############################
44 %package resources_480x800
45 Summary:    default resource files for 480x800
46 Requires:   %{name} = %{version}-%{release}
47 Conflicts:  %{name}-resources_720x1280
48 Conflicts:  %{name}-resources_1920x1080
49 %description resources_480x800
50 dali-toolkit default resource files for 480x800
51 Contain po / sounds / common images / style / style images
52
53 %package resources_720x1280
54 Summary:    default resource files for 720x1280
55 Requires:   %{name} = %{version}-%{release}
56 Conflicts:  %{name}-resources_480x800
57 Conflicts:  %{name}-resources_1920x1080
58 %description resources_720x1280
59 dali-toolkit default resource files for 720x1280
60 Contain po / sounds / common images / style / style images
61
62 %package resources_1920x1080
63 Summary:    default resource files for 1920x1080
64 Requires:   %{name} = %{version}-%{release}
65 Conflicts:  %{name}-resources_480x800
66 Conflicts:  %{name}-resources_720x1280
67 %description resources_1920x1080
68 dali-toolkit default resource files for 1920x1080
69 Contain po / sounds / common images / style / style images
70
71 ##############################
72 # devel
73 ##############################
74 %package devel
75 Summary:    Application development package for the OpenGLES Canvas toolkit
76 Group:      Development/Building
77 Requires:   %{name} = %{version}-%{release}
78
79 %description devel
80 Application development package for the OpenGLES Canvas toolkit - headers and package config
81
82 ##############################
83 # Preparation
84 ##############################
85 %prep
86 %setup -q
87
88 #Use TZ_PATH when tizen version is 3.x
89
90 %if "%{tizen_version_major}" == "2"
91 %define dali_data_rw_dir            /opt/usr/share/dali/
92 %define dali_data_ro_dir            /usr/share/dali/
93 %else
94 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
95 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
96 %endif
97
98 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
99 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
100 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
101 %define dev_include_path %{_includedir}
102
103 # PO
104 {
105 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
106 for language in *.po
107 do
108   language=${language%.po}
109   msgfmt -o ${language}.mo ${language}.po
110 done
111 } &> /dev/null
112
113 ##############################
114 # Build
115 ##############################
116 %build
117 PREFIX="/usr"
118 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
119 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
120
121 %if 0%{?enable_coverage}
122 CXXFLAGS+=" --coverage "
123 LDFLAGS+=" --coverage "
124 %endif
125
126 libtoolize --force
127 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
128 autoreconf --install
129 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
130 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
131
132 %configure --enable-profile=TIZEN \
133 %if 0%{?enable_debug}
134            --enable-debug \
135 %endif
136            --enable-i18n=yes
137
138 make %{?jobs:-j%jobs}
139
140 ##############################
141 # Installation
142 ##############################
143 %install
144 rm -rf %{buildroot}
145 pushd build/tizen
146 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
147
148 # PO
149 {
150 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
151 for language in *.mo
152 do
153   language=${language%.mo}
154   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
155   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
156 done
157 } &> /dev/null
158 popd
159
160 # Remove default style and style images which are for Linux build
161 rm -rf %{buildroot}%{dali_toolkit_style_files}/*
162
163 # Make folder to contain style and style images
164 # After making folder, copy local style and style images to new folder
165 mkdir -p %{buildroot}%{dali_toolkit_style_files}/480x800
166 cp -r dali-toolkit/styles/480x800/* %{buildroot}%{dali_toolkit_style_files}/480x800
167 mkdir -p %{buildroot}%{dali_toolkit_style_files}/720x1280
168 cp -r dali-toolkit/styles/720x1280/* %{buildroot}%{dali_toolkit_style_files}/720x1280
169 mkdir -p %{buildroot}%{dali_toolkit_style_files}/1920x1080
170 cp -r dali-toolkit/styles/1920x1080/* %{buildroot}%{dali_toolkit_style_files}/1920x1080
171
172 # Copy default feedback theme
173 cp dali-toolkit/styles/default-feedback-theme.json %{buildroot}%{dali_toolkit_style_files}
174
175 ##############################
176 # Pre Install
177 ##############################
178
179 %pre resources_480x800
180 case "$1" in
181   2)
182     pushd %{dali_toolkit_style_files}
183     rm -rf ./*
184     popd
185   ;;
186 esac
187
188 %pre resources_720x1280
189 case "$1" in
190   2)
191     pushd %{dali_toolkit_style_files}
192     rm -rf ./*
193     popd
194   ;;
195 esac
196
197 %pre resources_1920x1080
198 case "$1" in
199   2)
200     pushd %{dali_toolkit_style_files}
201     rm -rf ./*
202     popd
203   ;;
204 esac
205
206 ##############################
207 # Post Install
208 ##############################
209 %post
210 /sbin/ldconfig
211 exit 0
212
213 %post resources_480x800
214 pushd %{dali_toolkit_style_files}/480x800
215 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
216 popd
217
218 %post resources_720x1280
219 pushd %{dali_toolkit_style_files}/720x1280
220 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
221 popd
222
223 %post resources_1920x1080
224 pushd %{dali_toolkit_style_files}/1920x1080
225 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
226 popd
227
228 ##############################
229 # Pre Uninstall
230 ##############################
231
232 %preun resources_480x800
233 pushd %{dali_toolkit_style_files}
234 mv images ./480x800
235 mv *.json ./480x800
236 popd
237
238 %preun resources_720x1280
239 pushd %{dali_toolkit_style_files}
240 mv images ./720x1280
241 mv *.json ./720x1280
242 popd
243
244 %preun resources_1920x1080
245 pushd %{dali_toolkit_style_files}
246 mv images ./1920x1080
247 mv *.json ./1920x1080
248 popd
249
250 ##############################
251 # Post Uninstall
252 ##############################
253 %postun
254 /sbin/ldconfig
255 exit 0
256
257 %postun resources_480x800
258 pushd %{dali_toolkit_style_files}
259 rm -rf *
260 popd
261
262 %postun resources_720x1280
263 pushd %{dali_toolkit_style_files}
264 rm -rf *
265 popd
266
267 %postun resources_1920x1080
268 pushd %{dali_toolkit_style_files}
269 rm -rf *
270 popd
271
272 ##############################
273 # Files in Binary Packages
274 ##############################
275 %files
276 %if 0%{?enable_dali_smack_rules}
277 %manifest dali-toolkit.manifest-smack
278 %else
279 %manifest dali-toolkit.manifest
280 %endif
281 %defattr(-,root,root,-)
282 %{_libdir}/lib%{name}.so*
283 %license LICENSE
284
285 %files devel
286 %defattr(-,root,root,-)
287 %{dev_include_path}/%{name}/*
288 %{_libdir}/pkgconfig/*.pc
289
290 %files resources_480x800
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}/480x800/*
296 %{dali_toolkit_style_files}/default-feedback-theme.json
297 %{_datadir}/locale/*/LC_MESSAGES/*
298
299 %files resources_720x1280
300 %manifest dali-toolkit-resources.manifest
301 %defattr(-,root,root,-)
302 %{dali_toolkit_image_files}/*
303 %{dali_toolkit_sound_files}/*
304 %{dali_toolkit_style_files}/720x1280/*
305 %{dali_toolkit_style_files}/default-feedback-theme.json
306 %{_datadir}/locale/*/LC_MESSAGES/*
307
308 %files resources_1920x1080
309 %manifest dali-toolkit-resources.manifest
310 %defattr(-,root,root,-)
311 %{dali_toolkit_image_files}/*
312 %{dali_toolkit_sound_files}/*
313 %{dali_toolkit_style_files}/1920x1080/*
314 %{dali_toolkit_style_files}/default-feedback-theme.json
315 %{_datadir}/locale/*/LC_MESSAGES/*