d17cc6cdc4a9cef610e59b4982e41b87c4b4c80f
[platform/core/account/account-manager.git] / packaging / account-manager.spec
1
2 Name:       account-manager
3 Summary:    Account Manager
4 Version:    0.0.4
5 Release:    1
6 Group:      Social & Content/Other
7 License:    Apache-2.0
8 Source0:    account-manager-%{version}.tar.gz
9 Source1:    org.tizen.account.manager.service
10 Source2:    org.tizen.account.manager.conf
11
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(db-util)
15 BuildRequires:  pkgconfig(capi-base-common)
16 BuildRequires:  pkgconfig(pkgmgr-info)
17 BuildRequires:  pkgconfig(aul)
18 BuildRequires:  pkgconfig(glib-2.0) >= 2.26
19 BuildRequires:  pkgconfig(gio-2.0)
20 BuildRequires:  pkgconfig(vconf)
21 BuildRequires:  pkgconfig(cynara-client)
22 BuildRequires:  pkgconfig(cynara-session)
23 BuildRequires:  pkgconfig(cynara-creds-gdbus)
24 BuildRequires:  pkgconfig(account-common)
25 BuildRequires:  pkgconfig(accounts-svc)
26
27 Requires(post): /sbin/ldconfig
28 Requires(post): /usr/bin/sqlite3
29 Requires(postun): /sbin/ldconfig
30
31 %description
32 Account Daemon: no
33
34 %prep
35 %setup -q
36 cp %{SOURCE1} .
37
38 %build
39 #export   CFLAGS+=" -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default"
40 #export CXXFLAGS+=" -Wextra -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wswitch-default -Wnon-virtual-dtor -Wno-c++0x-compat"
41 #export   CFLAGS+=" -Wno-unused-parameter -Wno-empty-body"
42 #export CXXFLAGS+=" -Wno-unused-parameter -Wno-empty-body"
43
44 #export   CFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow -fno-common"
45 #export CXXFLAGS+=" -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-strict-aliasing -fno-unroll-loops -fsigned-char -fstrict-overflow"
46
47 export CFLAGS="${CFLAGS} -fvisibility=hidden -fPIE"
48 export LDFLAGS="${LDFLAGS} -pie"
49 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir}
50
51 make %{?jobs:-j%jobs}
52
53 %install
54 rm -rf %{buildroot}
55 %make_install
56
57 rm -rf %{buildroot}/usr/lib/account-manager
58
59 mkdir -p %{buildroot}/usr/share/dbus-1/system-services
60 install -m 0644 %SOURCE1 %{buildroot}/usr/share/dbus-1/system-services/org.tizen.account.manager.service
61
62 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d
63 install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/dbus-1/system.d/
64
65 %post
66 /sbin/ldconfig
67 #if [ ! -d /opt/usr/dbspace ]
68 #then
69 #        mkdir -p /opt/usr/dbspace
70 #fi
71 if [ ! -f %{TZ_SYS_DB}/.account.db ]
72 then
73         sqlite3 %{TZ_SYS_DB}/.account.db 'PRAGMA journal_mode = PERSIST;
74         CREATE TABLE if not exists label (AppId TEXT, Label TEXT, Locale TEXT);
75         CREATE TABLE if not exists account_type (_id INTEGER PRIMARY KEY AUTOINCREMENT, AppId TEXT,
76         ServiceProviderId TEXT, IconPath TEXT, SmallIconPath TEXT, MultipleAccountSupport INT);
77         CREATE TABLE if not exists account_custom (AccountId INTEGER, AppId TEXT, Key TEXT, Value TEXT);
78         CREATE TABLE if not exists account (_id INTEGER PRIMARY KEY AUTOINCREMENT, user_name TEXT, email_address TEXT, display_name TEXT, icon_path TEXT,
79         source TEXT, package_name TEXT, access_token TEXT, domain_name TEXT, auth_type INTEGER, secret INTEGER, sync_support INTEGER,
80         txt_custom0 TEXT, txt_custom1 TEXT, txt_custom2 TEXT, txt_custom3 TEXT, txt_custom4 TEXT,
81         int_custom0 INTEGER, int_custom1 INTEGER, int_custom2 INTEGER, int_custom3 INTEGER, int_custom4 INTEGER);
82         CREATE TABLE if not exists capability (_id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, value INTEGER,
83         package_name TEXT, user_name TEXT,  account_id INTEGER, FOREIGN KEY (account_id) REFERENCES account(_id));
84         CREATE TABLE if not exists provider_feature (app_id TEXT, key TEXT);
85 '
86 fi
87
88 chown system:system %{TZ_SYS_DB}/.account.db
89 chown system:system %{TZ_SYS_DB}/.account.db-journal
90
91 chmod 600 %{TZ_SYS_DB}/.account.db
92 chmod 600 %{TZ_SYS_DB}/.account.db-journal
93
94 #smack labeling
95 chsmack -a 'System' %{TZ_SYS_DB}/.account.db-journal
96 chsmack -a 'System' %{TZ_SYS_DB}/.account.db
97 %postun -p /sbin/ldconfig
98
99
100 %files
101 %manifest account-svcd.manifest
102 %defattr(-,system,system,-)
103 %config %{_sysconfdir}/dbus-1/system.d/org.tizen.account.manager.conf
104 %{_bindir}/account-svcd
105 %attr(0644,system,system) /usr/share/dbus-1/system-services/org.tizen.account.manager.service
106