aab576687351ffc4c5abedd8a9d799b3e2d630c8
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    DALi 3D Engine
3 Version:    1.2.88
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       --infodir=%{_infodir} \
153       --enable-rename-so=no
154
155 make %{?jobs:-j%jobs}
156
157 pushd %{_builddir}/%{name}-%{version}/build/tizen
158 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
159 popd
160
161 pushd %{buildroot}%{_libdir}
162 for FILE in libdali-core-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
163 mv pkgconfig/dali-core.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-core.pc
164 popd
165
166 %if !0%{?disable_cxx03_build}
167 make clean
168
169 ./configure \
170       --program-prefix=%{?_program_prefix} \
171       --prefix=%{_prefix} \
172       --exec-prefix=%{_exec_prefix} \
173       --bindir=%{_bindir} \
174       --sbindir=%{_sbindir} \
175       --sysconfdir=%{_sysconfdir} \
176       --datadir=%{_datadir} \
177       --includedir=%{_includedir} \
178       --libdir=%{_libdir} \
179       --libexecdir=%{_libexecdir} \
180       --localstatedir=%{_localstatedir} \
181       --sharedstatedir=%{_sharedstatedir} \
182       --mandir=%{_mandir} \
183       --enable-cxx03-abi=yes  \
184       --enable-gles=%{target_gles_version} \
185 %if 0%{?enable_debug}
186       --enable-debug \
187 %endif
188       --infodir=%{_infodir} \
189       --enable-rename-so=no
190
191 make %{?jobs:-j%jobs}
192 %endif
193
194 ##############################
195 # Installation
196 ##############################
197 %install
198 rm -rf %{buildroot}
199 cd build/tizen
200
201 pushd %{_builddir}/%{name}-%{version}/build/tizen
202 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
203
204 for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
205 mv dali-core.pc %{buildroot}%{_libdir}/pkgconfig/dali-core.pc
206 popd
207
208 #############################
209 #rename
210 #############################
211 pushd  %{buildroot}%{_libdir}
212 rm -rf libdali-core.so
213 rm -rf libdali-core-cxx11.so
214 %if !0%{?disable_cxx03_build}
215 ln -s libdali-core.so.0.0.* libdali-core-cxx03.so
216 %endif
217 ln -s libdali-core-cxx11.so.0.0.* libdali-core.so
218 popd
219
220
221 ##############################
222 # Post Install
223 ##############################
224 %post
225 /sbin/ldconfig
226 exit 0
227
228 ##############################
229 # Post Uninstall
230 ##############################
231 %postun
232 /sbin/ldconfig
233 exit 0
234
235 ##############################
236 # Files in Binary Packages
237 ##############################
238
239 %if !0%{?disable_cxx03_build}
240 %files cxx03
241 %if 0%{?enable_dali_smack_rules}
242 %manifest dali.manifest-smack
243 %else
244 %manifest dali.manifest
245 %endif
246 %defattr(-,root,root,-)
247 %{_libdir}/libdali-core.so.*
248 %{_libdir}/libdali-core-cxx03.so
249 %defattr(-,app,app,-)
250 %license LICENSE
251 %endif
252
253 %files
254 %if 0%{?enable_dali_smack_rules}
255 %manifest dali.manifest-smack
256 %else
257 %manifest dali.manifest
258 %endif
259 %defattr(-,root,root,-)
260 %{_libdir}/libdali-core-cxx11.so.*
261 %{_libdir}/libdali-core.so
262 %defattr(-,app,app,-)
263 %license LICENSE
264
265 %if !0%{?disable_cxx03_build}
266 %files devel-cxx03
267 %defattr(-,root,root,-)
268 %{_libdir}/pkgconfig/dali-core-cxx03.pc
269 %{dev_include_path}/dali/public-api/*
270 %{dev_include_path}/dali/devel-api/*
271 %{dev_include_path}/dali/doc/*
272
273 %files integration-devel-cxx03
274 %defattr(-,root,root,-)
275 %{_includedir}/dali/integration-api/*
276 %endif
277
278 %files devel
279 %defattr(-,root,root,-)
280 %{_libdir}/pkgconfig/dali-core.pc
281 %{dev_include_path}/dali/public-api/*
282 %{dev_include_path}/dali/devel-api/*
283 %{dev_include_path}/dali/doc/*
284
285 %files integration-devel
286 %defattr(-,root,root,-)
287 %{_includedir}/dali/integration-api/*