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