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