Add 'ExclusiveArch: armv7l' limit build to arm architecture
[platform/core/uifw/dali-adaptor.git] / packaging / dali-adaptor.spec
1 Name:       dali-adaptor
2 Summary:    The DALi Tizen Adaptor
3 Version:    0.9.14
4 Release:    1
5 Group:      System/Libraries
6 License:    Flora
7 URL:        TO_BE_FILLED
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:  gettext
15 BuildRequires:  pkgconfig
16 BuildRequires:  gawk
17 BuildRequires:  pkgconfig(sensor)
18 BuildRequires:  pkgconfig(aul)
19 BuildRequires:  boost-devel
20 BuildRequires:  pkgconfig(assimp)
21 BuildRequires:  giflib-devel
22 BuildRequires:  pkgconfig(xi)
23 BuildRequires:  pkgconfig(fontconfig)
24 BuildRequires:  pkgconfig(elementary)
25 BuildRequires:  pkgconfig(cairo)
26 BuildRequires:  pkgconfig(capi-appfw-application)
27 BuildRequires:  pkgconfig(isf)
28 BuildRequires:  libjpeg-turbo-devel
29 BuildRequires:  pkgconfig(evas)
30 BuildRequires:  pkgconfig(xfixes)
31 BuildRequires:  pkgconfig(xdamage)
32 BuildRequires:  pkgconfig(utilX)
33 BuildRequires:  dali-devel
34 BuildRequires:  dali-integration-devel
35 BuildRequires:  libxml2-devel
36 BuildRequires:  vconf-devel
37 BuildRequires:  tts-devel
38 BuildRequires:  pkgconfig(dlog)
39 BuildRequires:  pkgconfig(native-buffer)
40 BuildRequires:  pkgconfig(native-buffer-pool)
41 BuildRequires:  libdrm-devel
42 BuildRequires:  pkgconfig(libexif)
43 BuildRequires:  pkgconfig(capi-system-system-settings)
44 BuildRequires:  pkgconfig(gles20)
45 BuildRequires:  sec-product-features
46 ExclusiveArch:  armv7l
47
48 %description
49 The DALi Tizen Adaptor
50
51 ##############################
52 # devel
53 ##############################
54 %package devel
55 Summary:    Development components for the DALi Tizen Adaptor
56 Group:      Development/Libs
57 Requires:   %{name} = %{version}-%{release}
58
59 %description devel
60 Development components for the DALi Tizen Adaptor
61
62 ##############################
63 # Dali Feedback Plugin
64 ##############################
65 %package dali-feedback-plugin
66 Summary:    Feedback plugin to play haptic and audio feedback for Dali
67 Group:      Development/Libs
68 Requires:       libdeviced
69 BuildRequires:  pkgconfig(mm-sound)
70 BuildRequires:  pkgconfig(deviced)
71 BuildRequires:  libfeedback-devel
72
73 %description dali-feedback-plugin
74 Feedback plugin to play haptic and audio feedback for Dali
75
76 ##############################
77 # Dali Dynamics/Bullet Plugin
78 ##############################
79 %package dali-bullet-plugin
80 Summary:    Dynamics plugin to wrap libBulletDynamics libraries
81 Group:      Development/Libs
82 BuildRequires:  libbullet-devel
83
84 %description dali-bullet-plugin
85 Dynamics plugin to wrap libBulletDynamics libraries
86
87 ##############################
88 # Preparation
89 ##############################
90 %prep
91 %setup -q
92 %define dali_data_rw_dir         /opt/usr/share/dali/
93 %define dali_data_ro_dir         /usr/share/dali/
94 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
95 %define user_shader_cache_dir    %{dali_data_rw_dir}/core/shaderbin/
96 %define font_preloaded_path      /usr/share/fonts/
97 %define font_downloaded_path     /opt/share/fonts/
98 %define font_application_path    /usr/share/app_fonts/
99 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
100 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
101 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
102
103 # Switch over when CAPI finalized
104 #%define dev_include_path %{_includedir}/dali/internal
105 %define dev_include_path %{_includedir}
106
107 ##############################
108 # Build
109 ##############################
110 %build
111 PREFIX+="/usr"
112 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
113 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections "
114
115 %if 0%{?sec_build_binary_debug_enable}
116 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
117 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
118 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
119 %endif
120
121 %ifarch %{arm}
122 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
123 %endif
124
125 libtoolize --force
126 cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install
127 %if 0%{?sec_product_feature_graphics_adreno}
128 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=30
129 %else
130 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
131 %endif
132
133 make %{?jobs:-j%jobs}
134
135 ##############################
136 # Installation
137 ##############################
138 %install
139 rm -rf %{buildroot}
140 cd build/tizen
141 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
142
143 # LICENSE
144 mkdir -p %{buildroot}/usr/share/license
145 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
146
147 ##############################
148 # Upgrade order:
149 # 1 - Pre Install new package
150 # 2 - Install new package
151 # 3 - Post install new package
152 # 4 - Pre uninstall old package
153 # 5 - Remove files not overwritten by new package
154 # 6 - Post uninstall old package
155 ##############################
156
157 %pre
158 rm -f %{user_font_cache_dir}/*
159 rm -f %{user_shader_cache_dir}/*
160 exit 0
161
162 ##############################
163 #  Post Install new package
164 ##############################
165 %post
166 /sbin/ldconfig
167 chown 5000:5000 %{user_font_cache_dir}
168 chown 5000:5000 %{user_shader_cache_dir}
169 exit 0
170
171 ##############################
172 #   Pre Uninstall old package
173 ##############################
174 %preun
175 rm -f %{user_font_cache_dir}/*
176 rm -f %{user_shader_cache_dir}/*
177 exit 0
178
179 ##############################
180 #   Post Uninstall old package
181 ##############################
182 %postun
183 /sbin/ldconfig
184 exit 0
185
186 ##############################
187 # Files in Binary Packages
188 ##############################
189
190 %files
191 %manifest dali-adaptor.manifest
192 %defattr(-,root,root,-)
193 %{_libdir}/libdali-adap*.so*
194 %{_libdir}/libdali-appl*.so*
195 %{_libdir}/libdali-evas*.so*
196 %{_libdir}/libdali-nati*.so*
197 %defattr(-,app,app,-)
198 %dir %{user_font_cache_dir}
199 %dir %{user_shader_cache_dir}
200 %{_bindir}/*
201 %{_datadir}/license/%{name}
202
203 %files devel
204 %defattr(-,root,root,-)
205 %{dev_include_path}/dali/*
206 %{_libdir}/pkgconfig/dali*.pc
207
208 %files dali-feedback-plugin
209 %defattr(-,root,root,-)
210 %{_libdir}/libdali-feedback-plugin.so*
211 %{dali_plugin_sound_files}/*
212 %{dali_plugin_theme_files}/*
213
214 %files dali-bullet-plugin
215 %defattr(-,root,root,-)
216 %{_libdir}/libdali-bullet-plugin.so*