Tizen 2.1 base
[platform/core/telephony/tel-plugin-packetservice.git] / packaging / tel-plugin-packetservice.spec
1 #sbs-git:slp/pkgs/t/tel-plugin-packetservice
2 Name:       tel-plugin-packetservice
3 Summary:    Telephony Packet Service library
4 Version: 0.1.36
5 Release:    1
6 Group:      System/Libraries
7 License:    Apache
8 Source0:    tel-plugin-packetservice-%{version}.tar.gz
9 %ifarch %ix86
10 %if "%{simulator}" != "1"
11 patch0: 0001-main-Create-modems-only-when-one-modem-is-added.patch
12 patch1: 0002-dnet_db_data-Change-SFR-internet-APN-and-add-Bouygue.patch
13 patch2: 0003-context-Fix-context-creation-issue.patch
14 %endif
15 %endif
16 Requires(post): /sbin/ldconfig
17 Requires(postun): /sbin/ldconfig
18 BuildRequires:  cmake
19 BuildRequires:  pkgconfig(glib-2.0)
20 BuildRequires:  pkgconfig(dbus-glib-1)
21 BuildRequires:  pkgconfig(dlog)
22 BuildRequires:  pkgconfig(tcore)
23 BuildRequires:  pkgconfig(iniparser)
24
25 %description
26 Telephony Packet Service library
27
28 %prep
29 %setup -q
30 %ifarch %ix86
31 %if "%{simulator}" != "1"
32 %patch0 -p1
33 %patch1 -p1
34 %patch2 -p1
35 %endif
36 %endif
37
38 %build
39 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DSYSCONFDIR=%{_sysconfdir}
40 make %{?jobs:-j%jobs}
41
42 %post 
43 /sbin/ldconfig
44
45 #create db
46 mkdir -p /opt/dbspace
47
48 if [ ! -f /opt/dbspace/.dnet.db ]
49 then
50   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db.sql
51   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db_data.sql
52 fi
53
54 rm -f /usr/share/ps-plugin/dnet_db.sql
55 rm -f /usr/share/ps-plugin/dnet_db_data.sql
56
57 #change file permission
58 if [ -f /opt/dbspace/.dnet.db ]
59 then
60         chmod 660 /opt/dbspace/.dnet.db
61 fi
62
63 if [ -f /opt/dbspace/.dnet.db-journal ]
64 then
65         chmod 664 /opt/dbspace/.dnet.db-journal
66 fi
67
68 %postun -p /sbin/ldconfig
69
70 %install
71 %make_install
72 mkdir -p %{buildroot}/usr/share/license
73
74 %files
75 %manifest tel-plugin-packetservice.manifest
76 %defattr(-,root,root,-)
77 #%doc COPYING
78 /usr/share/ps-plugin/dnet_db.sql
79 /usr/share/ps-plugin/dnet_db_data.sql
80 %{_sysconfdir}/dbus-1/system.d/*
81 %{_libdir}/telephony/plugins/ps-plugin*
82 /usr/share/license/tel-plugin-packetservice