Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / packaging / oma-dm-agent.spec
1 Name:       oma-dm-agent
2 Summary:    oma-dm-agent daemon for FOTA,DM,CP,FMM Service
3 Version:    0.1.73
4 Release:    1
5 Group:      TO_BE/FILLED_IN
6 License:    Apache-2.0
7 Source0:    oma-dm-agent-%{version}.tar.gz
8 Source1:    oma-dm-agent.service
9
10 #Requires(post): /sbin/ldconfig
11 BuildRequires:  pkgconfig(glib-2.0)
12 BuildRequires:  pkgconfig(sqlite3)
13 BuildRequires:  pkgconfig(libsoup-2.4)
14 BuildRequires:  pkgconfig(vconf)
15 BuildRequires:  pkgconfig(libwbxml2)
16 BuildRequires:  pkgconfig(libxml-2.0)
17 BuildRequires:  pkgconfig(check)
18 BuildRequires:  pkgconfig(sync-agent)
19 BuildRequires:  pkgconfig(aul)
20 BuildRequires:  pkgconfig(appsvc)
21 BuildRequires:  pkgconfig(push)
22 BuildRequires:  pkgconfig(sysman)
23 BuildRequires:  pkgconfig(capi-base-common)
24 BuildRequires:  pkgconfig(bundle)
25 BuildRequires:  pkgconfig(location)
26 BuildRequires:  pkgconfig(tapi)
27 BuildRequires:  pkgconfig(pmapi)
28 BuildRequires:  pkgconfig(capi-system-info)
29 BuildRequires:  pkgconfig(capi-telephony-sim)
30 BuildRequires:  pkgconfig(dlog)
31 BuildRequires:  pkgconfig(dbus-glib-1)
32 #BuildRequires:  pkgconfig(oauth)
33 #BuildRequires:  pkgconfig(samsung-sso-svc)
34
35 #BuildRequires:  pkgconfig(appcore-efl)
36 #BuildRequires:  pkgconfig(appcore-common)
37 BuildRequires:  libgcrypt-devel
38 BuildRequires:  expat-devel
39 BuildRequires:  cmake
40
41
42 %description
43 oma-dm-agent Daemon servcie
44
45 %package -n dm-private-plugins
46 Summary:    DM Private Plugins
47 Group:      TO_BE_FILLED
48
49 %description -n dm-private-plugins
50 dm private plugins for sync-agent
51
52 %package -n dm-public-plugins
53 Summary:    DM Public Plugins
54 Group:      TO_BE_FILLED
55
56 %description -n dm-public-plugins
57 dm public plugins for sync-agent
58
59 %prep
60 %setup -q
61
62
63 %build
64 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
65 make %{?jobs:-j%jobs}
66
67
68 %install
69 rm -rf %{buildroot}
70
71 if [ ! -d %{buildroot}/opt/usr/dbspace ]
72 then
73         mkdir -p %{buildroot}/opt/usr/dbspace
74 fi
75
76 sqlite3 %{buildroot}/opt/usr/dbspace/.dm_service.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
77 sqlite3 %{buildroot}/opt/usr/dbspace/.omadmagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
78 sqlite3 %{buildroot}/opt/usr/dbspace/.momanager.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null
79
80 %make_install
81
82 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
83 install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/oma-dm-agent.service
84 ln -s ../oma-dm-agent.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/oma-dm-agent.service
85
86 mkdir -p %{buildroot}/usr/share/license
87 cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license/%{name}
88 cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license/dm-private-plugins
89 cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license/dm-public-plugins
90
91
92 %clean
93 rm -rf %{buildroot}
94
95
96
97 %post
98
99 ###############################################################################################################
100 ##  Vconf setting... start
101 ###############################################################################################################
102 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/ConfVersion "0.1" -s oma-dm-agent::vconf_internal
103 /usr/bin/vconftool set -t int -f db/SyncML/oma-dm-service/DevManagement/NbDevManagement 3 -s oma-dm-agent::vconf_internal
104 ## mformation test server  ( http://mfiop25.mformation.com/iop )
105 ## Input the Phone number -> Input the IMEI number -> Manufacturer : Samsung -> Model : SGHT989 -> Not check Factory Bootstrapped -> Add button click
106 ## --> Modify device -> Server Auth Preference : syncml:auth-basic -> Client Auth Preference : syncml:auth-basic -> Modify button clieck
107 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/AccName "gcf" -s oma-dm-agent::vconf_internal
108 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServID "mform" -s oma-dm-agent::vconf_internal
109 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServAddr "https://bobafett.mformation.com:461/oma/iop" -s oma-dm-agent::vconf_internal
110 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServPwd "serverpwd" -s oma-dm-agent::vconf_internal
111 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServNonce "MTIzNDU=" -s oma-dm-agent::vconf_internal
112 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ClientNonce "MTIzNDU=" -s oma-dm-agent::vconf_internal
113 ## 0 : BASIC , 1 : DIGEST MD5 , 2 : HMAC , Default : DIGEST
114 #/usr/bin/vconftool set -t int  -f db/SyncML/oma-dm-service/DevManagement/1/AuthType 0 -s oma-dm-agent::vconf_internal
115 #/usr/bin/vconftool set -t int  -f db/SyncML/oma-dm-service/DevManagement/1/Port 461 -s oma-dm-agent::vconf_internal
116 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/UserName "clientid" -s oma-dm-agent::vconf_internal
117 #/usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ClientPwd "clientpwd" -s oma-dm-agent::vconf_internal
118 ##gcf test server
119 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/AccName "gcf" -s oma-dm-agent::vconf_internal
120 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServID "RSate" -s oma-dm-agent::vconf_internal
121 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServAddr "http://192.168.168.169/dm" -s oma-dm-agent::vconf_internal
122 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServPwd "RSatepass" -s oma-dm-agent::vconf_internal
123 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ServNonce "" -s oma-dm-agent::vconf_internal
124 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ClientNonce "" -s oma-dm-agent::vconf_internal
125 /usr/bin/vconftool set -t int   -f db/SyncML/oma-dm-service/DevManagement/1/AuthType 1 -s oma-dm-agent::vconf_internal
126 /usr/bin/vconftool set -t int   -f db/SyncML/oma-dm-service/DevManagement/1/Port 80 -s oma-dm-agent::vconf_internal
127 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/UserName "RSuser" -s oma-dm-agent::vconf_internal
128 /usr/bin/vconftool set -t string -f db/SyncML/oma-dm-service/DevManagement/1/ClientPwd "RSpass" -s oma-dm-agent::vconf_internal
129 ###############################################################################################################
130 ##  Vconf setting... end
131 ###############################################################################################################
132
133 %postun
134
135 rm -f /tmp/agent_fw_event_omadm*
136 rm -f /tmp/agent_fw_noti_reply_omadm*
137
138 rm -f /opt/usr/dbspace/.dm_service.db /opt/usr/dbspace/.dm_service.db-journal
139 rm -f /opt/usr/dbspace/.omadmagent.db /opt/usr/dbspace/.omadmagent.db-journal
140 rm -f /opt/usr/dbspace/.momanager.db /opt/usr/dbspace/.momanager.db-journal
141
142 rm -rf /usr/share/oma-dm-cfg
143
144
145 %files
146 %attr(600,root,root) /opt/usr/dbspace/.dm_service.db
147 %attr(600,root,root) /opt/usr/dbspace/.dm_service.db-journal
148 %attr(600,root,root) /opt/usr/dbspace/.omadmagent.db
149 %attr(600,root,root) /opt/usr/dbspace/.omadmagent.db-journal
150 %attr(600,root,root) /opt/usr/dbspace/.momanager.db
151 %attr(600,root,root) /opt/usr/dbspace/.momanager.db-journal
152 /etc/smack/accesses2.d/oma-dm-agent.rule
153 /usr/share/license/%{name}
154
155 %manifest oma-dm-agent.manifest
156 %defattr(-,root,root,-)
157 /usr/share/dbus-1/services/*
158 /usr/bin/oma-dm-agent
159
160 /usr/share/oma-dm-cfg/ddf/*
161 /usr/share/oma-dm-cfg/delta_size/*
162 /usr/share/oma-dm-cfg/fw-init/*
163 /usr/share/oma-dm-cfg/ipc/*
164
165
166 %defattr(700,root,root)
167 /usr/share/oma-dm-cfg/csc-setting/change_csc_value.sh
168 /usr/share/oma-dm-cfg/imei-setting/change_imei_callnum.sh
169
170 %{_libdir}/systemd/system/oma-dm-agent.service
171 %{_libdir}/systemd/system/multi-user.target.wants/oma-dm-agent.service
172
173 %files -n dm-private-plugins
174 %manifest dm-private-plugins.manifest
175 %defattr(-,root,root,-)
176 /usr/lib/sync-agent/dm-private/*
177 /usr/include/sync-agent/plugin/plugin_slp_device_dm.h
178 /usr/share/license/dm-private-plugins
179
180 %files -n dm-public-plugins
181 %manifest dm-public-plugins.manifest
182 %defattr(-,root,root,-)
183 /usr/lib/sync-agent/dm-public/*
184 /usr/share/license/dm-public-plugins
185