Apply cynara APIs (remove security-server dependency)
[platform/core/telephony/tel-plugin-packetservice.git] / packaging / tel-plugin-packetservice.spec
1 %define major 0
2 %define minor 2
3 %define patchlevel 98
4
5 Name:           tel-plugin-packetservice
6 Version:        %{major}.%{minor}.%{patchlevel}
7 Release:        0
8 License:        Apache
9 Summary:        Telephony Packet Service library
10 Group:          System/Libraries
11 Source0:        tel-plugin-packetservice-%{version}.tar.gz
12 BuildRequires:  cmake
13 BuildRequires:  python
14 BuildRequires:  python-xml
15 #BuildRequires:  model-build-features
16 BuildRequires:  pkgconfig(gio-2.0)
17 BuildRequires:  pkgconfig(gio-unix-2.0)
18 BuildRequires:  pkgconfig(glib-2.0)
19 BuildRequires:  pkgconfig(libxml-2.0)
20 BuildRequires:  pkgconfig(iniparser)
21 BuildRequires:  pkgconfig(tcore)
22 BuildRequires:  pkgconfig(db-util)
23 BuildRequires:  pkgconfig(vconf)
24 BuildRequires:  pkgconfig(alarm-service)
25 BuildRequires:  pkgconfig(cynara-client)
26 BuildRequires:  pkgconfig(cynara-session)
27 Requires(post): /sbin/ldconfig
28 Requires(postun): /sbin/ldconfig
29
30 %description
31 Telephony Packet Service library
32
33 %prep
34 %setup -q
35
36 %build
37 %cmake . -DSYSCONFDIR=%{_sysconfdir} \
38         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
39         -DLIB_INSTALL_DIR=%{_libdir}
40 make %{?jobs:-j%jobs}
41
42 %post
43 /sbin/ldconfig
44
45 #create db
46 mkdir -p /opt/dbspace
47
48 if [ ! -f /opt/dbspace/.dnet.db ]
49 then
50   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db.sql
51   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db_init.sql
52 fi
53 if [ ! -f /opt/dbspace/.dnet2.db ]
54 then
55   sqlite3 /opt/dbspace/.dnet2.db < /usr/share/ps-plugin/dnet_db.sql
56   sqlite3 /opt/dbspace/.dnet2.db < /usr/share/ps-plugin/dnet_db_init.sql
57 fi
58
59 rm -f /usr/share/ps-plugin/dnet_db.sql
60
61 #change file permission
62 if [ -f /opt/dbspace/.dnet.db ]
63 then
64         chmod 660 /opt/dbspace/.dnet.db
65         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet.db
66 fi
67
68 if [ -f /opt/dbspace/.dnet.db-journal ]
69 then
70         chmod 664 /opt/dbspace/.dnet.db-journal
71         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet.db-journal
72 fi
73
74 if [ -f /opt/dbspace/.dnet2.db ]
75 then
76         chmod 660 /opt/dbspace/.dnet2.db
77         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet2.db
78 fi
79
80 if [ -f /opt/dbspace/.dnet2.db-journal ]
81 then
82         chmod 664 /opt/dbspace/.dnet2.db-journal
83         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet2.db-journal
84 fi
85
86 if [ -f /etc/opt/upgrade/520.tel-plugin-packetservice.patch.sh ]
87 then
88         chmod 700 /etc/opt/upgrade/520.tel-plugin-packetservice.patch.sh
89 fi
90
91 if [ -f /opt/etc/dump.d/module.d/dump_packetservice.sh ]
92 then
93         chmod 700 /opt/etc/dump.d/module.d/dump_packetservice.sh
94 fi
95
96 %postun -p /sbin/ldconfig
97
98 %install
99 %make_install
100 mkdir -p %{buildroot}%{_datadir}/license
101
102 %files
103 %manifest tel-plugin-packetservice.manifest
104 %defattr(-,root,root,-)
105 /opt/etc/dump.d/module.d/dump_packetservice.sh
106 #%doc COPYING
107 %{_datadir}/ps-plugin/dnet_db.sql
108 %{_datadir}/ps-plugin/dnet_db_init.sql
109 %{_datadir}/ps-plugin/apns-conf.xml
110 %{_sysconfdir}/opt/upgrade/*
111 %{_libdir}/telephony/plugins/ps-plugin*
112 %{_datadir}/license/tel-plugin-packetservice