Upload package dali-adaptor_0.9.14.
[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
47 %description
48 The DALi Tizen Adaptor
49
50 ##############################
51 # devel
52 ##############################
53 %package devel
54 Summary:    Development components for the DALi Tizen Adaptor
55 Group:      Development/Libs
56 Requires:   %{name} = %{version}-%{release}
57
58 %description devel
59 Development components for the DALi Tizen Adaptor
60
61 ##############################
62 # Dali Feedback Plugin
63 ##############################
64 %package dali-feedback-plugin
65 Summary:    Feedback plugin to play haptic and audio feedback for Dali
66 Group:      Development/Libs
67 Requires:       libdeviced
68 BuildRequires:  pkgconfig(mm-sound)
69 BuildRequires:  pkgconfig(deviced)
70 BuildRequires:  libfeedback-devel
71
72 %description dali-feedback-plugin
73 Feedback plugin to play haptic and audio feedback for Dali
74
75 ##############################
76 # Dali Dynamics/Bullet Plugin
77 ##############################
78 %package dali-bullet-plugin
79 Summary:    Dynamics plugin to wrap libBulletDynamics libraries
80 Group:      Development/Libs
81 BuildRequires:  libbullet-devel
82
83 %description dali-bullet-plugin
84 Dynamics plugin to wrap libBulletDynamics libraries
85
86 ##############################
87 # Preparation
88 ##############################
89 %prep
90 %setup -q
91 %define dali_data_rw_dir         /opt/usr/share/dali/
92 %define dali_data_ro_dir         /usr/share/dali/
93 %define user_font_cache_dir      %{dali_data_rw_dir}/glyphcache/
94 %define user_shader_cache_dir    %{dali_data_rw_dir}/core/shaderbin/
95 %define font_preloaded_path      /usr/share/fonts/
96 %define font_downloaded_path     /opt/share/fonts/
97 %define font_application_path    /usr/share/app_fonts/
98 %define font_configuration_file  /opt/etc/fonts/conf.avail/99-slp.conf
99 %define dali_plugin_sound_files  %{dali_data_ro_dir}/plugins/sounds/
100 %define dali_plugin_theme_files  %{dali_data_ro_dir}/themes/feedback-themes/
101
102 # Switch over when CAPI finalized
103 #%define dev_include_path %{_includedir}/dali/internal
104 %define dev_include_path %{_includedir}
105
106 ##############################
107 # Build
108 ##############################
109 %build
110 PREFIX+="/usr"
111 CXXFLAGS+=" -Wall -g -O2 -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
112 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections "
113
114 %if 0%{?sec_build_binary_debug_enable}
115 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
116 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
117 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
118 %endif
119
120 %ifarch %{arm}
121 CXXFLAGS+=" -D_ARCH_ARM_ -lgcc"
122 %endif
123
124 libtoolize --force
125 cd %{_builddir}/%{name}-%{version}/build/tizen && autoreconf --install
126 %if 0%{?sec_product_feature_graphics_adreno}
127 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
128 %else
129 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
130 %endif
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 ##############################
171 #   Pre Uninstall old package
172 ##############################
173 %preun
174 rm -f %{user_font_cache_dir}/*
175 rm -f %{user_shader_cache_dir}/*
176 exit 0
177
178 ##############################
179 #   Post Uninstall old package
180 ##############################
181 %postun
182 /sbin/ldconfig
183 exit 0
184
185 ##############################
186 # Files in Binary Packages
187 ##############################
188
189 %files
190 %manifest dali-adaptor.manifest
191 %defattr(-,root,root,-)
192 %{_libdir}/libdali-adap*.so*
193 %{_libdir}/libdali-appl*.so*
194 %{_libdir}/libdali-evas*.so*
195 %{_libdir}/libdali-nati*.so*
196 %defattr(-,app,app,-)
197 %dir %{user_font_cache_dir}
198 %dir %{user_shader_cache_dir}
199 %{_bindir}/*
200 %{_datadir}/license/%{name}
201
202 %files devel
203 %defattr(-,root,root,-)
204 %{dev_include_path}/dali/*
205 %{_libdir}/pkgconfig/dali*.pc
206
207 %files dali-feedback-plugin
208 %defattr(-,root,root,-)
209 %{_libdir}/libdali-feedback-plugin.so*
210 %{dali_plugin_sound_files}/*
211 %{dali_plugin_theme_files}/*
212
213 %files dali-bullet-plugin
214 %defattr(-,root,root,-)
215 %{_libdir}/libdali-bullet-plugin.so*