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