blob: 8ec5c55f9e125c7ecd66e3a4cd3ea8e6c380a61b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
Name: email-service
Summary: E-mail Framework Middleware package
Version: 0.13.6
Release: 1
Group: System/Libraries
License: Apache License, Version 2.0, BSD
Source0: %{name}-%{version}.tar.gz
Source1: email.service
Requires: connman
Requires: webkit2-efl
Requires(post): /sbin/ldconfig
Requires(post): systemd
Requires(post): /usr/bin/sqlite3
Requires(post): /usr/bin/vconftool
Requires(post): libss-client
Requires(post): ss-server
Requires(preun): systemd
Requires(postun): /sbin/ldconfig
Requires(postun): systemd
BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(vconf-internal-keys)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(contacts-service2)
BuildRequires: pkgconfig(uw-imap-toolkit)
BuildRequires: pkgconfig(drm-client)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(alarm-service)
BuildRequires: pkgconfig(mm-player)
BuildRequires: pkgconfig(mm-session)
BuildRequires: pkgconfig(secure-storage)
BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(accounts-svc)
BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: pkgconfig(cert-svc)
BuildRequires: pkgconfig(badge)
BuildRequires: pkgconfig(feedback)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(libwbxml2)
BuildRequires: pkgconfig(msg-service)
BuildRequires: pkgconfig(pmapi)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(security-server)
BuildRequires: pkgconfig(deviced)
BuildRequires: pkgconfig(icu-i18n)
%description
E-mail Framework Middleware Library/Binary package
%package devel
Summary: E-mail Framework Middleware Development package
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
E-mail Framework Middleware Development package
%prep
%setup -q
%build
export CFLAGS="${CFLAGS} -fPIC -Wall -g -fvisibility=hidden"
export CXXFLAGS="${CXXFLAGS} -fPIC -Wall -g -fvisibility=hidden"
export LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--rpath=%{_libdir} -Wl,--as-needed"
%cmake .
make %{?_smp_mflags}
%install
mkdir -p %{buildroot}/usr/share/license
%make_install
mkdir -p %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants
install -m 0644 %SOURCE1 %{buildroot}/usr/lib/systemd/user/
ln -sf ../email.service %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants/
%post
/sbin/ldconfig
#################################################################
# Add preset account information
#################################################################
echo "[EMAIL-SERVICE] Start adding preset account information..."
################################################################################################
# for active sync
vconftool set -t int db/email_handle/active_sync_handle "0" -g 6514 -s "email::vconf_active_sync_handle"
# for default mail slot szie
vconftool set -t int db/private/email-service/slot_size "100" -g 6514 -s "email::vconf_slot_size"
# for latest mail id
vconftool set -t int db/private/email-service/latest_mail_id "0" -g 6514 -s "email::vconf_latest_mail_id"
# for default account id
vconftool set -t int db/private/email-service/default_account_id "0" -g 6514 -s "email::vconf_default_account_id"
# for default account id
vconftool set -t int memory/sync/email "0" -i -g 6514 -s "email::vconf_sync_status"
# for priority send
vconftool set -t string db/private/email-service/noti_ringtone_path "/opt/usr/share/settings/Alerts/Over the horizon.mp3" -g 6514 -s "email::vconf_ringtone_path"
vconftool set -t int db/private/email-service/noti_rep_type "0" -g 6514 -s "email::vconf_rep_type"
vconftool set -t bool db/private/email-service/noti_notification_ticker "0" -g 6514 -s "email::vconf_notification"
vconftool set -t bool db/private/email-service/noti_display_content_ticker "0" -g 6514 -s "email::vconf_display_content"
vconftool set -t bool db/private/email-service/noti_badge_ticker "0" -i -g 6514 -s "email::vconf_bagdge"
vconftool set -t int db/private/email-service/noti_private_id/1 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/2 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/3 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/4 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/5 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/6 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/7 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/8 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/9 "0" -i -g 6514
vconftool set -t int db/private/email-service/noti_private_id/10 "0" -i -g 6514
vconftool set -t bool db/private/email-service/noti_vibration_status "0" -g 6514 -s "email::vconf_vibration"
vconftool set -t bool db/private/email-service/noti_vip_vibration_status "0" -g 6514 -s "email::vconf_vip_vibration"
vconftool set -t bool db/private/email-service/noti_use_default_ringtone "1" -g 6514 -s "email::vconf_use_default_ringtone"
vconftool set -t bool db/private/email-service/noti_vip_use_default_ringtone "1" -g 6514 -s "email::vconf_vip_use_default_ringtone"
#################################################################
# Set executin script
#################################################################
echo "[EMAIL-SERVICE] Set executing script ..."
EMAIL_SERVICE_EXEC_SCRIPT=/etc/rc.d/init.d/email-service
EMAIL_SERVICE_BOOT_SCRIPT=/etc/rc.d/rc3.d/S70email-service
EMAIL_SERVICE_FASTBOOT_SCRIPT=/etc/rc.d/rc5.d/S70email-service
echo '#!/bin/sh' > ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'account_count=$(sqlite3 /opt/usr/dbspace/.email-service.db "select COUNT(*) from mail_account_tbl")' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'if [ "$(echo "$account_count" | cut -c0-1)" == "0" ]' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'then' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo ' echo 'There is no account'' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'elif [ "$(echo "$account_count" | cut -c0-1)" == "" ]' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'then' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo ' echo 'DB failure'' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'else' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo ' /usr/bin/email-service & ' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
echo 'fi' >> ${EMAIL_SERVICE_EXEC_SCRIPT}
chmod 755 ${EMAIL_SERVICE_EXEC_SCRIPT}
rm -rf ${EMAIL_SERVICE_BOOT_SCRIPT}
rm -rf ${EMAIL_SERVICE_FASTBOOT_SCRIPT}
ln -s ${EMAIL_SERVICE_EXEC_SCRIPT} ${EMAIL_SERVICE_BOOT_SCRIPT}
ln -s ${EMAIL_SERVICE_EXEC_SCRIPT} ${EMAIL_SERVICE_FASTBOOT_SCRIPT}
echo "[EMAIL-SERVICE] Finish executing script ..."
#################################################################
# Create DB file and tables.
#################################################################
echo "[EMAIL-SERVICE] Creating Email Tables ..."
mkdir -p /opt/usr
mkdir -p /opt/usr/dbspace
sqlite3 /opt/usr/dbspace/.email-service.db 'PRAGMA journal_mode = PERSIST;'
sqlite3 /opt/usr/dbspace/.email-service.db < /opt/usr/data/email/res/email-service.sql
echo "[EMAIL-SERVICE] Finish Creating Email Tables."
chgrp 6006 /opt/usr/dbspace/.email-service.db*
chmod 664 /opt/usr/dbspace/.email-service.db
chmod 664 /opt/usr/dbspace/.email-service.db-journal
mkdir -m775 -p /opt/usr/data/email/.email_data
chgrp 6006 /opt/usr/data/email/.email_data
chsmack -a 'email-service' /opt/usr/data/email/.email_data
mkdir -m775 -p /opt/usr/data/email/.email_data/tmp
chgrp 6006 /opt/usr/data/email/.email_data/tmp
chsmack -a 'email-service' /opt/usr/data/email/.email_data/tmp
mkdir -p /opt/share/cert-svc/certs/trusteduser/email
chgrp 6006 /opt/share/cert-svc/certs/trusteduser/email
if [ -f /opt/usr/dbspace/.email-service.db ]
then
chsmack -a 'email-service::db' /opt/usr/dbspace/.email-service.db*
fi
systemctl daemon-reload
if [ $1 == 1 ]; then
systemctl restart email.service
fi
%preun
if [ $1 == 0]; then
systemctl stop email.service
fi
%postun
/sbin/ldconfig
systemctl daemon-reload
%files
%manifest email-service.manifest
%exclude /usr/bin/email-test-app
%{_bindir}/email-service
/opt/usr/data/email/res/*
%{_libdir}/lib*.so.*
/usr/lib/systemd/user/email.service
/usr/lib/systemd/user/tizen-middleware.target.wants/email.service
/usr/share/dbus-1/services/email-service.service
/usr/share/license/email-service
/opt/etc/smack/accesses.d/email-service.rule
%files devel
%{_includedir}/email-service/*.h
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
|