Merge "Fixed texture-manager crash for async load complete" into devel/master
[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.44
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 # Post Install
177 ##############################
178 %post
179 /sbin/ldconfig
180 exit 0
181
182 %post resources_480x800
183 pushd %{dali_toolkit_style_files}/480x800
184 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
185 popd
186
187 %post resources_720x1280
188 pushd %{dali_toolkit_style_files}/720x1280
189 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
190 rm -rf ./*
191 popd
192
193 %post resources_1920x1080
194 pushd %{dali_toolkit_style_files}/1920x1080
195 for FILE in *; do mv ./"${FILE}" ../"${FILE}"; done
196 popd
197
198 ##############################
199 # Pre Uninstall
200 ##############################
201
202 %preun resources_480x800
203 pushd %{dali_toolkit_style_files}
204 mv images ./480x800
205 mv *.json ./480x800
206 popd
207
208 %preun resources_720x1280
209 pushd %{dali_toolkit_style_files}
210 mv images ./720x1280
211 mv *.json ./720x1280
212 popd
213
214 %preun resources_1920x1080
215 pushd %{dali_toolkit_style_files}
216 mv images ./1920x1080
217 mv *.json ./1920x1080
218 popd
219
220 ##############################
221 # Post Uninstall
222 ##############################
223 %postun
224 /sbin/ldconfig
225 exit 0
226
227 %postun resources_480x800
228 pushd %{dali_toolkit_style_files}
229 rm -rf 480x800
230 popd
231
232 %postun resources_720x1280
233 pushd %{dali_toolkit_style_files}
234 rm -rf 720x1280
235 popd
236
237 %postun resources_1920x1080
238 pushd %{dali_toolkit_style_files}
239 rm -rf 1920x1080
240 popd
241
242 ##############################
243 # Files in Binary Packages
244 ##############################
245 %files
246 %if 0%{?enable_dali_smack_rules}
247 %manifest dali-toolkit.manifest-smack
248 %else
249 %manifest dali-toolkit.manifest
250 %endif
251 %defattr(-,root,root,-)
252 %{_libdir}/lib%{name}.so*
253 %license LICENSE
254
255 %files devel
256 %defattr(-,root,root,-)
257 %{dev_include_path}/%{name}/*
258 %{_libdir}/pkgconfig/*.pc
259
260 %files resources_480x800
261 %manifest dali-toolkit-resources.manifest
262 %defattr(-,root,root,-)
263 %{dali_toolkit_image_files}/*
264 %{dali_toolkit_sound_files}/*
265 %{dali_toolkit_style_files}/480x800/*
266 %{dali_toolkit_style_files}/default-feedback-theme.json
267 %{_datadir}/locale/*/LC_MESSAGES/*
268
269 %files resources_720x1280
270 %manifest dali-toolkit-resources.manifest
271 %defattr(-,root,root,-)
272 %{dali_toolkit_image_files}/*
273 %{dali_toolkit_sound_files}/*
274 %{dali_toolkit_style_files}/720x1280/*
275 %{dali_toolkit_style_files}/default-feedback-theme.json
276 %{_datadir}/locale/*/LC_MESSAGES/*
277
278 %files resources_1920x1080
279 %manifest dali-toolkit-resources.manifest
280 %defattr(-,root,root,-)
281 %{dali_toolkit_image_files}/*
282 %{dali_toolkit_sound_files}/*
283 %{dali_toolkit_style_files}/1920x1080/*
284 %{dali_toolkit_style_files}/default-feedback-theme.json
285 %{_datadir}/locale/*/LC_MESSAGES/*