006cad7f3d07e79200deda26df20900a2775d71e
[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 BuildRequires: cmake
21 BuildRequires: libacl-devel
22 BuildRequires: pkgconfig(alarm-service)
23 BuildRequires: pkgconfig(aul)
24 BuildRequires: pkgconfig(badge)
25 BuildRequires: pkgconfig(bundle)
26 BuildRequires: pkgconfig(capi-appfw-application)
27 BuildRequires: pkgconfig(capi-content-media-content)
28 BuildRequires: pkgconfig(capi-media-image-util)
29 BuildRequires: pkgconfig(capi-media-metadata-extractor)
30 BuildRequires: pkgconfig(capi-media-player)
31 BuildRequires: pkgconfig(capi-media-sound-manager)
32 BuildRequires: pkgconfig(capi-media-thumbnail-util)
33 BuildRequires: pkgconfig(capi-network-connection)
34 BuildRequires: pkgconfig(capi-system-device)
35 BuildRequires: pkgconfig(capi-system-info)
36 BuildRequires: pkgconfig(capi-system-system-settings)
37 BuildRequires: pkgconfig(capi-telephony)
38 BuildRequires: pkgconfig(contacts-service2)
39 BuildRequires: pkgconfig(cynara-client)
40 BuildRequires: pkgconfig(cynara-creds-commons)
41 BuildRequires: pkgconfig(cynara-creds-socket)
42 BuildRequires: pkgconfig(cynara-session)
43 BuildRequires: pkgconfig(deviced)
44 BuildRequires: pkgconfig(dlog)
45 BuildRequires: pkgconfig(eventsystem)
46 BuildRequires: pkgconfig(feedback)
47 BuildRequires: pkgconfig(gio-2.0)
48 BuildRequires: pkgconfig(gobject-2.0)
49 BuildRequires: pkgconfig(icu-uc)
50 BuildRequires: pkgconfig(iniparser)
51 BuildRequires: pkgconfig(json-glib-1.0)
52 BuildRequires: pkgconfig(lbs-dbus)
53 BuildRequires: pkgconfig(libcurl)
54 BuildRequires: pkgconfig(libxml-2.0)
55 BuildRequires: pkgconfig(libwbxml2)
56 BuildRequires: pkgconfig(motion)
57 BuildRequires: pkgconfig(notification)
58 BuildRequires: pkgconfig(privacy-manager-client)
59 BuildRequires: pkgconfig(security-server)
60 BuildRequires: pkgconfig(sqlite3)
61 BuildRequires: pkgconfig(storage)
62 BuildRequires: pkgconfig(tapi)
63 BuildRequires: pkgconfig(vconf)
64
65 %description
66 Description: Messaging Framework Library
67
68
69 %package devel
70 License:        Apache-2.0
71 Summary:        Messaging Framework Library (development)
72 Requires:       %{name} = %{version}-%{release}
73 Group:          Development/Libraries
74
75 %description devel
76 Description: Messaging Framework Library (development)
77
78
79 %package tools
80 License:        Apache-2.0
81 Summary:        Messaging server application
82 Requires:       %{name} = %{version}-%{release}
83 Group:          TO_BU / FILL_IN
84 Requires(post): /usr/bin/sqlite3
85 Requires(post): /sbin/ldconfig
86 Requires(postun): /sbin/ldconfig
87
88 %description tools
89 Description:  Messaging server application
90
91
92 %package -n sms-plugin
93 License:        Apache-2.0
94 Summary:        SMS plugin library
95 Requires:       %{name} = %{version}-%{release}
96 Group:          System/Libraries
97 Requires(post): /sbin/ldconfig
98 Requires(postun): /sbin/ldconfig
99
100 %description -n sms-plugin
101 Description: SMS plugin library
102
103 %package -n mms-plugin
104 License:        Apache-2.0
105 Summary:        MMS plugin library
106 Requires:       %{name} = %{version}-%{release}
107 Group:          System/Libraries
108 Requires(post): /sbin/ldconfig
109 Requires(postun): /sbin/ldconfig
110
111 %description -n mms-plugin
112 Description: MMS plugin library
113
114 %prep
115 %setup -q
116
117 %build
118 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
119         -DLIB_INSTALL_DIR=%{_libdir} \
120 %ifarch i586
121 -D_TIZEN_I586_ENABLED:BOOL=ON \
122 %else
123 -D_TIZEN_I586_ENABLED:BOOL=OFF \
124 %endif
125 %if "%{?profile}" == "wearable"
126 -D_MSG_WEARABLE_PROFILE:BOOL=ON \
127 %else
128 -D_MSG_WEARABLE_PROFILE:BOOL=OFF \
129 %endif
130
131 make %{?jobs:-j%jobs}
132
133 %install
134 rm -rf %{buildroot}
135 mkdir -p %{buildroot}/usr/share/license
136 mkdir -p %{buildroot}/etc/config
137
138 %make_install
139
140 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
141 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/msg-server.service
142 %install_service multi-user.target.wants msg-server.service
143
144 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
145 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/msg-server.socket
146 %install_service sockets.target.wants msg-server.socket
147
148 mkdir -p %{buildroot}/usr/dbspace
149 sqlite3 %{buildroot}/usr/dbspace/.msg_service.db "PRAGMA journal_mode = PERSIST;"
150 sqlite3 %{buildroot}/usr/dbspace/.msg_service.db < %{buildroot}/usr/share/msg-service/msg-service-db.sql
151
152 rm %{buildroot}/usr/share/msg-service/msg-service-db.sql
153
154 %post tools
155 /sbin/ldconfig
156
157 chmod 640 /usr/dbspace/.msg_service.db
158 chmod 660 /usr/dbspace/.msg_service.db-journal
159
160 mkdir -p -m 775 /opt/usr/data/msg-service
161 mkdir -p -m 770 /opt/usr/data/msg-service/msgdata
162 mkdir -p -m 770 /opt/usr/data/msg-service/smildata
163 mkdir -p -m 770 /opt/usr/data/msg-service/ipcdata
164 mkdir -p -m 770 /opt/usr/data/msg-service/msgdata/thumbnails
165
166
167 chgrp priv_message_read /usr/dbspace/.msg_service.db
168 chgrp priv_message_read /opt/usr/data/msg-service/msgdata
169 chgrp priv_message_read /opt/usr/data/msg-service/smildata
170 chgrp priv_message_write /opt/usr/data/msg-service/ipcdata
171 chgrp priv_message_read /opt/usr/data/msg-service/msgdata/thumbnails
172
173
174 chsmack -a "*" /usr/dbspace/.msg_service.db
175 chsmack -a "System::Shared" /opt/usr/data/msg-service/msgdata -t
176 chsmack -a "System::Shared" /opt/usr/data/msg-service/smildata -t
177 chsmack -a "System::Run" /opt/usr/data/msg-service/ipcdata -t
178 chsmack -a "System::Shared" /opt/usr/data/msg-service/msgdata/thumbnails -t
179
180 %post -n sms-plugin -p /sbin/ldconfig
181 %post -n mms-plugin -p /sbin/ldconfig
182
183 %post
184 /sbin/ldconfig
185
186 %postun -p /sbin/ldconfig
187
188 %postun tools -p /sbin/ldconfig
189 %postun -n sms-plugin -p /sbin/ldconfig
190 %postun -n mms-plugin -p /sbin/ldconfig
191
192 %files
193 %manifest msg-service.manifest
194 %{_libdir}/libmsg_plugin_manager.so
195 %{_libdir}/libmsg_mapi.so.*
196 %{_libdir}/libmsg_framework_handler.so
197 %{_libdir}/libmsg_transaction_manager.so
198 %{_libdir}/libmsg_utils.so
199 %{_libdir}/libmsg_externals.so
200 %{_libdir}/libmsg_transaction_proxy.so
201 %{_libdir}/libmsg_vobject.so
202 /usr/share/license/msg-service/LICENSE.APLv2
203
204 %files devel
205 %{_libdir}/libmsg_mapi.so
206 %{_libdir}/pkgconfig/msg-service.pc
207 %{_includedir}/msg-service/*
208
209 %files tools
210 %manifest msg-service-tools.manifest
211 %caps(cap_chown,cap_dac_override,cap_lease=eip) %{_bindir}/msg-server
212 %config(noreplace) /usr/dbspace/.msg_service.db*
213 %{_unitdir}/msg-server.service
214 %{_unitdir}/multi-user.target.wants/msg-server.service
215 %{_unitdir}/msg-server.socket
216 %{_unitdir}/sockets.target.wants/msg-server.socket
217 /usr/share/license/msg-service/LICENSE.APLv2
218 /etc/config/*
219
220 %files -n sms-plugin
221 %manifest sms-plugin.manifest
222 %{_libdir}/libmsg_sms_plugin.so
223 /usr/share/license/msg-service/LICENSE.APLv2
224
225 %files -n mms-plugin
226 %manifest mms-plugin.manifest
227 %{_libdir}/libmsg_mms_plugin.so
228 /usr/share/license/msg-service/LICENSE.APLv2
229
230 %changelog