merge with master
[platform/core/connectivity/bluetooth-share.git] / packaging / bluetooth-share.spec
1 %define _optdir /opt
2
3 Name:       bluetooth-share
4 Summary:    Bluetooth file share Agent
5 Version:    0.0.46
6 Release:    2
7 Group:      TO_BE/FILLED_IN
8 License:    Apache License, Version 2.0
9 Source0:    %{name}-%{version}.tar.gz
10 BuildRequires:  cmake
11 BuildRequires:  gettext-tools
12 BuildRequires:  pkgconfig(appcore-efl)
13 BuildRequires:  pkgconfig(bluetooth-api)
14 BuildRequires:  pkgconfig(glib-2.0)
15 BuildRequires:  pkgconfig(aul)
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(calendar-service2)
18 BuildRequires:  pkgconfig(contacts-service2)
19 BuildRequires:  pkgconfig(vconf)
20 BuildRequires:  pkgconfig(syspopup-caller)
21 BuildRequires:  pkgconfig(pmapi)
22 BuildRequires:  pkgconfig(sysman)
23 BuildRequires:  pkgconfig(notification)
24 BuildRequires:  pkgconfig(appsvc)
25 BuildRequires:  pkgconfig(db-util)
26 BuildRequires:  pkgconfig(libprivilege-control)
27 BuildRequires:  pkgconfig(capi-content-media-content)
28
29 %description
30 Bluetooth File Share Agent
31
32 %package -n libbluetooth-share
33 Summary:    Bluetooth share library
34 Group:      Development/Libraries
35 Requires:   %{name} = %{version}-%{release}
36
37 %description -n libbluetooth-share
38 Bluetooth share library
39
40 %package -n libbluetooth-share-devel
41 Summary:    Development package for libbluetooth-share
42 Group:      Development/Libraries
43 Requires:   %{name} = %{version}-%{release}
44
45 %description -n libbluetooth-share-devel
46 Development package for libbluetooth-share
47
48 %prep
49 %setup -q
50
51 %build
52 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
53 make
54
55 %install
56 rm -rf %{buildroot}
57 %make_install
58 mkdir -p  %{buildroot}%{_optdir}/share/bt-ftp
59
60 %post
61 # For the FTP server folder
62 if  [ ! -e /opt/share/bt-ftp ]
63 then
64         mkdir -p  /opt/share/bt-ftp
65 fi
66
67 if  [ ! -e /opt/share/bt-ftp/Media ]
68 then
69         ln -s /opt/usr/media /opt/share/bt-ftp/Media
70 fi
71
72 if  [ ! -e /opt/share/bt-ftp/SD_External ]
73 then
74         ln -s /opt/storage/sdcard /opt/share/bt-ftp/SD_External
75 fi
76
77 vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i
78 vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i
79
80 if [ ! -f /opt/dbspace/.bluetooth_trasnfer.db ]
81 then
82         sqlite3 /opt/dbspace/.bluetooth_trasnfer.db 'PRAGMA journal_mode = PERSIST;
83         create table if not exists inbound (
84                 id INTEGER PRIMARY KEY autoincrement,
85                 sid INTEGER,
86                 tr_status INTEGER,
87                 file_path TEXT,
88                 dev_name TEXT,
89                 timestamp INTEGER default 0,
90                 addr TEXT
91         );
92         create table if not exists outbound (
93                 id INTEGER PRIMARY KEY autoincrement,
94                 sid INTEGER,
95                 tr_status INTEGER,
96                 file_path TEXT,
97                 dev_name TEXT,
98                 timestamp INTEGER default 0,
99                 addr TEXT
100         );
101         '
102 fi
103
104 chown :5000 /opt/dbspace/.bluetooth_trasnfer.db
105 chown :5000 /opt/dbspace/.bluetooth_trasnfer.db-journal
106 chmod 660 /opt/dbspace/.bluetooth_trasnfer.db
107 chmod 660 /opt/dbspace/.bluetooth_trasnfer.db-journal
108
109 if [ -f /usr/lib/rpm-plugins/msm.so ]
110 then
111 chsmack -a 'bt_share::db' /opt/dbspace/.bluetooth_trasnfer.db
112 chsmack -a 'bt_share::db' /opt/dbspace/.bluetooth_trasnfer.db-journal
113 fi
114
115 %files
116 %manifest bluetooth-share.manifest
117 %defattr(-,root,root,-)
118 %{_bindir}/bluetooth-share
119 %{_datadir}/dbus-1/services/org.bluetooth.share.service
120 %{_optdir}/share/bt-ftp
121
122 %files -n libbluetooth-share
123 %defattr(-, root, root)
124 %{_libdir}/libbluetooth-share-api.so.0.*
125
126 %files -n libbluetooth-share-devel
127 %defattr(-, root, root)
128 /usr/include/bluetooth-share-api/bluetooth-share-api.h
129 %{_libdir}/libbluetooth-share-api.so
130 %{_libdir}/pkgconfig/bluetooth-share-api.pc