fixed wrong statement
[platform/core/appfw/sppc.git] / packaging / push.spec
1 %global _support_weblog 0
2
3 Name:       push
4 Summary:    Push services and client library
5 Version:    0.4.40
6 Release:    1
7 Group:      Application Framework/Service
8 License:    Apache-2.0
9 Source0:    %{name}-%{version}.tar.gz
10 Source1:    pushd.service
11 Requires(post): /sbin/ldconfig
12 Requires(post): /usr/bin/sqlite3
13 Requires(postun): /sbin/ldconfig
14
15 %if %{_support_weblog}
16 BuildRequires:  pkgconfig(zlib)
17 BuildRequires:  pkgconfig(json-glib-1.0)
18 %endif
19
20 %description
21 Push services and client library.
22
23 %package -n libpush
24 Summary:    Push service client library
25 Group:      Application Framework/Libraries
26 Requires:   %{name}-bin = %{version}-%{release}
27 Provides:   libpush.so.0
28
29 %description -n libpush
30 Push service client library
31
32 %package -n libpush-devel
33 Summary:    Push service client library (DEV)
34 Group:      Development/Libraries
35 Requires:   libpush = %{version}-%{release}
36 Requires:   capi-appfw-application-devel
37
38 %description -n libpush-devel
39 Push service client library (DEV)
40
41 %package bin
42 Summary:    Push service daemon
43 Group:      Application Framework/Service
44 Requires(post): telephony-daemon
45
46 %description bin
47 Push service daemon
48
49 %package tool
50 Summary:    Push service tool
51 Group:      Development/Tools
52 Requires:   libpush = %{version}-%{release}
53 Requires:   %{name}-bin = %{version}-%{release}
54
55 %description tool
56 Push service tool
57
58 %prep
59 %setup -q
60
61 %build
62
63 %install
64 rm -rf %{buildroot}
65 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
66 install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/pushd.service
67 %install_service multi-user.target.wants pushd.service
68
69 mkdir -p %{buildroot}/usr/share/license
70 cp -f LICENSE %{buildroot}/usr/share/license/%{name}
71
72 %if %{_support_weblog}
73 cp -a share/push/push_sslkey.pem %{buildroot}/usr/share/push/
74 cp -a share/push/prd-dl-key.pem %{buildroot}/usr/share/push/
75 %endif
76
77 mkdir -p %{buildroot}%{_includedir}
78 cp -a include/push-service.h %{buildroot}%{_includedir}
79 cp -a include/push.h %{buildroot}%{_includedir}
80 %if %{_support_weblog}
81         include/pushlog.h %{buildroot}%{_includedir}
82 %endif
83
84 mkdir -p %{buildroot}%{_libdir}/pkgconfig
85 cp -a push.pc %{buildroot}%{_libdir}/pkgconfig/
86
87 mkdir -p %{buildroot}/usr/share/push/
88 mkdir -p %{buildroot}%{_bindir}
89
90 %ifarch %{arm}
91
92 #libpush
93 cp -a arm/lib/libpush.so.* %{buildroot}%{_libdir}
94 #libpus-devel
95 cp -a arm/lib/libpush.so %{buildroot}%{_libdir}
96 #push-bin
97 cp -a arm/bin/pushd %{buildroot}%{_bindir}
98 cp -a arm/bin/push_tool %{buildroot}%{_bindir}
99 cp -a arm/share/push/*.cer %{buildroot}/usr/share/push/
100 %if %{_support_weblog}
101         arm/bin/pushlog_tool
102 %endif
103
104 %if "%{profile}" == "tv"
105 #libpush
106 cp -a arm_tv/lib/libpush.so.* %{buildroot}%{_libdir}
107 #libpus-devel
108 cp -a arm_tv/lib/libpush.so %{buildroot}%{_libdir}
109 #push-bin
110 cp -a arm_tv/bin/pushd %{buildroot}%{_bindir}
111 cp -a arm_tv/bin/push_tool %{buildroot}%{_bindir}
112 cp -a arm_tv/share/push/*.cer %{buildroot}/usr/share/push/
113 %if %{_support_weblog}
114         arm_tv/bin/pushlog_tool
115 %endif
116 %endif
117
118 %if "%{profile}" == "wearable"
119 #libpush
120 cp -a arm_wearable/lib/libpush.so.* %{buildroot}%{_libdir}
121 #libpus-devel
122 cp -a arm_wearable/lib/libpush.so %{buildroot}%{_libdir}
123 #push-bin
124 cp -a arm_wearable/bin/pushd %{buildroot}%{_bindir}
125 cp -a arm_wearable/bin/push_tool %{buildroot}%{_bindir}
126 cp -a arm_wearable/share/push/*.cer %{buildroot}/usr/share/push/
127 %if %{_support_weblog}
128         arm_wearable/bin/pushlog_tool
129 %endif
130 %endif
131 %endif
132
133
134 %ifarch aarch64
135 #libpush
136 cp -a aarch64/lib64/libpush.so.* %{buildroot}%{_libdir}
137 #libpush-devel
138 cp -a aarch64/lib64/libpush.so %{buildroot}%{_libdir}
139 #push-bin
140 cp -a aarch64/bin/pushd %{buildroot}%{_bindir}
141 cp -a aarch64/bin/push_tool %{buildroot}%{_bindir}
142 cp -a aarch64/share/push/*.cer %{buildroot}/usr/share/push/
143 %if %{_support_weblog}
144         aarch64/bin/pushlog_tool
145 %endif
146 %endif
147
148
149 %ifarch %{ix86}
150
151 #libpush
152 cp -a x86/lib/libpush.so.* %{buildroot}%{_libdir}
153 #libpus-devel
154 cp -a x86/lib/libpush.so %{buildroot}%{_libdir}
155 #push-bin
156 cp -a x86/bin/pushd %{buildroot}%{_bindir}
157 cp -a x86/bin/push_tool %{buildroot}%{_bindir}
158 cp -a x86/share/push/*.cer %{buildroot}/usr/share/push/
159 %if %{_support_weblog}
160         x86/bin/pushlog_tool
161 %endif
162
163 %if "%{profile}" == "tv"
164 #libpush
165 cp -a x86_tv/lib/libpush.so.* %{buildroot}%{_libdir}
166 #libpus-devel
167 cp -a x86_tv/lib/libpush.so %{buildroot}%{_libdir}
168 #push-bin
169 cp -a x86_tv/bin/pushd %{buildroot}%{_bindir}
170 cp -a x86_tv/bin/push_tool %{buildroot}%{_bindir}
171 cp -a x86_tv/share/push/*.cer %{buildroot}/usr/share/push/
172 %if %{_support_weblog}
173         x86_tv/bin/pushlog_tool
174 %endif
175 %endif
176
177 %if "%{profile}" == "wearable"
178 #libpush
179 cp -a x86_wearable/lib/libpush.so.* %{buildroot}%{_libdir}
180 #libpus-devel
181 cp -a x86_wearable/lib/libpush.so %{buildroot}%{_libdir}
182 #push-bin
183 cp -a x86_wearable/bin/pushd %{buildroot}%{_bindir}
184 cp -a x86_wearable/bin/push_tool %{buildroot}%{_bindir}
185 cp -a x86_wearable/share/push/*.cer %{buildroot}/usr/share/push/
186 %if %{_support_weblog}
187         x86_wearable/bin/pushlog_tool
188 %endif
189 %endif
190
191 %endif
192
193
194 %ifarch x86_64
195 #libpush
196 cp -a x86_64/lib64/libpush.so.* %{buildroot}%{_libdir}
197 #libpus-devel
198 cp -a x86_64/lib64/libpush.so %{buildroot}%{_libdir}
199 #push-bin
200 cp -a x86_64/bin/pushd %{buildroot}%{_bindir}
201 cp -a x86_64/bin/push_tool %{buildroot}%{_bindir}
202 cp -a x86_64/share/push/*.cer %{buildroot}/usr/share/push/
203 %if %{_support_weblog}
204         x86_64/bin/pushlog_tool
205 %endif
206 %endif
207
208
209 %post bin
210 mkdir -p %{buildroot}%{TZ_SYS_DB}
211 sqlite3 %{buildroot}%{TZ_SYS_DB}/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
212 chown service_fw:service_fw %{TZ_SYS_DB}/.push.db
213 chown service_fw:service_fw %{TZ_SYS_DB}/.push.db-journal
214 chmod 660 %{TZ_SYS_DB}/.push.db
215 chmod 660 %{TZ_SYS_DB}/.push.db-journal
216
217 chsmack -a "*" %{TZ_SYS_DB}/.push.db
218 chsmack -a "*" %{TZ_SYS_DB}/.push.db-journal
219
220 %post -n libpush
221 /sbin/ldconfig
222
223 %postun -n libpush -p /sbin/ldconfig
224
225 %files -n libpush
226 %manifest libpush.manifest
227 %attr(644,service_fw,service_fw)%{_libdir}/libpush.so.*
228
229 %files -n libpush-devel
230 %{_includedir}/*.h
231 %{_libdir}/pkgconfig/*.pc
232 %{_libdir}/libpush.so
233
234 %files bin
235 %manifest push-bin.manifest
236 %{_bindir}/pushd
237 %attr(644,service_fw,service_fw)/usr/share/push/*.cer
238 %attr(644,service_fw,service_fw)/usr/share/license/%{name}
239
240 # This is a certificate file to access to logging server by HTTPS.
241 %if %{_support_weblog}
242 %attr(644,service_fw,service_fw)/usr/share/push/push_sslkey.pem
243 %attr(644,service_fw,service_fw)/usr/share/push/prd-dl-key.pem
244 %endif
245
246 %{_unitdir}/pushd.service
247 %{_unitdir}/multi-user.target.wants/pushd.service
248
249 %files tool
250 %manifest push-tool.manifest
251 %{_bindir}/push_tool
252
253 %if %{_support_weblog}
254         %{_bindir}/pushlog_tool
255 %endif
256
257 %changelog
258 * Sat Nov 3 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.26
259 - Prevent bug fixed(out-of bounds read, dead code,..)
260 * Mon Oct 22 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.25
261 - bundle null check added & protobuf null check added
262 * Wed Sep 19 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.24
263 - when pkg is uninstlled, db process is added
264 * Fri Sep 7 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.23
265 - emul check logic is changed(using capi-system-info)
266 * Tue Sep 4 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.22
267 - decoding of message with space character which is urlencoded to "+"
268 * Wed Aug 29 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.21
269 - package uninstalled event added
270 * Fri Aug 17 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.20
271 - debug msg added & some internal function name changed
272 * Wed Aug 8 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.19
273 - push noti default action is silent, and old key is deleted
274 * Wed Aug 8 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.18
275 - tapi imei api is changed for new tapi
276 * Tue Aug 7 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.17
277 - emulator check func is added
278 * Wed Jul 25 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.16
279 - OSP Push noti support(alertMessage,..)
280