Tizen 2.1 base
[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 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
57 make
58
59 %install
60 rm -rf %{buildroot}
61 %make_install
62 mkdir -p  %{buildroot}%{_optdir}/share/bt-ftp
63
64 %post
65 # For the FTP server folder
66 if  [ ! -e /opt/share/bt-ftp ]
67 then
68         mkdir -p  /opt/share/bt-ftp
69 fi
70
71 if  [ ! -e /opt/share/bt-ftp/Media ]
72 then
73         ln -s /opt/usr/media /opt/share/bt-ftp/Media
74 fi
75
76 if  [ ! -e /opt/share/bt-ftp/SD_External ]
77 then
78         ln -s /opt/storage/sdcard /opt/share/bt-ftp/SD_External
79 fi
80
81 vconftool set -tf bool memory/private/bluetooth-share/quickpanel_clear_btn_status FALSE -g 6520 -i
82 vconftool set -tf bool memory/private/bluetooth-share/opp_server_init FALSE -g 6520 -i
83
84 if [ ! -f /opt/dbspace/.bluetooth_trasnfer.db ]
85 then
86         sqlite3 /opt/dbspace/.bluetooth_trasnfer.db 'PRAGMA journal_mode = PERSIST;
87         create table if not exists inbound (
88                 id INTEGER PRIMARY KEY autoincrement,
89                 sid INTEGER,
90                 tr_status INTEGER,
91                 file_path TEXT,
92                 dev_name TEXT,
93                 timestamp INTEGER default 0,
94                 addr TEXT
95         );
96         create table if not exists outbound (
97                 id INTEGER PRIMARY KEY autoincrement,
98                 sid INTEGER,
99                 tr_status INTEGER,
100                 file_path TEXT,
101                 dev_name TEXT,
102                 timestamp INTEGER default 0,
103                 addr TEXT
104         );
105         '
106 fi
107
108 chown :5000 /opt/dbspace/.bluetooth_trasnfer.db
109 chown :5000 /opt/dbspace/.bluetooth_trasnfer.db-journal
110 chmod 660 /opt/dbspace/.bluetooth_trasnfer.db
111 chmod 660 /opt/dbspace/.bluetooth_trasnfer.db-journal
112
113 if [ -f /usr/lib/rpm-plugins/msm.so ]
114 then
115 chsmack -a 'bt_share::db' /opt/dbspace/.bluetooth_trasnfer.db
116 chsmack -a 'bt_share::db' /opt/dbspace/.bluetooth_trasnfer.db-journal
117 fi
118
119 %files
120 %manifest bluetooth-share.manifest
121 %defattr(-,root,root,-)
122 %{_bindir}/bluetooth-share
123 %{_datadir}/dbus-1/services/org.bluetooth.share.service
124 %{_optdir}/share/bt-ftp
125
126 %files -n libbluetooth-share
127 %defattr(-, root, root)
128 %{_libdir}/libbluetooth-share-api.so.0.*
129
130 %files -n libbluetooth-share-devel
131 %defattr(-, root, root)
132 /usr/include/bluetooth-share-api/bluetooth-share-api.h
133 %{_libdir}/libbluetooth-share-api.so
134 %{_libdir}/pkgconfig/bluetooth-share-api.pc