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