a5ee4a318c7d785bf771314976a4837b8d549c50
[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.55
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 dali-toolkit-default-theme.json ./480x800
236 popd
237
238 %preun resources_720x1280
239 pushd %{dali_toolkit_style_files}
240 mv images ./720x1280
241 mv dali-toolkit-default-theme.json ./720x1280
242 popd
243
244 %preun resources_1920x1080
245 pushd %{dali_toolkit_style_files}
246 mv images ./1920x1080
247 mv dali-toolkit-default-theme.json ./1920x1080
248 popd
249
250 ##############################
251 # Post Uninstall
252 ##############################
253 %postun
254 /sbin/ldconfig
255 exit 0
256
257 %postun resources_480x800
258 case "$1" in
259   0)
260     pushd %{dali_toolkit_style_files}
261     rm -rf *
262     popd
263   ;;
264 esac
265
266 %postun resources_720x1280
267 case "$1" in
268   0)
269     pushd %{dali_toolkit_style_files}
270     rm -rf *
271     popd
272   ;;
273 esac
274
275 %postun resources_1920x1080
276 case "$1" in
277   0)
278     pushd %{dali_toolkit_style_files}
279     rm -rf *
280     popd
281   ;;
282 esac
283
284 ##############################
285 # Files in Binary Packages
286 ##############################
287 %files
288 %if 0%{?enable_dali_smack_rules}
289 %manifest dali-toolkit.manifest-smack
290 %else
291 %manifest dali-toolkit.manifest
292 %endif
293 %defattr(-,root,root,-)
294 %{_libdir}/lib%{name}.so*
295 %license LICENSE
296
297 %files devel
298 %defattr(-,root,root,-)
299 %{dev_include_path}/%{name}/*
300 %{_libdir}/pkgconfig/*.pc
301
302 %files resources_480x800
303 %manifest dali-toolkit-resources.manifest
304 %defattr(-,root,root,-)
305 %{dali_toolkit_image_files}/*
306 %{dali_toolkit_sound_files}/*
307 %{dali_toolkit_style_files}/480x800/*
308 %{dali_toolkit_style_files}/default-feedback-theme.json
309 %{_datadir}/locale/*/LC_MESSAGES/*
310
311 %files resources_720x1280
312 %manifest dali-toolkit-resources.manifest
313 %defattr(-,root,root,-)
314 %{dali_toolkit_image_files}/*
315 %{dali_toolkit_sound_files}/*
316 %{dali_toolkit_style_files}/720x1280/*
317 %{dali_toolkit_style_files}/default-feedback-theme.json
318 %{_datadir}/locale/*/LC_MESSAGES/*
319
320 %files resources_1920x1080
321 %manifest dali-toolkit-resources.manifest
322 %defattr(-,root,root,-)
323 %{dali_toolkit_image_files}/*
324 %{dali_toolkit_sound_files}/*
325 %{dali_toolkit_style_files}/1920x1080/*
326 %{dali_toolkit_style_files}/default-feedback-theme.json
327 %{_datadir}/locale/*/LC_MESSAGES/*