ca0855ee7fe42efd3801f347289ef924681f17da
[platform/core/messaging/msg-service.git] / packaging / msg-service.spec
1 Name:           msg-service
2 Version:        1.0.2
3 Release:        2
4 License:        Apache-2.0
5 Summary:        Messaging Framework Library
6 Group:          System/Libraries
7 Source0:        %{name}-%{version}.tar.gz
8 Source1:        msg-server.service
9 Source2:        msg-server.socket
10
11 %if "%{?profile}" == "tv"
12 ExcludeArch: %{arm} %ix86 x86_64
13 %endif
14
15 Requires(post): /usr/bin/sqlite3
16 Requires(post): /sbin/ldconfig
17 Requires(postun): /sbin/ldconfig
18 Requires(post): systemd
19 Requires(postun): systemd
20 Requires: acl
21 Requires: security-config
22 BuildRequires: cmake
23 BuildRequires: pkgconfig(alarm-service)
24 BuildRequires: pkgconfig(aul)
25 BuildRequires: pkgconfig(boost)
26 BuildRequires: pkgconfig(bundle)
27 BuildRequires: pkgconfig(capi-media-image-util)
28 BuildRequires: pkgconfig(capi-media-metadata-extractor)
29 BuildRequires: pkgconfig(capi-media-thumbnail-util)
30 BuildRequires: pkgconfig(capi-network-connection)
31 BuildRequires: pkgconfig(capi-system-device)
32 BuildRequires: pkgconfig(capi-system-info)
33 BuildRequires: pkgconfig(capi-telephony)
34 BuildRequires: pkgconfig(cynara-client)
35 BuildRequires: pkgconfig(cynara-creds-commons)
36 BuildRequires: pkgconfig(cynara-creds-socket)
37 BuildRequires: pkgconfig(cynara-session)
38 BuildRequires: pkgconfig(deviced)
39 BuildRequires: pkgconfig(dlog)
40 BuildRequires: pkgconfig(eventsystem)
41 BuildRequires: pkgconfig(gio-2.0)
42 BuildRequires: pkgconfig(icu-uc)
43 BuildRequires: pkgconfig(json-glib-1.0)
44 BuildRequires: pkgconfig(lbs-dbus)
45 BuildRequires: pkgconfig(libcurl)
46 BuildRequires: pkgconfig(libsmack)
47 BuildRequires: pkgconfig(libsystemd-login)
48 BuildRequires: pkgconfig(libtzplatform-config)
49 BuildRequires: pkgconfig(libxml-2.0)
50 BuildRequires: pkgconfig(libwbxml2)
51 BuildRequires: pkgconfig(motion)
52 BuildRequires: pkgconfig(sqlite3)
53 BuildRequires: pkgconfig(tapi)
54 BuildRequires: pkgconfig(vconf)
55 %if "%{?profile}" != "wearable"
56 BuildRequires: pkgconfig(contacts-service2)
57 %endif
58 %if "%{?profile}" == "mobile"
59 BuildRequires: gettext-tools
60 BuildRequires: hash-signer
61 BuildRequires: pkgconfig(badge)
62 BuildRequires: pkgconfig(callmgr_client)
63 BuildRequires: pkgconfig(capi-appfw-application)
64 BuildRequires: pkgconfig(capi-appfw-package-manager)
65 BuildRequires: pkgconfig(capi-appfw-service-application)
66 BuildRequires: pkgconfig(capi-media-player)
67 BuildRequires: pkgconfig(capi-media-sound-manager)
68 BuildRequires: pkgconfig(feedback)
69 BuildRequires: pkgconfig(notification)
70 %endif
71
72 %description
73 Description: Messaging Framework Library
74
75
76 %package devel
77 License:        Apache-2.0
78 Summary:        Messaging Framework Library (development)
79 Requires:       %{name} = %{version}-%{release}
80 Group:          Development/Libraries
81
82 %description devel
83 Description: Messaging Framework Library (development)
84
85
86 %package tools
87 License:        Apache-2.0
88 Summary:        Messaging server application
89 Requires:       %{name} = %{version}-%{release}
90 Group:          TO_BU / FILL_IN
91 Requires(post): /usr/bin/sqlite3
92 Requires(post): /sbin/ldconfig
93 Requires(postun): /sbin/ldconfig
94
95 %description tools
96 Description:  Messaging server application
97
98
99 %package -n sms-plugin
100 License:        Apache-2.0
101 Summary:        SMS plugin library
102 Requires:       %{name} = %{version}-%{release}
103 Group:          System/Libraries
104 Requires(post): /sbin/ldconfig
105 Requires(postun): /sbin/ldconfig
106
107 %description -n sms-plugin
108 Description: SMS plugin library
109
110 %package -n mms-plugin
111 License:        Apache-2.0
112 Summary:        MMS plugin library
113 Requires:       %{name} = %{version}-%{release}
114 Group:          System/Libraries
115 Requires(post): /sbin/ldconfig
116 Requires(postun): /sbin/ldconfig
117
118 %description -n mms-plugin
119 Description: MMS plugin library
120
121 %package -n msg-manager
122 License:        Apache-2.0
123 Summary:        Message manager application
124 Requires:       %{name} = %{version}-%{release}
125 Group:          Applications
126
127 %description -n msg-manager
128 Description: Message manager application
129
130 %if "%{?profile}" == "mobile"
131 %define APP_PKGNAME     org.tizen.msg-manager
132 %define APP_PREFIX      %{TZ_SYS_RO_APP}/%{APP_PKGNAME}
133 %define APP_BINDIR      %{APP_PREFIX}/bin
134 %define APP_RESDIR      %{APP_PREFIX}/res
135 %define APP_LOCALEDIR   %{APP_RESDIR}/locale
136 %define APP_MANIFESTDIR %{TZ_SYS_RO_PACKAGES}
137 %endif
138
139 %prep
140 %setup -q
141
142 %build
143 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
144                 -DLIB_INSTALL_DIR=%{_libdir} \
145 %if "%{?profile}" == "mobile"
146                 -DAPP_MANIFESTDIR=%{APP_MANIFESTDIR}   \
147                 -DAPP_BINDIR=%{APP_BINDIR}   \
148                 -DAPP_LOCALEDIR=%{APP_LOCALEDIR}   \
149 %endif
150                 -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
151                 -DTZ_SYS_DATA=%TZ_SYS_DATA \
152                 -DTZ_SYS_DB=%TZ_SYS_DB \
153                 -DTZ_SYS_HOME=%TZ_SYS_HOME \
154                 -DTZ_SYS_BIN=%TZ_SYS_BIN \
155 %ifarch i586
156 -D_TIZEN_I586_ENABLED:BOOL=ON \
157 %else
158 -D_TIZEN_I586_ENABLED:BOOL=OFF \
159 %endif
160 %if "%{?profile}" == "wearable"
161 -D_MSG_WEARABLE_PROFILE:BOOL=ON \
162 %else
163 -D_MSG_WEARABLE_PROFILE:BOOL=OFF \
164 %endif
165 %if "%{?profile}" == "mobile"
166 -D_MSG_MOBILE_PROFILE:BOOL=ON \
167 %else
168 -D_MSG_MOBILE_PROFILE:BOOL=OFF \
169 %endif
170
171 make %{?jobs:-j%jobs}
172
173 %install
174 rm -rf %{buildroot}
175 mkdir -p %{buildroot}/usr/share/license
176 mkdir -p %{buildroot}/etc/config
177
178 %make_install
179
180 %if "%{?profile}" == "mobile"
181 %define tizen_sign 1
182 %define tizen_sign_base %{APP_PREFIX}
183 %define tizen_sign_level platform
184 %define tizen_author_sign 1
185 %define tizen_dist_sign 1
186 %endif
187
188 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
189 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/msg-server.service
190 %install_service multi-user.target.wants msg-server.service
191
192 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
193 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/msg-server.socket
194 %install_service sockets.target.wants msg-server.socket
195
196 mkdir -p %{buildroot}%{TZ_SYS_DB}
197 sqlite3 %{buildroot}%{TZ_SYS_DB}/.msg_service.db "PRAGMA journal_mode = PERSIST;"
198 sqlite3 %{buildroot}%{TZ_SYS_DB}/.msg_service.db < %{buildroot}/usr/share/msg-service/msg-service-db.sql
199
200 rm %{buildroot}/usr/share/msg-service/msg-service-db.sql
201
202 %post tools
203 /sbin/ldconfig
204
205 chmod 640 %{TZ_SYS_DB}/.msg_service.db
206 chmod 660 %{TZ_SYS_DB}/.msg_service.db-journal
207
208 mkdir -p -m 770 %{TZ_SYS_DATA}/msg-service
209 mkdir -p -m 750 %{TZ_SYS_DATA}/msg-service/msgdata
210 mkdir -p -m 750 %{TZ_SYS_DATA}/msg-service/smildata
211 mkdir -p -m 770 %{TZ_SYS_DATA}/msg-service/ipcdata
212 mkdir -p -m 750 %{TZ_SYS_DATA}/msg-service/msgdata/thumbnails
213
214 chown messaging:priv_message_read %{TZ_SYS_DB}/.msg_service.db
215 chown messaging:priv_message_read %{TZ_SYS_DB}/.msg_service.db-journal
216 chown messaging:priv_message_read %{TZ_SYS_DATA}/msg-service
217 chown messaging:priv_message_read %{TZ_SYS_DATA}/msg-service/msgdata
218 chown messaging:priv_message_read %{TZ_SYS_DATA}/msg-service/smildata
219 chown messaging:priv_message_read %{TZ_SYS_DATA}/msg-service/ipcdata
220 chown messaging:priv_message_read %{TZ_SYS_DATA}/msg-service/msgdata/thumbnails
221
222 chmod g+s %{TZ_SYS_DATA}/msg-service/msgdata
223 chmod g+s %{TZ_SYS_DATA}/msg-service/smildata
224 chmod g+s %{TZ_SYS_DATA}/msg-service/ipcdata
225 chmod g+s %{TZ_SYS_DATA}/msg-service/msgdata/thumbnails
226
227 chsmack -a "*" %{TZ_SYS_DB}/.msg_service.db
228 chsmack -a "*" %{TZ_SYS_DB}/.msg_service.db-journal
229 chsmack -a "System::Shared" %{TZ_SYS_DATA}/msg-service/
230 chsmack -a "System::Shared" %{TZ_SYS_DATA}/msg-service/msgdata -t
231 chsmack -a "System::Shared" %{TZ_SYS_DATA}/msg-service/smildata -t
232 chsmack -a "System::Run" %{TZ_SYS_DATA}/msg-service/ipcdata -t
233 chsmack -a "System::Shared" %{TZ_SYS_DATA}/msg-service/msgdata/thumbnails -t
234
235 #Multi group to ipcdata directory
236 chmod o= %{TZ_SYS_DATA}/msg-service/ipcdata
237 setfacl -m group:priv_message_write:rw %{TZ_SYS_DATA}/msg-service/ipcdata
238
239 %post -n sms-plugin -p /sbin/ldconfig
240 %post -n mms-plugin -p /sbin/ldconfig
241
242 %post
243 /sbin/ldconfig
244
245 %postun -p /sbin/ldconfig
246
247 %postun tools -p /sbin/ldconfig
248 %postun -n sms-plugin -p /sbin/ldconfig
249 %postun -n mms-plugin -p /sbin/ldconfig
250
251 %files
252 %manifest msg-service.manifest
253 %license LICENSE.APLv2
254 %{_libdir}/libmsg_plugin_manager.so
255 %{_libdir}/libmsg_mapi.so.*
256 %{_libdir}/libmsg_framework_handler.so
257 %{_libdir}/libmsg_transaction_manager.so
258 %{_libdir}/libmsg_utils.so
259 %{_libdir}/libmsg_externals.so
260 %{_libdir}/libmsg_transaction_proxy.so
261 %{_libdir}/libmsg_vobject.so
262
263 %files devel
264 %license LICENSE.APLv2
265 %{_libdir}/libmsg_mapi.so
266 %{_libdir}/pkgconfig/msg-service.pc
267 %{_includedir}/msg-service/*
268
269 %files tools
270 %manifest msg-service-tools.manifest
271 %license LICENSE.APLv2
272 %caps(cap_chown,cap_dac_override,cap_lease=eip) %{_bindir}/msg-server
273 %config(noreplace) %{TZ_SYS_DB}/.msg_service.db*
274 %{_unitdir}/msg-server.service
275 %{_unitdir}/multi-user.target.wants/msg-server.service
276 %{_unitdir}/msg-server.socket
277 %{_unitdir}/sockets.target.wants/msg-server.socket
278
279 %files -n sms-plugin
280 %manifest sms-plugin.manifest
281 %license LICENSE.APLv2
282 %{_libdir}/libmsg_sms_plugin.so
283
284 %files -n mms-plugin
285 %manifest mms-plugin.manifest
286 %license LICENSE.APLv2
287 %{_libdir}/libmsg_mms_plugin.so
288
289 %if "%{?profile}" == "mobile"
290 %files -n msg-manager
291 %manifest msg-manager.manifest
292 %license LICENSE.APLv2
293 %{APP_BINDIR}/msg-manager
294 %{APP_MANIFESTDIR}/*.xml
295 %{APP_PREFIX}/author-signature.xml
296 %{APP_PREFIX}/signature1.xml
297 %{APP_RESDIR}/*
298 %endif
299
300 %changelog