8d78dc2b59dc76e3a03d75848f7dbb33fe6672bd
[platform/core/pim/libaccounts-svc.git] / packaging / libaccounts-svc.spec
1
2 Name:       libaccounts-svc
3 Summary:    Account DB library
4 Version:    0.2.52
5 Release:    1
6 Group:      TO_BE/FILLED_IN
7 License:    Apache-2.0
8 Source0:    libaccounts-svc-%{version}.tar.gz
9 Source1001:     libaccounts-svc.manifest
10
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(db-util)
15 BuildRequires:  pkgconfig(capi-base-common)
16 BuildRequires:  pkgconfig(vconf)
17 BuildRequires:  pkgconfig(capi-appfw-application)
18 BuildRequires:  pkgconfig(libxml-2.0)
19 BuildRequires:  pkgconfig(pkgmgr-info)
20 BuildRequires:  pkgconfig(aul)
21 Requires(post): /sbin/ldconfig
22 Requires(post): /usr/bin/sqlite3
23 Requires(postun): /sbin/ldconfig
24
25 %description
26 Account DB libraryXB-Public-Package: no
27
28 %package devel
29 Summary:    Development files for %{name}
30 Group:      Development/Libraries
31 Requires:   %{name} = %{version}-%{release}
32 %description devel
33 Development files for %{name}
34
35 %prep
36 %setup -q
37 cp %{SOURCE1001} .
38
39 %build
40 export CFLAGS="${CFLAGS} -fPIC -fvisibility=hidden"
41 %cmake .
42
43 make %{?jobs:-j%jobs}
44
45 %install
46 rm -rf %{buildroot}
47 %make_install
48
49 rm -rf %{buildroot}%{_libdir}/accounts-svc
50
51 %post
52 /sbin/ldconfig
53 if [ ! -d /opt/dbspace ]
54 then
55         mkdir -p /opt/dbspace
56 fi
57 if [ ! -f /opt/dbspace/.account.db ]
58 #rm -rf /opt/dbspace/.account.db*
59 then
60         sqlite3 /opt/dbspace/.account.db 'PRAGMA journal_mode = PERSIST;
61         CREATE TABLE if not exists label (AppId TEXT, Label TEXT, Locale TEXT);
62         CREATE TABLE if not exists account_type (_id INTEGER PRIMARY KEY AUTOINCREMENT, AppId TEXT,
63         ServiceProviderId TEXT, IconPath TEXT, SmallIconPath TEXT, MultipleAccountSupport INT);
64         CREATE TABLE if not exists account_custom (AccountId INTEGER, AppId TEXT, Key TEXT, Value TEXT);
65         CREATE TABLE if not exists account (_id INTEGER PRIMARY KEY AUTOINCREMENT, user_name TEXT, email_address TEXT, display_name TEXT, icon_path TEXT,
66         source TEXT, package_name TEXT, access_token TEXT, domain_name TEXT, auth_type INTEGER, secret INTEGER, sync_support INTEGER,
67         txt_custom0 TEXT, txt_custom1 TEXT, txt_custom2 TEXT, txt_custom3 TEXT, txt_custom4 TEXT,
68         int_custom0 INTEGER, int_custom1 INTEGER, int_custom2 INTEGER, int_custom3 INTEGER, int_custom4 INTEGER);
69         CREATE TABLE if not exists capability (_id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, value INTEGER,
70         package_name TEXT, user_name TEXT,  account_id INTEGER, FOREIGN KEY (account_id) REFERENCES account(_id));
71         CREATE TABLE if not exists provider_feature (app_id TEXT, key TEXT);'
72 fi
73
74 mkdir -p /opt/usr/share/account
75 chown 5000:5000 /opt/dbspace/.account.db
76 chown 5000:5000 /opt/dbspace/.account.db-journal
77 chown 5000:5000 /opt/usr/share/account
78
79 chmod 660 /opt/dbspace/.account.db
80 chmod 660 /opt/dbspace/.account.db-journal
81 chmod 755 /opt/usr/share/account
82
83 #set message key value to NULL
84 vconftool set -t string db/account/msg '' -g 6514
85
86 #smack labeling
87 %postun -p /sbin/ldconfig
88
89 %files
90 %manifest %{name}.manifest
91 %defattr(-,root,root,-)
92 %{_libdir}/*.so.*
93 %{_bindir}/account-xml-verify
94
95 %files devel
96 %manifest %{name}.manifest
97 %defattr(-,root,root,-)
98 %{_libdir}/*.so
99 %{_libdir}/pkgconfig/accounts-svc.pc
100 %{_includedir}/*.h
101 %{_bindir}/account-xml-verify