[dali_1.0.20] Merge branch 'tizen'
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor-tv.spec
1 Name:       dali-adaptor
2 Summary:    The DALi Tizen Adaptor
3 Version:    1.0.20
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 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12 Requires:       boost-thread
13 Requires:       giflib
14 BuildRequires:  pkgconfig
15 BuildRequires:  gawk
16 BuildRequires:  pkgconfig(sensor)
17 BuildRequires:  pkgconfig(aul)
18 BuildRequires:  boost-devel
19 BuildRequires:  giflib-devel
20 BuildRequires:  pkgconfig(fontconfig)
21 BuildRequires:  pkgconfig(elementary)
22 BuildRequires:  pkgconfig(capi-appfw-application)
23 BuildRequires:  libjpeg-turbo-devel
24 BuildRequires:  pkgconfig(evas)
25 BuildRequires:  dali-devel
26 BuildRequires:  dali-integration-devel
27 BuildRequires:  libxml2-devel
28 BuildRequires:  vconf-devel
29 BuildRequires:  tts-devel
30 BuildRequires:  pkgconfig(dlog)
31 BuildRequires:  libdrm-devel
32 BuildRequires:  pkgconfig(libexif)
33 BuildRequires:  pkgconfig(capi-system-system-settings)
34 BuildRequires:  pkgconfig(libpng)
35 BuildRequires:  pkgconfig(xi)
36 BuildRequires:  pkgconfig(xfixes)
37 BuildRequires:  pkgconfig(xdamage)
38 BuildRequires:  pkgconfig(utilX)
39 BuildRequires:  pkgconfig(gles20)
40
41 %description
42 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
43 platform abstraction and application shell
44
45 ##############################
46 # devel
47 ##############################
48 %package devel
49 Summary:    Development components for the DALi Tizen Adaptor
50 Group:      Development/Building
51 Requires:   %{name} = %{version}-%{release}
52
53 %description devel
54 Development components for the DALi Tizen Adaptor - public headers and package configs
55
56 ##############################
57 # Dali Feedback Plugin
58 ##############################
59 %package dali-feedback-plugin
60 Summary:    Plugin to play haptic and audio feedback for Dali
61 Group:      System/Libraries
62 #Requires:       libdeviced
63 BuildRequires:  pkgconfig(mm-sound)
64 BuildRequires:  pkgconfig(haptic)
65 BuildRequires:  libfeedback-devel
66
67 %description dali-feedback-plugin
68 Feedback plugin to play haptic and audio feedback for Dali
69
70 ##############################
71 # Dali Dynamics/Bullet Plugin
72 ##############################
73 %package dali-bullet-plugin
74 Summary:    Plugin to provide physics
75 Group:      System/Libraries
76 BuildRequires:  pkgconfig(bullet)
77
78 %description dali-bullet-plugin
79 Dynamics plugin to wrap the libBulletDynamics libraries
80
81 ##############################
82 # Preparation
83 ##############################
84 %prep
85 %setup -q
86 %define dali_data_rw_dir         /usr/share/dali/
87 %define dali_data_ro_dir         /usr/share/dali/
88 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
89 %define user_shader_cache_dir    %{dali_data_rw_dir}/core/shaderbin/
90 %define font_preloaded_path      /usr/share/fonts/
91 %define font_downloaded_path     /opt/share/fonts/
92 %define font_application_path    /usr/share/app_fonts/
93 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
94 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
95 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
96
97 %define dev_include_path %{_includedir}
98
99 ##############################
100 # Build
101 ##############################
102 %build
103 PREFIX+="/usr"
104 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
105 LDFLAGS+=" -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--gc-sections "
106
107 %if 0%{?sec_build_binary_debug_enable}
108 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
109 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
110 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
111 %endif
112
113 %ifarch %{arm}
114 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
115 %endif
116
117 libtoolize --force
118 cd %{_builddir}/%{name}-%{version}/build/tizen
119 autoreconf --install
120 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
121 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
122 FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
123 FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
124 FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
125 FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
126
127
128 %if "%{?sec_product_feature_graphics_gpu_info}" == "adreno330"
129 %configure --with-jpeg-turbo --enable-gles=30 --enable-profile=TV --libdir=%{_libdir}
130 %else
131 %configure --with-jpeg-turbo --enable-gles=20 --enable-profile=TV --libdir=%{_libdir}
132 %endif
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 %post dali-feedback-plugin
173 /sbin/ldconfig
174 exit 0
175
176 %post dali-bullet-plugin
177 /sbin/ldconfig
178 exit 0
179
180 ##############################
181 #   Pre Uninstall old package
182 ##############################
183 %preun
184 rm -f %{user_font_cache_dir}/*
185 rm -f %{user_shader_cache_dir}/*
186 exit 0
187
188 ##############################
189 #   Post Uninstall old package
190 ##############################
191 %postun
192 /sbin/ldconfig
193 exit 0
194
195 %postun dali-feedback-plugin
196 /sbin/ldconfig
197 exit 0
198
199 %postun dali-bullet-plugin
200 /sbin/ldconfig
201 exit 0
202
203
204 ##############################
205 # Files in Binary Packages
206 ##############################
207
208 %files
209 %manifest dali-adaptor.manifest-tv
210 %defattr(-,root,root,-)
211 %{_libdir}/libdali-adap*.so*
212 %defattr(-,app,app,-)
213 %dir %{user_font_cache_dir}
214 %dir %{user_shader_cache_dir}
215 %{_bindir}/*
216 %{_datadir}/license/%{name}
217
218 %files devel
219 %defattr(-,root,root,-)
220 %{dev_include_path}/dali/*
221 %{_libdir}/pkgconfig/dali*.pc
222
223 %files dali-feedback-plugin
224 %defattr(-,root,root,-)
225 %{_libdir}/libdali-feedback-plugin.so*
226 %{dali_plugin_sound_files}/*
227 %{dali_plugin_theme_files}/*
228
229 %files dali-bullet-plugin
230 %defattr(-,root,root,-)
231 %{_libdir}/libdali-bullet-plugin.so*