Fix for 64-bit build compatibility
[platform/core/telephony/tel-plugin-packetservice.git] / packaging / tel-plugin-packetservice.spec
1 %define major 0
2 %define minor 2
3 %define patchlevel 98
4
5 Name:           tel-plugin-packetservice
6 Version:        %{major}.%{minor}.%{patchlevel}
7 Release:        0
8 License:        Apache
9 Summary:        Telephony Packet Service library
10 Group:          System/Libraries
11 Source0:        tel-plugin-packetservice-%{version}.tar.gz
12 BuildRequires:  cmake
13 BuildRequires:  python
14 BuildRequires:  python-xml
15 #BuildRequires:  model-build-features
16 BuildRequires:  pkgconfig(gio-2.0)
17 BuildRequires:  pkgconfig(gio-unix-2.0)
18 BuildRequires:  pkgconfig(glib-2.0)
19 BuildRequires:  pkgconfig(libxml-2.0)
20 BuildRequires:  pkgconfig(iniparser)
21 BuildRequires:  pkgconfig(tcore)
22 BuildRequires:  pkgconfig(db-util)
23 BuildRequires:  pkgconfig(vconf)
24 BuildRequires:  pkgconfig(alarm-service)
25 BuildRequires:  pkgconfig(security-server)
26 Requires(post): /sbin/ldconfig
27 Requires(postun): /sbin/ldconfig
28
29 %description
30 Telephony Packet Service library
31
32 %prep
33 %setup -q
34
35 %build
36 %cmake . -DSYSCONFDIR=%{_sysconfdir} \
37         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
38         -DLIB_INSTALL_DIR=%{_libdir}
39 make %{?jobs:-j%jobs}
40
41 %post
42 /sbin/ldconfig
43
44 #create db
45 mkdir -p /opt/dbspace
46
47 if [ ! -f /opt/dbspace/.dnet.db ]
48 then
49   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db.sql
50   sqlite3 /opt/dbspace/.dnet.db < /usr/share/ps-plugin/dnet_db_init.sql
51 fi
52 if [ ! -f /opt/dbspace/.dnet2.db ]
53 then
54   sqlite3 /opt/dbspace/.dnet2.db < /usr/share/ps-plugin/dnet_db.sql
55   sqlite3 /opt/dbspace/.dnet2.db < /usr/share/ps-plugin/dnet_db_init.sql
56 fi
57
58 rm -f /usr/share/ps-plugin/dnet_db.sql
59
60 #change file permission
61 if [ -f /opt/dbspace/.dnet.db ]
62 then
63         chmod 660 /opt/dbspace/.dnet.db
64         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet.db
65 fi
66
67 if [ -f /opt/dbspace/.dnet.db-journal ]
68 then
69         chmod 664 /opt/dbspace/.dnet.db-journal
70         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet.db-journal
71 fi
72
73 if [ -f /opt/dbspace/.dnet2.db ]
74 then
75         chmod 660 /opt/dbspace/.dnet2.db
76         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet2.db
77 fi
78
79 if [ -f /opt/dbspace/.dnet2.db-journal ]
80 then
81         chmod 664 /opt/dbspace/.dnet2.db-journal
82         chsmack -a 'telephony_framework::db' /opt/dbspace/.dnet2.db-journal
83 fi
84
85 if [ -f /etc/opt/upgrade/520.tel-plugin-packetservice.patch.sh ]
86 then
87         chmod 700 /etc/opt/upgrade/520.tel-plugin-packetservice.patch.sh
88 fi
89
90 if [ -f /opt/etc/dump.d/module.d/dump_packetservice.sh ]
91 then
92         chmod 700 /opt/etc/dump.d/module.d/dump_packetservice.sh
93 fi
94
95 %postun -p /sbin/ldconfig
96
97 %install
98 %make_install
99 mkdir -p %{buildroot}%{_datadir}/license
100
101 %files
102 %manifest tel-plugin-packetservice.manifest
103 %defattr(-,root,root,-)
104 /opt/etc/dump.d/module.d/dump_packetservice.sh
105 #%doc COPYING
106 %{_datadir}/ps-plugin/dnet_db.sql
107 %{_datadir}/ps-plugin/dnet_db_init.sql
108 %{_datadir}/ps-plugin/apns-conf.xml
109 %{_sysconfdir}/opt/upgrade/*
110 %{_libdir}/telephony/plugins/ps-plugin*
111 %{_datadir}/license/tel-plugin-packetservice