[SR:oma-ds-agent_0.1.64] SR Release
[framework/system/oma-ds-agent.git] / packaging / oma-ds-agent.spec
1 Name:       oma-ds-agent
2 Summary:    oma-ds-agent daemon for data sync
3 Version:    0.1.64
4 Release:    1
5 Group:      TO_BE/FILLED_IN
6 License:    Apache License, Version 2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:        packaing/oma-ds-agent.service
9 Requires(post): /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(libsoup-2.4)
13 BuildRequires:  pkgconfig(sqlite3)
14 BuildRequires:  pkgconfig(sync-agent)
15 BuildRequires:  pkgconfig(vconf)
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 Requires: sys-assert
25
26
27 %description
28 oma-ds-agent daemon (development headers)
29
30 %package -n ds-public-plugins
31 Summary:    DS Public Plugins
32 Group:      TO_BE_FILLED
33
34 %description -n ds-public-plugins
35 ds public plugins for sync-agent
36
37
38 %prep
39 %setup -q
40
41
42 %build
43 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
44 make %{?jobs:-j%jobs}
45
46
47 %install
48 rm -rf %{buildroot}
49
50 if [ ! -d %{buildroot}/opt/dbspace ]
51 then
52         mkdir -p %{buildroot}/opt/dbspace
53 fi
54
55 sqlite3 %{buildroot}/opt/dbspace/.omasyncagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
56
57 %make_install
58
59 # systemd service script sertup
60 mkdir -p %{buildroot}%{_libdir}/systemd/system/graphical.target.wants
61 install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/
62 ln -s ../oma-ds-agent.service %{buildroot}%{_libdir}/systemd/system/graphical.target.wants/oma-ds-agent.service
63
64 %clean
65 rm -rf %{buildroot}
66
67
68 %post
69 if [ ! -d /opt/dbspace ]
70 then
71         mkdir /opt/dbspace
72 fi
73 if [ ! -d /etc/rc.d/rc3.d ]
74 then
75         mkdir /etc/rc.d/rc3.d
76 fi
77 if [ ! -d /etc/rc.d/rc5.d ]
78 then
79         mkdir /etc/rc.d/rc5.d
80 fi
81
82 if [ ! -f /etc/rc.d/rc3.d/S91oma-ds-agent ]
83 then
84 ln -s /etc/init.d/oma-ds /etc/rc.d/rc3.d/S91oma-ds-agent
85 fi
86
87 if [ ! -f /etc/rc.d/rc5.d/S91oma-ds-agent ]
88 then
89         ln -s /etc/init.d/oma-ds /etc/rc.d/rc5.d/S91oma-ds-agent
90 fi
91
92 #/etc/init.d/oma-ds start
93
94
95 %preun
96 /etc/init.d/oma-ds stop
97
98
99 %postun
100
101 rm -f /tmp/agent_fw_event_omads*
102 rm -f /tmp/agent_fw_noti_reply_omads*
103
104 rm -f /etc/rc.d/rc3.d/S91oma-ds-agent
105 rm -f /etc/rc.d/rc5.d/S91oma-ds-agent
106
107 rm -f /opt/dbspace/.omasyncagent.db /opt/dbspace/.omasyncagent.db-journal
108
109 rm -rf /usr/share/oma-ds-cfg
110
111
112 %files
113 %attr(600,root,root) /opt/dbspace/.omasyncagent.db
114 %attr(600,root,root) /opt/dbspace/.omasyncagent.db-journal
115
116 %manifest oma-ds-agent.manifest
117 %defattr(-,root,root,-)
118 /usr/share/dbus-1/services/*
119 /usr/bin/oma-ds-agent
120
121 /usr/share/oma-ds-cfg/*
122
123 %defattr(700,root,root)
124 /etc/init.d/oma-ds
125
126 %defattr(644,root,root)
127 /usr/lib/systemd/system/oma-ds-agent.service
128 /usr/lib/systemd/system/graphical.target.wants/oma-ds-agent.service
129
130 %files -n ds-public-plugins
131 %manifest ds-public-plugins.manifest
132 %defattr(-,root,root,-)
133 /usr/lib/sync-agent/ds-public/*