Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / packaging / oma-ds-agent.spec
1 Name:       oma-ds-agent
2 Summary:    oma-ds-agent daemon for data sync
3 Version:    0.1.6
4 Release:    1
5 Group:      TO_BE/FILLED_IN
6 License:    Apache License, Version 2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Requires(post): /sbin/ldconfig
9 Requires(postun): /sbin/ldconfig
10 BuildRequires:  pkgconfig(glib-2.0)
11 BuildRequires:  pkgconfig(libsoup-2.4)
12 BuildRequires:  pkgconfig(sqlite3)
13 BuildRequires:  pkgconfig(sync-agent)
14 BuildRequires:  pkgconfig(vconf)
15 BuildRequires:  pkgconfig(libwbxml2)
16 BuildRequires:  pkgconfig(dbus-glib-1)
17 BuildRequires:  pkgconfig(check)
18 BuildRequires:  pkgconfig(memo)
19 BuildRequires:  pkgconfig(contacts-service2)
20 BuildRequires:  pkgconfig(dlog)
21 BuildRequires:  pkgconfig(aul)
22 BuildRequires:  expat-devel
23 BuildRequires:  cmake
24
25
26 %description
27 oma-ds-agent daemon (development headers)
28
29 %package -n ds-public-plugins
30 Summary:    DS Public Plugins
31 Group:      TO_BE_FILLED
32
33 %description -n ds-public-plugins
34 ds public plugins for sync-agent
35
36
37 %prep
38 %setup -q
39
40
41 %build
42 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
43 make %{?jobs:-j%jobs}
44
45
46 %install
47 rm -rf %{buildroot}
48 %make_install
49
50
51 %clean
52 rm -rf %{buildroot}
53
54
55 %post
56 if [ ! -d /opt/dbspace ]
57 then
58         mkdir /opt/dbspace
59 fi
60 if [ ! -d /etc/rc.d/rc3.d ]
61 then
62         mkdir /etc/rc.d/rc3.d
63 fi
64 if [ ! -d /etc/rc.d/rc5.d ]
65 then
66         mkdir /etc/rc.d/rc5.d
67 fi
68
69 ln -s /etc/init.d/oma-ds /etc/rc.d/rc3.d/S91oma-ds-agent
70 ln -s /etc/init.d/oma-ds /etc/rc.d/rc5.d/S91oma-ds-agent
71
72 sqlite3 /opt/dbspace/.omasyncagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
73
74 chmod 600 /opt/dbspace/.omasyncagent.db
75 chmod 600 /opt/dbspace/.omasyncagent.db-journal
76
77 if [ -f /usr/lib/rpm-plugins/msm.so ]
78 then
79         chsmack -a oma-ds-agent::db /opt/dbspace/.omasyncagent.db
80         chsmack -a oma-ds-agent::db /opt/dbspace/.omasyncagent.db-journal
81 fi
82
83 #/etc/init.d/oma-ds start
84
85
86 %preun
87 /etc/init.d/oma-ds stop
88
89
90 %postun
91
92 rm -f /tmp/agent_fw_event_omads*
93 rm -f /tmp/agent_fw_noti_reply_omads*
94
95 rm -f /etc/rc.d/rc3.d/S91oma-ds-agent
96 rm -f /etc/rc.d/rc5.d/S91oma-ds-agent
97
98 rm -f /opt/dbspace/.omasyncagent.db /opt/dbspace/.omasyncagent.db-journal
99
100 rm -rf /usr/share/oma-ds-cfg
101
102
103 %files
104 %manifest oma-ds-agent.manifest
105 %defattr(-,root,root,-)
106 /usr/share/dbus-1/services/*
107 /usr/bin/oma-ds-agent
108
109 /usr/share/oma-ds-cfg/*
110
111 %defattr(700,root,root)
112 /etc/init.d/oma-ds
113
114 %files -n ds-public-plugins
115 %manifest ds-public-plugins.manifest
116 %defattr(-,root,root,-)
117 /usr/lib/sync-agent/ds-public/*