DALi Version 1.0.31
[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.31
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
48 %if 0%{?dali_assimp_plugin}
49 BuildRequires:  pkgconfig(assimp)
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 %if 0%{?dali_feedback_plugin}
74 Requires:       libdeviced
75 BuildRequires:  pkgconfig(mm-sound)
76 BuildRequires:  pkgconfig(deviced)
77 BuildRequires:  libfeedback-devel
78 %endif
79
80 %description dali-feedback-plugin
81 Feedback plugin to play haptic and audio feedback for Dali
82
83 ##############################
84 # Preparation
85 ##############################
86 %prep
87 %setup -q
88 %define dali_data_rw_dir         /opt/usr/share/dali/
89 %define dali_data_ro_dir         /usr/share/dali/
90 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
91 %define user_shader_cache_dir    %{dali_data_rw_dir}/core/shaderbin/
92 %define font_preloaded_path      /usr/share/fonts/
93 %define font_downloaded_path     /opt/share/fonts/
94 %define font_application_path    /usr/share/app_fonts/
95 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
96 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
97 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
98
99 %define dev_include_path %{_includedir}
100
101 ##############################
102 # Build
103 ##############################
104 %build
105 PREFIX+="/usr"
106 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
107 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
108
109 %ifarch %{arm}
110 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
111 %endif
112
113 libtoolize --force
114 cd %{_builddir}/%{name}-%{version}/build/tizen
115 autoreconf --install
116 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
117 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
118 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
119 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
120 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
121 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
122
123 %configure --with-jpeg-turbo --enable-gles=20 --enable-profile=%{dali_profile} \
124 %if 0%{?dali_feedback_plugin}
125            --enable-feedback \
126 %endif
127 %if 0%{?dali_assimp_plugin}
128            --enable-assimp \
129 %endif
130            --libdir=%{_libdir}
131
132 make %{?jobs:-j%jobs}
133
134 ##############################
135 # Installation
136 ##############################
137 %install
138 rm -rf %{buildroot}
139 cd build/tizen
140 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
141
142 # LICENSE
143 mkdir -p %{buildroot}/usr/share/license
144 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
145
146 ##############################
147 # Upgrade order:
148 # 1 - Pre Install new package
149 # 2 - Install new package
150 # 3 - Post install new package
151 # 4 - Pre uninstall old package
152 # 5 - Remove files not overwritten by new package
153 # 6 - Post uninstall old package
154 ##############################
155
156 %pre
157 rm -f %{user_font_cache_dir}/*
158 rm -f %{user_shader_cache_dir}/*
159 exit 0
160
161 ##############################
162 #  Post Install new package
163 ##############################
164 %post
165 /sbin/ldconfig
166 chown 5000:5000 %{user_font_cache_dir}
167 chown 5000:5000 %{user_shader_cache_dir}
168 exit 0
169
170 %if 0%{?dali_feedback_plugin}
171 %post dali-feedback-plugin
172 /sbin/ldconfig
173 exit 0
174 %endif
175
176 ##############################
177 #   Pre Uninstall old package
178 ##############################
179 %preun
180 rm -f %{user_font_cache_dir}/*
181 rm -f %{user_shader_cache_dir}/*
182 exit 0
183
184 ##############################
185 #   Post Uninstall old package
186 ##############################
187 %postun
188 /sbin/ldconfig
189 exit 0
190
191 %if 0%{?dali_feedback_plugin}
192 %postun dali-feedback-plugin
193 /sbin/ldconfig
194 exit 0
195 %endif
196
197 ##############################
198 # Files in Binary Packages
199 ##############################
200
201 %files
202 %manifest dali-adaptor.manifest-mobile
203 %defattr(-,root,root,-)
204 %{_libdir}/libdali-adap*.so*
205 %defattr(-,app,app,-)
206 %dir %{user_font_cache_dir}
207 %dir %{user_shader_cache_dir}
208 %{_bindir}/*
209 %{_datadir}/license/%{name}
210
211 %files devel
212 %defattr(-,root,root,-)
213 %{dev_include_path}/dali/*
214 %{_libdir}/pkgconfig/dali*.pc
215
216 %if 0%{?dali_feedback_plugin}
217 %files dali-feedback-plugin
218 %defattr(-,root,root,-)
219 %{_libdir}/libdali-feedback-plugin.so*
220 %{dali_plugin_sound_files}/*
221 %{dali_plugin_theme_files}/*
222 %endif
223