summaryrefslogtreecommitdiff
path: root/packaging/account-manager.spec
blob: 5d67b0e3ddcb822d72dafbf12bb0f8deffbf5258 (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
Name:       account-manager
Summary:    Account Manager
Version:    0.1.14
Release:    1
Group:      Social & Content/Other
License:    Apache-2.0
Source0:    account-manager-%{version}.tar.gz
Source1:    org.tizen.account.manager.service
Source2:    org.tizen.account.manager.conf
Source3:    accounts-service.service

BuildRequires:  cmake
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(db-util)
BuildRequires:  pkgconfig(capi-base-common)
BuildRequires:  pkgconfig(pkgmgr-info)
BuildRequires:	pkgconfig(glib-2.0) >= 2.26
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(vconf)
BuildRequires:  pkgconfig(cynara-client)
BuildRequires:  pkgconfig(cynara-session)
BuildRequires:  pkgconfig(cynara-creds-gdbus)
BuildRequires:  pkgconfig(account-common)
BuildRequires:  pkgconfig(libtzplatform-config)

%define upgrade_script_path /usr/share/upgrade/scripts

Requires(post): /sbin/ldconfig
Requires(post): /usr/bin/sqlite3
Requires(postun): /sbin/ldconfig

%description
Account Daemon: no

%prep
%setup -q
cp %{SOURCE1} .

%build
#export   CFLAGS+=" -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default"
#export CXXFLAGS+=" -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default -Wnon-virtual-dtor -Wno-c++0x-compat"
#export   CFLAGS+=" -Wno-unused-parameter -Wno-empty-body"
#export CXXFLAGS+=" -Wno-unused-parameter -Wno-empty-body"

#export   CFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow -fno-common"
#export CXXFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"

export CFLAGS="${CFLAGS} -fvisibility=hidden -fPIE"
export LDFLAGS="${LDFLAGS} -pie"
cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir}

make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
%make_install

rm -rf %{buildroot}/usr/lib/account-manager

mkdir -p %{buildroot}/usr/share/dbus-1/system-services
install -m 0644 %SOURCE1 %{buildroot}/usr/share/dbus-1/system-services/org.tizen.account.manager.service

mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/dbus-1/system.d/

mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
install -m 644 %SOURCE3 %{buildroot}%{_unitdir}/accounts-service.service
%install_service multi-user.target.wants accounts-service.service

mkdir -p %{buildroot}%{upgrade_script_path}
cp -f scripts/500.%{name}.sh %{buildroot}%{upgrade_script_path}


%post
/sbin/ldconfig
#if [ ! -d /opt/usr/dbspace ]
#then
#        mkdir -p /opt/usr/dbspace
#fi
mkdir -p %{TZ_SYS_DB}
if [ ! -f %{TZ_SYS_DB}/.account.db ]
then
        sqlite3 %{TZ_SYS_DB}/.account.db 'PRAGMA journal_mode = PERSIST;
        CREATE TABLE if not exists label (AppId TEXT, Label TEXT, Locale TEXT);
        CREATE TABLE if not exists account_type (_id INTEGER PRIMARY KEY AUTOINCREMENT, AppId TEXT,
        ServiceProviderId TEXT, IconPath TEXT, SmallIconPath TEXT, MultipleAccountSupport INT);
        CREATE TABLE if not exists account_custom (AccountId INTEGER, AppId TEXT, Key TEXT, Value TEXT);
        CREATE TABLE if not exists account (_id INTEGER PRIMARY KEY AUTOINCREMENT, user_name TEXT, email_address TEXT, display_name TEXT, icon_path TEXT,
        source TEXT, package_name TEXT, access_token TEXT, domain_name TEXT, auth_type INTEGER, secret INTEGER, sync_support INTEGER,
        txt_custom0 TEXT, txt_custom1 TEXT, txt_custom2 TEXT, txt_custom3 TEXT, txt_custom4 TEXT,
        int_custom0 INTEGER, int_custom1 INTEGER, int_custom2 INTEGER, int_custom3 INTEGER, int_custom4 INTEGER);
        CREATE TABLE if not exists capability (_id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, value INTEGER,
	package_name TEXT, user_name TEXT,  account_id INTEGER, FOREIGN KEY (account_id) REFERENCES account(_id));
	CREATE TABLE if not exists provider_feature (app_id TEXT, key TEXT);
'
fi

chown service_fw:service_fw %{TZ_SYS_DB}/.account.db
chown service_fw:service_fw %{TZ_SYS_DB}/.account.db-journal

chmod 644 %{TZ_SYS_DB}/.account.db
chmod 644 %{TZ_SYS_DB}/.account.db-journal

#smack labeling
#chsmack -a 'System::Shared' %{TZ_SYS_DB}/.account.db-journal
#chsmack -a 'System::Shared' %{TZ_SYS_DB}/.account.db
%postun -p /sbin/ldconfig


%files
%manifest account-svcd.manifest
#%defattr(-,system,system,-)
%config %{_sysconfdir}/dbus-1/system.d/org.tizen.account.manager.conf
%{_bindir}/account-svcd
%attr(0644,root,root) %{_unitdir}/accounts-service.service
%attr(0644,root,root) %{_unitdir}/multi-user.target.wants/accounts-service.service
%attr(0644,root,root) /usr/share/dbus-1/system-services/org.tizen.account.manager.service
%{upgrade_script_path}/500.%{name}.sh