Header files unification
[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(tel-headers)
23 BuildRequires:  pkgconfig(iniparser)
24 BuildRequires:  pkgconfig(libtzplatform-config)
25 Requires(post): /sbin/ldconfig
26 Requires(postun): /sbin/ldconfig
27 %description
28 Telephony Packet Service library
29
30 %prep
31 %setup -q
32 cp %{SOURCE1001} .
33
34 %build
35 %cmake . -DSYSCONFDIR=%{_sysconfdir}
36 make %{?jobs:-j%jobs}
37
38 %post 
39 /sbin/ldconfig
40
41 #create db
42 mkdir -p %{TZ_SYS_DB}  
43
44 if [ ! -f %{TZ_SYS_DB}/.dnet.db ]
45 then
46   sqlite3 %{TZ_SYS_DB}/.dnet.db < /usr/share/ps-plugin/dnet_db.sql
47   sqlite3 %{TZ_SYS_DB}/.dnet.db < /usr/share/ps-plugin/dnet_db_data.sql
48 fi
49
50 rm -f /usr/share/ps-plugin/dnet_db.sql
51 rm -f /usr/share/ps-plugin/dnet_db_data.sql
52
53 #change file permission
54 if [ -f %{TZ_SYS_DB}/.dnet.db ]
55 then
56   chmod 660 %{TZ_SYS_DB}/.dnet.db
57   chsmack -a 'System' %{TZ_SYS_DB}/.dnet.db
58 fi
59
60 if [ -f %{TZ_SYS_DB}/.dnet.db-journal ]
61 then
62   chmod 664 %{TZ_SYS_DB}/.dnet.db-journal
63   chsmack -a 'System' %{TZ_SYS_DB}/.dnet.db-journal
64 fi
65
66 %postun -p /sbin/ldconfig
67
68 %install
69 %make_install
70 mkdir -p %{buildroot}/usr/share/license
71 cp LICENSE %{buildroot}/usr/share/license/%{name}
72
73 %files
74 %manifest %{name}.manifest
75 %defattr(-,root,root,-)
76 /usr/share/ps-plugin/dnet_db.sql
77 /usr/share/ps-plugin/dnet_db_data.sql
78 %{_sysconfdir}/dbus-1/system.d/*
79 %{_libdir}/telephony/plugins/ps-plugin*
80 /usr/share/license/%{name}