Fixes TIVI-2064
[profile/ivi/SettingsApp.git] / packaging / Settings.spec
1 Name:       Settings
2 Summary:    A HTML5 based app for system settings
3 Version:    0.0.2
4 Release:    1
5 Group:      Applications/Web Applications
6 License:    Apache-2.0
7 URL:        http://www.tizen.org2
8 Source0:    %{name}-%{version}.tar.bz2
9 BuildRequires:  zip
10 BuildRequires:  desktop-file-utils
11 Requires:   bluetooth-frwk-core
12 Requires:   bluetooth-frwk-service
13 Requires:   privacy-manager-server
14 Requires:   settingsd
15 Requires:   sqlite
16 Requires:   wrt-installer
17
18 %description
19 A HTML5 based app for system settings like WiFi, Bluetooth
20
21 %prep
22 %setup -q -n %{name}-%{version}
23
24 %build
25
26 make wgtPkg
27
28 #make %{?jobs:-j%jobs}
29
30 %install
31 rm -rf %{buildroot}
32 %make_install
33
34 %post
35 if [ -f /opt/usr/apps/.preinstallWidgets/preinstallDone ]; then
36     wrt-installer -i /opt/usr/apps/.preinstallWidgets/Settings.wgt;
37
38 # This is a work around to grant the app privilege to access the privacy APIs
39 # Since the pkg manager doesn't install the package information in the privacy database
40 # and the privacy-popup is not displaying to allow user to grant access, so for now
41 # just manually grant access by updating the privacy database directly
42     sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PackageInfo WHERE PKG_ID='ODBQpKvkS1'";
43     sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PrivacyInfo WHERE PKG_ID='ODBQpKvkS1'";
44     sqlite3 /opt/dbspace/.privacy.db "INSERT INTO PackageInfo(PKG_ID, IS_SET) VALUES('ODBQpKvkS1', 1)";
45     sqlite3 /opt/dbspace/.privacy.db "INSERT INTO PrivacyInfo(PKG_ID, PRIVACY_ID, IS_ENABLED) VALUES('ODBQpKvkS1', 'http://tizen.org/privacy/bluetooth', 1)";
46 fi
47
48 %postun
49 wrt-installer -un ODBQpKvkS1.Settings
50
51 # Remove privileges from database when uninstalling
52 sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PackageInfo WHERE PKG_ID='ODBQpKvkS1'";
53 sqlite3 /opt/dbspace/.privacy.db "DELETE FROM PrivacyInfo WHERE PKG_ID='ODBQpKvkS1'";
54
55 %files
56 %defattr(-,root,root,-)
57 /opt/usr/apps/.preinstallWidgets/Settings.wgt