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