[dali_1.0.18] Merger branch 'tizen'
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor.spec
1 %bcond_with wayland
2
3 Name:       dali-adaptor
4 Summary:    The DALi Tizen Adaptor
5 Version:    1.0.18
6 Release:    1
7 Group:      System/Libraries
8 License:    Apache-2.0
9 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-adaptor.git;a=summary
10 Source0:    %{name}-%{version}.tar.gz
11
12 Requires(post): /sbin/ldconfig
13 Requires(postun): /sbin/ldconfig
14 Requires:       boost-thread
15 Requires:       giflib
16 BuildRequires:  pkgconfig
17 BuildRequires:  gawk
18 BuildRequires:  pkgconfig(sensor)
19 BuildRequires:  pkgconfig(aul)
20 BuildRequires:  boost-devel
21 BuildRequires:  giflib-devel
22 BuildRequires:  pkgconfig(fontconfig)
23 BuildRequires:  pkgconfig(elementary)
24 BuildRequires:  pkgconfig(capi-appfw-application)
25 BuildRequires:  libjpeg-turbo-devel
26 BuildRequires:  pkgconfig(evas)
27 BuildRequires:  dali-devel
28 BuildRequires:  dali-integration-devel
29 BuildRequires:  libxml2-devel
30 BuildRequires:  vconf-devel
31 BuildRequires:  tts-devel
32 BuildRequires:  pkgconfig(dlog)
33 BuildRequires:  libdrm-devel
34 BuildRequires:  pkgconfig(libexif)
35 BuildRequires:  pkgconfig(capi-system-system-settings)
36 BuildRequires:  pkgconfig(efl-assist)
37 BuildRequires:  pkgconfig(libpng)
38 %if %{with wayland}
39 BuildRequires:  pkgconfig(glesv2)
40 BuildRequires:  pkgconfig(egl)
41 BuildRequires:  pkgconfig(ecore-wayland)
42 BuildRequires:  pkgconfig(wayland-egl)
43 BuildRequires:  pkgconfig(wayland-client)
44 %else
45 BuildRequires:  pkgconfig(xi)
46 BuildRequires:  pkgconfig(xfixes)
47 BuildRequires:  pkgconfig(xdamage)
48 BuildRequires:  pkgconfig(utilX)
49 BuildRequires:  pkgconfig(gles20)
50 %endif
51
52 %description
53 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
54 platform abstraction and application shell
55
56 ##############################
57 # devel
58 ##############################
59 %package devel
60 Summary:    Development components for the DALi Tizen Adaptor
61 Group:      Development/Building
62 Requires:   %{name} = %{version}-%{release}
63
64 %description devel
65 Development components for the DALi Tizen Adaptor - public headers and package configs
66
67 ##############################
68 # Dali Feedback Plugin
69 ##############################
70 %package dali-feedback-plugin
71 Summary:    Plugin to play haptic and audio feedback for Dali
72 Group:      System/Libraries
73 #Requires:       libdeviced
74 BuildRequires:  pkgconfig(mm-sound)
75 BuildRequires:  pkgconfig(haptic)
76 BuildRequires:  libfeedback-devel
77
78 %description dali-feedback-plugin
79 Feedback plugin to play haptic and audio feedback for Dali
80
81 ##############################
82 # Dali Dynamics/Bullet Plugin
83 ##############################
84 %package dali-bullet-plugin
85 Summary:    Plugin to provide physics
86 Group:      System/Libraries
87 BuildRequires:  pkgconfig(bullet)
88
89 %description dali-bullet-plugin
90 Dynamics plugin to wrap the libBulletDynamics libraries
91
92 ##############################
93 # Preparation
94 ##############################
95 %prep
96 %setup -q
97 %define dali_data_rw_dir         /usr/share/dali/
98 %define dali_data_ro_dir         /usr/share/dali/
99 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
100 %define user_shader_cache_dir    %{dali_data_rw_dir}/core/shaderbin/
101 %define font_preloaded_path      /usr/share/fonts/
102 %define font_downloaded_path     /opt/share/fonts/
103 %define font_application_path    /usr/share/app_fonts/
104 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
105 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
106 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
107
108 %define dev_include_path %{_includedir}
109
110 ##############################
111 # Build
112 ##############################
113 %build
114 PREFIX+="/usr"
115 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
116 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections "
117
118 %if 0%{?sec_build_binary_debug_enable}
119 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
120 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
121 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
122 %endif
123
124 %ifarch %{arm}
125 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
126 %endif
127
128 %if %{with wayland}
129 CFLAGS+=" -DWAYLAND"
130 CXXFLAGS+=" -DWAYLAND"
131 configure_flags="--enable-wayland"
132 %endif
133
134 libtoolize --force
135 cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install
136 cd %{_builddir}/%{name}-%{version}/build/tizen && CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}" FONT_PRELOADED_PATH="%{font_preloaded_path}" FONT_DOWNLOADED_PATH="%{font_downloaded_path}" FONT_APPLICATION_PATH="%{font_application_path}" FONT_CONFIGURATION_FILE="%{font_configuration_file}" %configure --prefix=$PREFIX --with-jpeg-turbo --enable-gles=20 --enable-profile=COMMON $configure_flags --libdir=%{_libdir}
137
138 make %{?jobs:-j%jobs}
139
140 ##############################
141 # Installation
142 ##############################
143 %install
144 rm -rf %{buildroot}
145 cd build/tizen
146 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
147
148 # LICENSE
149 mkdir -p %{buildroot}/usr/share/license
150 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
151
152 ##############################
153 # Upgrade order:
154 # 1 - Pre Install new package
155 # 2 - Install new package
156 # 3 - Post install new package
157 # 4 - Pre uninstall old package
158 # 5 - Remove files not overwritten by new package
159 # 6 - Post uninstall old package
160 ##############################
161
162 %pre
163 rm -f %{user_font_cache_dir}/*
164 rm -f %{user_shader_cache_dir}/*
165 exit 0
166
167 ##############################
168 #  Post Install new package
169 ##############################
170 %post
171 /sbin/ldconfig
172 chown 5000:5000 %{user_font_cache_dir}
173 chown 5000:5000 %{user_shader_cache_dir}
174 exit 0
175
176 %post dali-feedback-plugin
177 /sbin/ldconfig
178 exit 0
179
180 %post dali-bullet-plugin
181 /sbin/ldconfig
182 exit 0
183
184 ##############################
185 #   Pre Uninstall old package
186 ##############################
187 %preun
188 rm -f %{user_font_cache_dir}/*
189 rm -f %{user_shader_cache_dir}/*
190 exit 0
191
192 ##############################
193 #   Post Uninstall old package
194 ##############################
195 %postun
196 /sbin/ldconfig
197 exit 0
198
199 %postun dali-feedback-plugin
200 /sbin/ldconfig
201 exit 0
202
203 %postun dali-bullet-plugin
204 /sbin/ldconfig
205 exit 0
206
207
208 ##############################
209 # Files in Binary Packages
210 ##############################
211
212 %files
213 %manifest dali-adaptor.manifest
214 %defattr(-,root,root,-)
215 %{_libdir}/libdali-adap*.so*
216 %defattr(-,app,app,-)
217 %dir %{user_font_cache_dir}
218 %dir %{user_shader_cache_dir}
219 %{_bindir}/*
220 %{_datadir}/license/%{name}
221
222 %files devel
223 %defattr(-,root,root,-)
224 %{dev_include_path}/dali/*
225 %{_libdir}/pkgconfig/dali*.pc
226
227 %files dali-feedback-plugin
228 %defattr(-,root,root,-)
229 %{_libdir}/libdali-feedback-plugin.so*
230 %{dali_plugin_sound_files}/*
231 %{dali_plugin_theme_files}/*
232
233 %files dali-bullet-plugin
234 %defattr(-,root,root,-)
235 %{_libdir}/libdali-bullet-plugin.so*