Modification about smack label of db file belong to process.
[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   chsmack -a 'System' %{TZ_SYS_DB}/.dnet.db
57 fi
58
59 if [ -f %{TZ_SYS_DB}/.dnet.db-journal ]
60 then
61   chmod 664 %{TZ_SYS_DB}/.dnet.db-journal
62   chsmack -a 'System' %{TZ_SYS_DB}/.dnet.db-journal
63 fi
64
65 %postun -p /sbin/ldconfig
66
67 %install
68 %make_install
69 mkdir -p %{buildroot}/usr/share/license
70 cp LICENSE %{buildroot}/usr/share/license/%{name}
71
72 %files
73 %manifest %{name}.manifest
74 %defattr(-,root,root,-)
75 /usr/share/ps-plugin/dnet_db.sql
76 /usr/share/ps-plugin/dnet_db_data.sql
77 %{_sysconfdir}/dbus-1/system.d/*
78 %{_libdir}/telephony/plugins/ps-plugin*
79 /usr/share/license/%{name}