Fix for PTREL-288
[platform/core/telephony/tel-plugin-packetservice.git] / packaging / tel-plugin-packetservice.spec
1 Name:       tel-plugin-packetservice
2 Summary:    Telephony Packet Service library
3 Version:    0.1.34
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache-2.0
7 Source0:    tel-plugin-packetservice-%{version}.tar.gz
8 Source1001:     tel-plugin-packetservice.manifest
9 Requires(post): /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(glib-2.0)
13 BuildRequires:  pkgconfig(dbus-glib-1)
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(tcore)
16 BuildRequires:  pkgconfig(iniparser)
17 BuildRequires:  pkgconfig(libtzplatform-config)
18
19 %description
20 Telephony Packet Service library
21
22 %prep
23 %setup -q
24 cp %{SOURCE1001} .
25
26 %build
27 %cmake . -DSYSCONFDIR=%{_sysconfdir}
28 make %{?jobs:-j%jobs}
29
30 %post 
31 /sbin/ldconfig
32
33 #create db
34 mkdir -p %{TZ_SYS_DB}  
35
36 if [ ! -f %{TZ_SYS_DB}/.dnet.db ]
37 then
38   sqlite3 %{TZ_SYS_DB}/.dnet.db < /usr/share/ps-plugin/dnet_db.sql
39   sqlite3 %{TZ_SYS_DB}/.dnet.db < /usr/share/ps-plugin/dnet_db_data.sql
40 fi
41
42 rm -f /usr/share/ps-plugin/dnet_db.sql
43 rm -f /usr/share/ps-plugin/dnet_db_data.sql
44
45 #change file permission
46 if [ -f %{TZ_SYS_DB}/.dnet.db ]
47 then
48   chmod 660 %{TZ_SYS_DB}/.dnet.db
49 fi
50
51 if [ -f %{TZ_SYS_DB}/.dnet.db-journal ]
52 then
53   chmod 664 %{TZ_SYS_DB}/.dnet.db-journal
54 fi
55
56 %postun -p /sbin/ldconfig
57
58 %install
59 %make_install
60 mkdir -p %{buildroot}/usr/share/license
61 cp LICENSE %{buildroot}/usr/share/license/%{name}
62
63 %files
64 %manifest %{name}.manifest
65 %defattr(-,root,root,-)
66 /usr/share/ps-plugin/dnet_db.sql
67 /usr/share/ps-plugin/dnet_db_data.sql
68 %{_sysconfdir}/dbus-1/system.d/*
69 %{_libdir}/telephony/plugins/ps-plugin*
70 /usr/share/license/%{name}