Code sync: merged tizen 2.4 base source code
[platform/core/connectivity/bluetooth-tools.git] / packaging / bluetooth-tools.spec
1 Name:       bluetooth-tools
2 Summary:    Bluetooth-tools
3 Version:    0.2.35
4 Release:    0
5 Group:      Network & Connectivity/Bluetooth
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: bluetooth-address.service
9 BuildRequires:  cmake
10 Suggests:       bluetooth-share
11 Requires:       tizen-platform-config-tools
12 Requires :      bluetooth-tools-no-firmware
13
14 %description
15 Tools fo bluetooth run/stop and set address
16
17 %package no-firmware
18 Summary:    On/Off Bluetooth adapter
19 Group:      Network & Connectivity/Bluetooth
20 Requires:   %{name} = %{version}-%{release}
21 Requires:   rfkill
22 Conflicts:  bluetooth-firmware-bcm
23
24 %description no-firmware
25 On/Off bluetooth device
26
27 %prep
28 %setup -q
29
30 %build
31 export CFLAGS+=" -fpie -fvisibility=hidden"
32 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
33
34 %if "%{profile}" == "mobile"
35 export CFLAGS="$CFLAGS -DTIZEN_MOBILE"
36 %elseif "%{profile}" == "wearable"
37 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
38 %endif
39
40 %cmake \
41 %if "%{profile}" == "mobile"
42         -DTIZEN_MOBILE=YES \
43         -DTIZEN_WEARABLE=NO \
44 %elseif "%{profile}" == "wearable"
45         -DTIZEN_MOBILE=NO \
46         -DTIZEN_WEARABLE=YES \
47 %else
48         -DTIZEN_MOBILE=NO \
49         -DTIZEN_WEARABLE=NO \
50 %endif
51
52 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
53 %__make %{?_smp_mflags}
54 #cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
55 #make %{?jobs:-j%jobs}
56
57 %install
58 rm -rf %{buildroot}
59 %make_install
60
61 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
62 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
63 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
64 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
65
66 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
67 install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
68 ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
69
70 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
71 install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
72 install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
73 install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools
74
75 %files
76 %manifest %{name}.manifest
77 %defattr(-,root,root,-)
78 %{_sysconfdir}/rc.d/init.d/bluetooth-address
79 %{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
80 %{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
81 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-up.sh
82 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-down.sh
83 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-reset-env.sh
84 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
85 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
86 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
87 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
88 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
89 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh
90 %{_datadir}/license/bluetooth-tools
91 %{_unitdir}/multi-user.target.wants/bluetooth-address.service
92 %{_unitdir}/bluetooth-address.service
93
94 %files no-firmware
95 %manifest %{name}.manifest
96 %defattr(-, root, root)
97 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
98 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh