DALi Version 1.3.43
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    DALi 3D Engine
3 Version:    1.3.43
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-core.git;a=summary
8 Source0:    %{name}-%{version}.tar.gz
9
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12 BuildRequires:  pkgconfig
13 BuildRequires:  gawk
14
15 %if 0%{?tizen_version_major} >= 3
16 BuildRequires:  pkgconfig(libtzplatform-config)
17 %endif
18
19 %if 0%{?tizen_version_major} < 4
20 %define disable_cxx03_build 1
21 %endif
22
23 %description
24 DALi 3D Engine
25
26 %if !0%{?disable_cxx03_build}
27 ##############################
28 # cxx03
29 ##############################
30 %package cxx03
31 Summary:        DALi 3D Engine with cxx03 abi
32 Provides:       %{name}-cxx03 = %{version}-%{release}
33
34 %description cxx03
35 DALi 3D Engine with cxx03 abi with cxx03 abi
36
37 ##############################
38 # devel-cxx03
39 ##############################
40 %package devel-cxx03
41 Summary:    Development components for DALi 3D Engine with cxx03 abi
42 Group:      Development/Building
43 Requires:   %{name}-cxx03 = %{version}-%{release}
44 Requires:   %{name}-integration-devel-cxx03 = %{version}-%{release}
45
46 %description devel-cxx03
47 Development components for DALi 3D Engine - public headers and package config
48
49 ##############################
50 # integration-devel-cxx03
51 ##############################
52 %package integration-devel-cxx03
53 Summary:    Integration development package for DALi 3D Engine witch cxx03 abi
54 Group:      Development/Building
55 Requires:   %{name}-cxx03 = %{version}-%{release}
56
57 %description integration-devel-cxx03
58 Integration development package for DALi 3D Engine - headers for integrating with an adaptor/platform abstraction library.
59 %endif
60
61 ##############################
62 # devel
63 ##############################
64 %package devel
65 Summary:    Development components for DALi 3D Engine
66 Group:      Development/Building
67 Requires:   %{name} = %{version}-%{release}
68 Requires:   %{name}-integration-devel = %{version}-%{release}
69
70 %description devel
71 Development components for DALi 3D Engine - public headers and package config
72
73 ##############################
74 # integration-devel
75 ##############################
76 %package integration-devel
77 Summary:    Integration development package for DALi 3D Engine
78 Group:      Development/Building
79 Requires:   %{name} = %{version}-%{release}
80
81 %description integration-devel
82 Integration development package for DALi 3D Engine - headers for integrating with an adaptor/platform abstraction library.
83
84 ##############################
85 # Preparation
86 ##############################
87 %prep
88 %setup -q
89
90 #Use TZ_PATH when tizen version is 3.x
91
92 %if "%{tizen_version_major}" == "2"
93 %define dali_data_rw_dir /opt/usr/share/dali/
94 %define dali_data_ro_dir /usr/share/dali/
95 %else
96 %define dali_data_rw_dir %TZ_SYS_SHARE/dali/
97 %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
98 %endif
99
100 %define dev_include_path %{_includedir}
101
102 ##############################
103 # Build
104 ##############################
105 %build
106 PREFIX="/usr"
107 CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
108 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -Wl,-Bsymbolic-functions "
109
110 %ifarch %{arm}
111 CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
112 %endif
113
114 %if 0%{?enable_coverage}
115 CXXFLAGS+=" --coverage "
116 LDFLAGS+=" --coverage "
117 %endif
118
119 libtoolize --force
120 cd %{_builddir}/%{name}-%{version}/build/tizen
121 autoreconf --install
122 DALI_DATA_RW_DIR="%{dali_data_rw_dir}"
123 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
124 export DALI_DATA_RW_DIR
125 export DALI_DATA_RO_DIR
126
127 # Default to GLES 2.0 if not specified.
128 %{!?target_gles_version: %define target_gles_version 20}
129
130 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
131 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
132 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
133
134 ./configure \
135       --program-prefix=%{?_program_prefix} \
136       --prefix=%{_prefix} \
137       --exec-prefix=%{_exec_prefix} \
138       --bindir=%{_bindir} \
139       --sbindir=%{_sbindir} \
140       --sysconfdir=%{_sysconfdir} \
141       --datadir=%{_datadir} \
142       --includedir=%{_includedir} \
143       --libdir=%{_libdir} \
144       --libexecdir=%{_libexecdir} \
145       --localstatedir=%{_localstatedir} \
146       --sharedstatedir=%{_sharedstatedir} \
147       --mandir=%{_mandir} \
148       --enable-gles=%{target_gles_version} \
149 %if 0%{?enable_debug}
150       --enable-debug \
151 %endif
152 %if 0%{?enable_trace}
153       --enable-trace \
154 %endif
155       --infodir=%{_infodir} \
156       --enable-rename-so=no
157
158 make %{?jobs:-j%jobs}
159
160 pushd %{_builddir}/%{name}-%{version}/build/tizen
161 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
162 popd
163
164 pushd %{buildroot}%{_libdir}
165 for FILE in libdali-core-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
166 mv pkgconfig/dali-core.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-core.pc
167 popd
168
169 %if !0%{?disable_cxx03_build}
170 make clean
171
172 ./configure \
173       --program-prefix=%{?_program_prefix} \
174       --prefix=%{_prefix} \
175       --exec-prefix=%{_exec_prefix} \
176       --bindir=%{_bindir} \
177       --sbindir=%{_sbindir} \
178       --sysconfdir=%{_sysconfdir} \
179       --datadir=%{_datadir} \
180       --includedir=%{_includedir} \
181       --libdir=%{_libdir} \
182       --libexecdir=%{_libexecdir} \
183       --localstatedir=%{_localstatedir} \
184       --sharedstatedir=%{_sharedstatedir} \
185       --mandir=%{_mandir} \
186       --enable-cxx03-abi=yes  \
187       --enable-gles=%{target_gles_version} \
188 %if 0%{?enable_debug}
189       --enable-debug \
190 %endif
191 %if 0%{?enable_trace}
192       --enable-trace \
193 %endif
194       --infodir=%{_infodir} \
195       --enable-rename-so=no
196
197 make %{?jobs:-j%jobs}
198 %endif
199
200 ##############################
201 # Installation
202 ##############################
203 %install
204 rm -rf %{buildroot}
205 cd build/tizen
206
207 pushd %{_builddir}/%{name}-%{version}/build/tizen
208 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
209
210 for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
211 mv dali-core.pc %{buildroot}%{_libdir}/pkgconfig/dali-core.pc
212 popd
213
214 #############################
215 #rename
216 #############################
217 pushd  %{buildroot}%{_libdir}
218 rm -rf libdali-core.so
219 rm -rf libdali-core-cxx11.so
220 %if !0%{?disable_cxx03_build}
221 ln -s libdali-core.so.0.0.* libdali-core-cxx03.so
222 %endif
223 ln -s libdali-core-cxx11.so.0.0.* libdali-core.so
224 popd
225
226
227 ##############################
228 # Post Install
229 ##############################
230 %post
231 /sbin/ldconfig
232 exit 0
233
234 ##############################
235 # Post Uninstall
236 ##############################
237 %postun
238 /sbin/ldconfig
239 exit 0
240
241 ##############################
242 # Files in Binary Packages
243 ##############################
244
245 %if !0%{?disable_cxx03_build}
246 %files cxx03
247 %if 0%{?enable_dali_smack_rules}
248 %manifest dali.manifest-smack
249 %else
250 %manifest dali.manifest
251 %endif
252 %defattr(-,root,root,-)
253 %{_libdir}/libdali-core.so.*
254 %{_libdir}/libdali-core-cxx03.so
255 %license LICENSE
256 %endif
257
258 %files
259 %if 0%{?enable_dali_smack_rules}
260 %manifest dali.manifest-smack
261 %else
262 %manifest dali.manifest
263 %endif
264 %defattr(-,root,root,-)
265 %{_libdir}/libdali-core-cxx11.so.*
266 %{_libdir}/libdali-core.so
267 %license LICENSE
268
269 %if !0%{?disable_cxx03_build}
270 %files devel-cxx03
271 %defattr(-,root,root,-)
272 %{_libdir}/pkgconfig/dali-core-cxx03.pc
273 %{dev_include_path}/dali/public-api/*
274 %{dev_include_path}/dali/devel-api/*
275 %{dev_include_path}/dali/doc/*
276
277 %files integration-devel-cxx03
278 %defattr(-,root,root,-)
279 %{_includedir}/dali/integration-api/*
280 %endif
281
282 %files devel
283 %defattr(-,root,root,-)
284 %{_libdir}/pkgconfig/dali-core.pc
285 %{dev_include_path}/dali/public-api/*
286 %{dev_include_path}/dali/devel-api/*
287 %{dev_include_path}/dali/doc/*
288
289 %files integration-devel
290 %defattr(-,root,root,-)
291 %{_includedir}/dali/integration-api/*