a4e2f8bf70b0ffe33418a428ae7afca387417361
[framework/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.13
6 Release:    2
7 Group:      Application Framwork/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 Framwork/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:      devel
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 Framwork/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:      devel
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}%{_libdir}/systemd/system/multi-user.target.wants
66 install -m 0644 %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/pushd.service
67 ln -s ../pushd.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/pushd.service
68
69 mkdir -p %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants
70 cp %{SOURCE1} %{buildroot}/usr/lib/systemd/user/pushd.service
71 ln -s ../pushd.service %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants/
72
73 mkdir -p %{buildroot}/usr/share/license
74 cp -f LICENSE %{buildroot}/usr/share/license/%{name}
75
76 %if %{_support_weblog}
77 cp -a share/push/push_sslkey.pem %{buildroot}/usr/share/push/
78 cp -a share/push/prd-dl-key.pem %{buildroot}/usr/share/push/
79 %endif
80
81 mkdir -p %{buildroot}%{_includedir}
82 cp -a include/push-service.h %{buildroot}%{_includedir}
83 cp -a include/push.h %{buildroot}%{_includedir}
84 %if %{_support_weblog}
85         include/pushlog.h %{buildroot}%{_includedir}
86 %endif
87
88 mkdir -p %{buildroot}%{_libdir}/pkgconfig
89 cp -a push.pc %{buildroot}%{_libdir}/pkgconfig/
90
91 mkdir -p %{buildroot}/usr/share/push/
92 mkdir -p %{buildroot}%{_bindir}
93
94 %ifarch %{arm}
95 #libpush
96 cp -a arm/lib/libpush.so.* %{buildroot}%{_libdir}
97 #libpus-devel
98 cp -a arm/lib/libpush.so %{buildroot}%{_libdir}
99 #push-bin
100 cp -a arm/bin/pushd %{buildroot}%{_bindir}
101 cp -a arm/bin/push_tool %{buildroot}%{_bindir}
102 cp -a arm/share/push/*.cer %{buildroot}/usr/share/push/
103 %if %{_support_weblog}
104         arm/bin/pushlog_tool
105 %endif
106 %else
107 #libpush
108 cp -a x86/lib/libpush.so.* %{buildroot}%{_libdir}
109 #libpus-devel
110 cp -a x86/lib/libpush.so %{buildroot}%{_libdir}
111 #push-bin
112 cp -a x86/bin/pushd %{buildroot}%{_bindir}
113 cp -a x86/bin/push_tool %{buildroot}%{_bindir}
114 cp -a x86/share/push/*.cer %{buildroot}/usr/share/push/
115 %if %{_support_weblog}
116         x86/bin/pushlog_tool
117 %endif
118 %endif
119
120
121 %post bin
122 mkdir -p /opt/usr/dbspace
123 sqlite3 /opt/usr/dbspace/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
124 chown system:5000 /opt/usr/dbspace/.push.db
125 chown system:5000 /opt/usr/dbspace/.push.db-journal
126 chmod 660 /opt/usr/dbspace/.push.db
127 chmod 660 /opt/usr/dbspace/.push.db-journal
128
129 chsmack -a 'push-service::db' /opt/usr/dbspace/.push.db
130 chsmack -a 'push-service::db' /opt/usr/dbspace/.push.db-journal
131
132 %post -n libpush
133 /sbin/ldconfig
134
135 %postun -p /sbin/ldconfig
136
137 %files -n libpush
138 %manifest libpush.manifest
139 %attr(644,system,system)%{_libdir}/libpush.so.*
140
141 %files -n libpush-devel
142 %{_includedir}/*.h
143 %{_libdir}/pkgconfig/*.pc
144 %{_libdir}/libpush.so
145
146 %files bin
147 %manifest push-bin.manifest
148 %attr(755,system,system)%{_bindir}/pushd
149 %attr(644,system,system)/usr/share/push/*.cer
150 %attr(644,system,system)/usr/share/license/%{name}
151
152 # This is a certificate file to access to logging server by HTTPS.
153 %if %{_support_weblog}
154 %attr(644,system,system)/usr/share/push/push_sslkey.pem
155 %attr(644,system,system)/usr/share/push/prd-dl-key.pem
156 %endif
157
158 %attr(755,system,system)/usr/lib/systemd/user/pushd.service
159 %attr(755,system,system)/usr/lib/systemd/user/tizen-middleware.target.wants/pushd.service
160 %attr(755,system,system)%{_libdir}/systemd/system/multi-user.target.wants/pushd.service
161 %attr(755,system,system)%{_libdir}/systemd/system/pushd.service
162
163 %files tool
164 %manifest push-tool.manifest
165 %{_bindir}/push_tool
166
167 %if %{_support_weblog}
168         %{_bindir}/pushlog_tool
169 %endif
170
171 %changelog
172 * Sat Nov 3 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.26
173 - Prevent bug fixed(out-of bounds read, dead code,..)
174 * Mon Oct 22 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.25
175 - bundle null check added & protobuf null check added
176 * Wed Sep 19 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.24
177 - when pkg is uninstlled, db process is added
178 * Fri Sep 7 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.23
179 - emul check logic is changed(using capi-system-info)
180 * Tue Sep 4 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.22
181 - decoding of message with space character which is urlencoded to "+"
182 * Wed Aug 29 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.21
183 - package uninstalled event added
184 * Fri Aug 17 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.20
185 - debug msg added & some internal function name changed
186 * Wed Aug 8 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.19
187 - push noti default action is silent, and old key is deleted
188 * Wed Aug 8 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.18
189 - tapi imei api is changed for new tapi
190 * Tue Aug 7 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.17
191 - emulator check func is added
192 * Wed Jul 25 2012 Jooseok Park <jooseok.park@samsung.com> - 0.2.16
193 - OSP Push noti support(alertMessage,..)
194