Merge remote-tracking branch 'origin/tizen' into new_text
[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.25
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:  pkgconfig(vconf)
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 %configure --with-jpeg-turbo --enable-gles=20 --enable-profile=TV --libdir=%{_libdir}
128
129 make %{?jobs:-j%jobs}
130
131 ##############################
132 # Installation
133 ##############################
134 %install
135 rm -rf %{buildroot}
136 cd build/tizen
137 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
138
139 # LICENSE
140 mkdir -p %{buildroot}/usr/share/license
141 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
142
143 ##############################
144 # Upgrade order:
145 # 1 - Pre Install new package
146 # 2 - Install new package
147 # 3 - Post install new package
148 # 4 - Pre uninstall old package
149 # 5 - Remove files not overwritten by new package
150 # 6 - Post uninstall old package
151 ##############################
152
153 %pre
154 rm -f %{user_font_cache_dir}/*
155 rm -f %{user_shader_cache_dir}/*
156 exit 0
157
158 ##############################
159 #  Post Install new package
160 ##############################
161 %post
162 /sbin/ldconfig
163 chown 5000:5000 %{user_font_cache_dir}
164 chown 5000:5000 %{user_shader_cache_dir}
165 exit 0
166
167 %post dali-feedback-plugin
168 /sbin/ldconfig
169 exit 0
170
171 %post dali-bullet-plugin
172 /sbin/ldconfig
173 exit 0
174
175 ##############################
176 #   Pre Uninstall old package
177 ##############################
178 %preun
179 rm -f %{user_font_cache_dir}/*
180 rm -f %{user_shader_cache_dir}/*
181 exit 0
182
183 ##############################
184 #   Post Uninstall old package
185 ##############################
186 %postun
187 /sbin/ldconfig
188 exit 0
189
190 %postun dali-feedback-plugin
191 /sbin/ldconfig
192 exit 0
193
194 %postun dali-bullet-plugin
195 /sbin/ldconfig
196 exit 0
197
198
199 ##############################
200 # Files in Binary Packages
201 ##############################
202
203 %files
204 %manifest dali-adaptor.manifest-tv
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 %files dali-feedback-plugin
219 %defattr(-,root,root,-)
220 %{_libdir}/libdali-feedback-plugin.so*
221 %{dali_plugin_sound_files}/*
222 %{dali_plugin_theme_files}/*
223
224 %files dali-bullet-plugin
225 %defattr(-,root,root,-)
226 %{_libdir}/libdali-bullet-plugin.so*