Generate Licence file
[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
18 %description
19 Telephony Packet Service library
20
21 %prep
22 %setup -q
23 cp %{SOURCE1001} .
24
25 %build
26 %cmake . -DSYSCONFDIR=%{_sysconfdir}
27 make %{?jobs:-j%jobs}
28
29 %post 
30 /sbin/ldconfig
31
32 #create db
33 mkdir -p /opt/dbspace
34
35 if [ ! -f /opt/dbspace/.dnet.db ]
36 then
37   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db.sql
38   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db_data.sql
39 fi
40
41 rm -f /usr/share/ps-plugin/dnet_db.sql
42 rm -f /usr/share/ps-plugin/dnet_db_data.sql
43
44 #change file permission
45 if [ -f /opt/dbspace/.dnet.db ]
46 then
47   chmod 660 /opt/dbspace/.dnet.db
48 fi
49
50 if [ -f /opt/dbspace/.dnet.db-journal ]
51 then
52   chmod 664 /opt/dbspace/.dnet.db-journal
53 fi
54
55 %postun -p /sbin/ldconfig
56
57 %install
58 %make_install
59 mkdir -p %{buildroot}/usr/share/license
60 cp LICENSE %{buildroot}/usr/share/license/%{name}
61
62 %files
63 %manifest %{name}.manifest
64 %defattr(-,root,root,-)
65 /usr/share/ps-plugin/dnet_db.sql
66 /usr/share/ps-plugin/dnet_db_data.sql
67 %{_sysconfdir}/dbus-1/system.d/*
68 %{_libdir}/telephony/plugins/ps-plugin*
69 /usr/share/license/%{name}